View Full Version : Losing javascript functionality when creating HTML file from a template

12-29-2011, 09:40 PM
I'm new here, I've read the do's and dont's. I'm also new to javascript and some of the more complex things in Dreamweaver. Please forgive me if I violate any forum policies, am not articulating properly, etc. and advice as to how I should post here in the future is welcome. thanks

My issue:
I've created a rotating slide show (5 images, javascript, will change as timed or on-click) that works fine as a stand-alone file, worked in a prototype home built directly as HTML and works within the new home page template I've built.

However, when I go to "new" and create the index.html outside the template folder, this one piece of functionality stops working. And if I save a copy of the .dwt outside the template folder, it stops working in that file as well.

All other javascript items work fine in either file type and either location.
I'm assuming there's something in this rotator code conflicting with the save to HTML processing, and I am just not smart enough to figure out. although I have tried for about 3 hours now.

I've attached a zip with the rotator code and images (these are roughs...I know there's an iStock comp and a lo-rez image in there), and a screen grab showing foldering structure in the event that may be the issue.

Thanks in advance for any input.

12-30-2011, 01:31 PM
Hi kerryg,
Have a look at the paths to your files. My bet is that your index.html has them wrong.

And welcome to our forum!

12-30-2011, 03:19 PM
Oh my!! This is a big "DOH!" moment!!

But now I have this to ask:
Why does Dreamweaver update all image paths except those in the js?
Why does the js and map info become uneditable when template is saved to html, even when it applies to editable content?

I tried to save the info between <head>js</head> as editable, but have not been able to figure out how (if it is even possible). Can I move script into the body?

Regardless...thanks a bunch and I'm glad I found this group.

01-01-2012, 11:03 AM
It's actually recommended to put links to script files just before the close of the body.

You'll quite quickly outgrow dw templates though, they're poor. You are far better using php includes which are even easier to use. Tutorial on the front page of this site.

01-02-2012, 03:18 PM
Thanks, Ricky55. I had just started looking into php includes last week, and will continue down that path.