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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unterminated string constant

Status
Not open for further replies.

enak

Programmer
Jul 2, 2002
412
0
0
US
I keep getting this error message. I don't know why. Does anyone have a clue because I don't?

Here is what I have:

var ImgPath = "D:\Projects\Andrews&Kurth\EMAC2002B\Floorplan Manager\photos\"
.
.
.
<td><img src=&quot;<%=ImgPath%>0<%=rs(&quot;timekeeperid&quot;)%>.jpg&quot; width=100 height=100/>

TIA
Nate

 
Can you post more of your code?

var ImgPath = &quot;D:\Projects\Andrews&Kurth\EMAC2002B\Floorplan Manager\photos\&quot;

is javascript, are you using jscript server-side?
Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Yes, this is server-side javascript
 
try (just for debugging) removing &quot;<%=rs(&quot;timekeeperid&quot;)%>&quot; from your image source. Then try removing &quot;<%=ImgPath%>&quot; and see if you can figure out where it's happening.

I suspect that it isn't happening in either of the lines you posted... Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
I did that but I got the same result. Here is the error message that I am getting.


Unterminated string constant
/EMAC2002B/FloorPlan Manager/FloorMgr_Cleaned.asp, line 806, column 77
var ImgPath = &quot;D:\Projects\Andrews&Kurth\EMAC2002B\Floorplan Manager\photos\&quot;
----------------------------------------------------------------------------^
 
var ImgPath = server.URLencode(&quot;D:\Projects\Andrews&Kurth\EMAC2002B\Floorplan Manager\photos\&quot;)
Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Hi Enek,
try using like below :
var ImgPath = &quot;D:\Projects\Andrews_Kurth\EMAC2002B\Floorplan Manager\photos\&quot;

If it works then it is definitely '&' that is creating problem. When a request is passed to server this '&' act as paremeter- value seperator.

Hope it will help Experience teaches slowly and at the cost of mistakes [pipe]
 
Thanks for all of your help. Nothing has helped so I will hard code it for now.
 
The space in the string is crashing it, the server.urlEncode should fix it... Get the Best Answers! faq333-2924
&quot;A witty saying proves nothing.&quot; - Voltaire
mikewolf@tst-us.com
 
Ah Ha! I figured it out. It was none of the above. The \&quot; at the end of the string was being converted to just a &quot; as part of the string. I have fixed the problem and have moved on.

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top