Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem writing javascript into Dreamweaver

Status
Not open for further replies.

MediaGuy

Technical User
Aug 1, 2001
16
US
Help! I'm attempting to place javacript into a DW page. It is a typical scrolling script where you put code in the HEAD of your html, then add an onLoad event handler into the BODY tag, and then put code into the Body of the document. It is a freebee script from JavaSource.

Anyway, it works fine if I start from a blank page. However, if I start from a page which already has my navigation bar on it (which is javascript too) there seems to be a conflict. The scroll won't appear in the browser. I'm new to javascript, so it is probably me. One thing I noticed is my existing script for the nav bar is plain javascript, while the scrolling script is javascript 1.2; could this cause a conrflict? I'm previewing in IE6.

Thanks for any help you can give.
 
Much easier if you post your code.

I'm going to take a punt and bet you have got to onload commands happening. Only the first one will work. Need to have the two onload's combined into one with a ";" between the.

Post your code.

Easier to advise.

NB

(1)Doubtful its the javascript issue.
(2) Have you chekced your scroller cross browser? They often don't work in NS properly.

 
Post the code, if you can...or the URL for the problem in question... I have not failed; I have merely found 100,000 different ways of not succeding...
 
I would bet on the 2 * onLoad events as well.

Cheech The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
Thanks. It turns out that a double onLoad was part of the problem. However, the other part was, I still couldn't get it to run until I detached the page from its template. It turns out that the &quot;<!--BeginTemplat blah blah blah-->&quot; is positioned in such a way as to place the onLoad event (in the body tag) within the uneditable text. I could write the onLoad event in the yellowed out body line, but it would not be recognized by the browser. As soon as I detached from the template, and then fixed the onLoad problem, it worked. But both issues had to be fixed. Anyone else have problems with javascript when the page is attached to a template?
 
I don't use templtates because they scare me. I design those parts of the site tha stay the same throughout the site, save them seperately, and then use include files to insert them in where they ened to go.

Then I don't get all the template problems.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top