www.webdeveloper.com
Results 1 to 5 of 5

Thread: javascript, unterminated string constant

  1. #1
    Join Date
    Sep 2006
    Location
    Wixom, MI
    Posts
    292

    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>
    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>
    Last edited by BWWebDesigns; 10-07-2010 at 07:49 PM.
    OriginalFundRaisingWidget - Free "Non Commercial" PayPal FundRaising Widget, for Charities, Organizations and Individuals, Hosted Free. Check It Out

  2. #2
    Join Date
    Feb 2006
    Posts
    2,927
    bm_title='+ encodeURIComponent(document.title));return false;');return false;

  3. #3
    Join Date
    Sep 2006
    Location
    Wixom, MI
    Posts
    292
    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?
    OriginalFundRaisingWidget - Free "Non Commercial" PayPal FundRaising Widget, for Charities, Organizations and Individuals, Hosted Free. Check It Out

  4. #4
    Join Date
    Feb 2006
    Posts
    2,927
    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 );return false;');return false;"

    may need to be ;return false;"

    But who knows?
    Last edited by mrhoo; 10-07-2010 at 10:20 PM.

  5. #5
    Join Date
    Sep 2006
    Location
    Wixom, MI
    Posts
    292
    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 :-)
    OriginalFundRaisingWidget - Free "Non Commercial" PayPal FundRaising Widget, for Charities, Organizations and Individuals, Hosted Free. Check It Out

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles