/    Sign up×
Community /Pin to ProfileBookmark

javascript, unterminated string constant

Need advice on an issue

Getting a message saying unterminated string constant

This is the bit of code its referring to, specifically it says starting at the location.href bit of the code according to the line number and char number within the error message

[CODE]<a rel=”nofollow” style=”text-decoration:none;” href=”http://www.favoriten.de/” onclick=”window.open(‘http://www.favoriten.de/url-hinzufuegen.html?bm_url=’+encodeURIComponent(location.href)+’&amp;bm_title=’+encodeURIComponent(document.title));return false;’);return false;” title=”Bookmark to: Favoriten” onmouseout=”MM_swapImgRestore()” onmouseover=”MM_swapImage(‘favoriten’,”,’/includes/sb/images/favoriten_h.png’,1)”><img src=”/includes/sb/images/favoriten.png” alt=”Bookmark to: Favoriten” name=”favoriten” id=”favoriten” width=”20″ height=”20″ border=”0″></a>[/CODE]

Just to add, Right before it I also have this line of code, which is basically the same thing with a different website and image link, and it does not get the error message??

[code]<a rel=”nofollow” style=”text-decoration:none;” href=”http://www.linkarena.com/” onclick=”window.open(‘http://linkarena.com/bookmarks/addlink/?url=’+encodeURIComponent(location.href)+’&amp;title=’+encodeURIComponent(document.title)+’&amp;desc=&amp;tags=’);return false;” title=”Bookmark to: Linkarena” onmouseout=”MM_swapImgRestore()” onmouseover=”MM_swapImage(‘linkarena’,”,’/includes/sb/images/linkarena_h.png’,1)”><img src=”/includes/sb/images/linkarena.png” alt=”Bookmark to: Linkarena” name=”linkarena” id=”linkarena” width=”20″ height=”20″ border=”0″></a>[/code]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@mrhooOct 08.2010 — bm_title='+ encodeURIComponent(document.title));return false;');return false;
Copy linkTweet thisAlerts:
@BWWebDesignsauthorOct 08.2010 — Please explain more not sure what you meant, the code you posted is from what I can tell the same as the one I posted and doesnt have any explanation?
Copy linkTweet thisAlerts:
@mrhooOct 08.2010 — bm_title='+

this closes a single quoted string inside your double quoted url string.

encodeURIComponent(document.title));return false;');return false;"

the quote at the first return false;' does not match another single quote,

and there is an unmatched parenthesis or two as well.

This bit [B]);return false;');return false;"[/B]

may need to be [B];return false;"[/B]

But who knows?
Copy linkTweet thisAlerts:
@BWWebDesignsauthorOct 08.2010 — Yeah it wasnt my script and in editing it somehow I duplicated a part of that section and it needed to be removed like you said

Thanks for all the help, much appreciated :-)
×

Success!

Help @BWWebDesigns spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...