PDA

View Full Version : "Unterminated String Constant" when used on eTeamz site



jcorring
09-06-2008, 09:39 AM
1) Script Title: Conveyor Belt slideshow script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/index.html

3) Describe problem: Unterminated String Constant when placing this script inside a text box.

See web site: http://www.eteamz.com/ufll/news/index.cfm?subsite=1890578&cat=0#news4421878
using IE 7



Our web environment is hosted and allows script to be pasted anywhere the script could run in the body portion of a page. Specifically, I am given access to place code in text boxes. No access to the Head section of the page.

When I place this script in and load the page, I get the "Unterminated String Constant" when I load the page.

I have commented out most of the script to try to isolate a piece of code that could be the source. I've found that when I add all the code through the function definitions, I am fine. Once I add the following, I get the error:

if (iedom||document.layers){
with (document){
}
}

(I stripped out the document write statements to indentify just these lines that cause the problem.)

to simplify further, if I take out the

with (document){
}

and add just

if (iedom||document.layers){
}

I DO NOT get the error!

So I leave out the "with document" block and change all the write statements to "document.write" and I get the same error again.

Any idea what is the problem here? Since the script seems to work so well for so many, I suspect it is the environment I am trying to drop it into. But I don't know how to debug it!

jcorring
09-06-2008, 11:51 AM
but have found no joy there. Most are similar to this post:

http://www.dynamicdrive.com/forums/archive/index.php/t-21884.html

and reference the following line in the code: var finalslide=''

There was a time when the sample script had var finalslide=' instead, but that has been fixed in the demo code and is correct in my code. Help please!

jscheuer1
09-09-2008, 05:41 PM
I'd get a better host, there are plenty out there. Sounds like it could be that a line or lines is getting wrapped. Depending upon which line or lines, these can be wrapped at appropriate places before pasting into the text box. I'd try wrapping the longest line first. This can be done at the plus (+) as highlighted below:


if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+
';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}

And you can get rid of all of the red lines.

jcorring
09-10-2008, 09:07 PM
Thanks John. I'm still struggling though. All of the other posts that refernce this issue on eTeamz sites are either no longer existant or don;t have the conveyor belt implemented now. Really looks like something eTeams is preventing. I'll keep trying!