JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 16th, 2008, 06:32 PM
ksgill ksgill is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 104 ksgill User rank is Private First Class (20 - 50 Reputation Level)ksgill User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 13 h 19 m 33 sec
Reputation Power: 7
Talking Unterminated String Literal Error

Hello,

The line I am getting this error from is -

Code:
var jsstart="<script type=\"text/javascript\" language=\"JavaScript\"> function SetValue() {self.close()} </script>";


If I remove </script> from the end, the error disappears. I have wasted a lot of time on this but I am unable to figure this one out. Any ideas guys?

Reply With Quote
  #2  
Old October 16th, 2008, 07:39 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 662 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 15 m 9 sec
Reputation Power: 69
i think your script is interpreting the forward slash as a line javascript line break. try replacing the forward slash with "%2F"; you may have to use eval() - you'll just have to test it and see.

Reply With Quote
  #3  
Old October 16th, 2008, 07:57 PM
ksgill ksgill is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 104 ksgill User rank is Private First Class (20 - 50 Reputation Level)ksgill User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 13 h 19 m 33 sec
Reputation Power: 7
Quote:
Originally Posted by web_loone08
i think your script is interpreting the forward slash as a line javascript line break. try replacing the forward slash with "%2F"; you may have to use eval() - you'll just have to test it and see.


Thanks a lot! After I changed </script> to <\/script>, it worked like a charm.

Reply With Quote
  #4  
Old October 16th, 2008, 08:23 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 662 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 15 m 9 sec
Reputation Power: 69
yep - you can do that too - whatever work

Reply With Quote
  #5  
Old October 17th, 2008, 12:49 PM
Clone53421's Avatar
Clone53421 Clone53421 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 778 Clone53421 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Clone53421 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Clone53421 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Clone53421 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Clone53421 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Clone53421 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Clone53421 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 17 h 1 m 3 sec
Reputation Power: 101
The browser interprets "</script>" as the ending script tag. Easy way I've always fixed that is to use "</scr"+"ipt>" instead.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Unterminated String Literal Error

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap