PDA

View Full Version : Javascript does not run



JohnJ
08-02-2008, 01:12 PM
1) Script Title: Ultimate Fade-In Slideshow (v1.51)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem:
I copied the code exactly as the instructions said to. Then modified the fadeimages lists to use my pictures. Tested it locally and all worked fine.

However, when I post it to my host it does not run.
http://www.hemifoundation.org/fading2.html

I used to get an error about "line 1, char 1, object expected" but that is not happening any more... It just does not show the slide show or any of the pictures.

I contacted support on my hosting service and they at first said it was a setting on my brower and couldn't help. Then another time they told me it was probably a problem with the script and to contact the script creator However, if I host it on a different domain at a different hosting service it does run. So, it is something specific about my host.

Has anyone had this problem? and how do I go about trying to fix it?

thank you

jscheuer1
08-02-2008, 04:21 PM
Somehow, most likely during either the editing or uploading process, all line breaks have been stripped from page's source code. Generally this will not harm HTML code (it might cause some minor changes in spacing in the layout), but for javascript (depending upon how it is written), most line breaks must remain intact. Even javascript code written with all the proper end line markers (many DD and other scripts skip these, as they are usually 'understood' at a physical line break), if it contains end line type comments and/or certain types of preface tokens to prevent browsers from interpreting it incorrectly, it must at least preserve the physical line breaks after those unless they are removed. End line type comments can be replaced by inline type comments, but the tokens I alluded to must be removed, and this can cause problems if they were actually required.

However, with this particular script - it would need much more than a tokens removal (if any, I don't think this script has any) and a comment type change because many of the end line markers are missing (as I outlined above can be done in javascript code).

The easiest solution would be to start over and make sure that the physical line breaks in the script are preserved.

JohnJ
08-02-2008, 06:47 PM
thank you, I noticed too that the line breaks were missing, dont know how, and didnt know it would be a problem.

I have been futzing with this for so long now I dont know anything anymore.

I did start over (for the upteenth time) and this time it seems to be working. (Knock on wood!!)

Thanks for your help!