Home > Unterminated String > Unterminated String Literal Javascript Error Solution

Unterminated String Literal Javascript Error Solution

Contents

"); document.getElementById('theID').innerHTML += buff.join("\r\n"); share|improve this answer edited Nov 17 '11 at 15:31 answered Nov 17 '11 at 14:32 Alex

rarity? Can the editor of a book add citations of individual chapters to his own citation count? Why were Navajo code talkers used during WW2? Louis, MO, USA Posts 1,582 [RESOLVED] Unterminated string literal? have a peek at this web-site

Pauline"}) Go to Solution 5 Comments LVL 82 Overall: Level 82 JavaScript 54 PHP 48 Web Applications 11 Message Active 1 day ago Expert Comment by:hielo2008-04-05 Replace your script line I appreciate every one of you for reaching out. –Joshua Walcher Nov 18 '11 at 14:59 add a comment| up vote 2 down vote You could use a single \ to Join them; it only takes a minute: Sign up Javascript Error - Unterminated String Literal on concatenation if concatenated string has a space in it up vote 0 down vote favorite Results 1 to 5 of 5 Thread: [RESOLVED] Unterminated string literal?

Unterminated String Literal Javascript Error Solution

Why was Susan treated so unkindly? And I found the error. more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation

Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery… jQuery Web Languages/Standards-Other HTML JavaScript Applying Page mozilla Ask a question Sign In English Search Home Support Forum Firefox unterminated string literal error every ... The + operator variant looks like this: var longString = "This is a very long string which needs " + "to wrap across multiple lines because " + "otherwise my code Syntaxerror Unterminated String Literal Jquery share|improve this answer answered Jan 5 '13 at 8:48 Hamish 14.5k23356 add a comment| Not the answer you're looking for?

Support Forum This thread was archived. Unterminated String Literal Php share|improve this answer answered Jan 10 '13 at 11:02 Pupil 15.9k22242 add a comment| up vote 0 down vote You can't assign multiline values to a variable in js, so you Join them; it only takes a minute: Sign up SyntaxError: unterminated string literal strange error [duplicate] up vote 9 down vote favorite This question already has an answer here: How do javascript jquery html share|improve this question edited Jan 30 '14 at 4:28 Balaji Kandasamy 3,11382750 asked Dec 11 '10 at 16:47 A.C.Balaji 3932622 add a comment| 4 Answers 4 active oldest

Why is the size of my email so much bigger than the size of its attached files? What Does Unterminated String Literal Mean Subscribe to our monthly newsletter for tech news and trends Membership How it Works Gigs Live Careers Plans and Pricing For Business Become an Expert Resource Center About Us Who We Encode the alphabet cipher What was that alien in Doctor Who that nobody saw? To fix this error, check if: you have opening and closing quotes (single or double) for your string literal, you have escaped your string literal correctly, your string literal works correctly

Unterminated String Literal Php

Dozens of earthworms came on my terrace and died there Enable Wireless on Fresh Debian Build In order to become a pilot, should an individual have an above average mathematical ability? add a comment| 1 Answer 1 active oldest votes up vote 17 down vote accepted Javascript strings can't break across newlines without an escape (\). Unterminated String Literal Javascript Error Solution About MDN Terms Privacy Cookies Contribute to the code Other languages: English (US) (en-US) Français (fr) 日本語 (ja) Go Skip to main content Switch language Skip to search X Tap here Unterminated String Literal Jquery Why is the bridge on smaller spacecraft at the front but not in bigger vessels?

It hints towards a PHP script error, though. http://cloudindet.com/unterminated-string/unterminated-string-constant-javascript.html Level? In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms What does "Your connection is not secure" mean? Unterminated String Literal Json

  1. Not the answer you're looking for?
  2. adding a space either within the concatenated string (i.e.
  3. My method has generally been to do something like this: document.getElementById('theID').innerHTML=document.getElementById('theID').innerHTML+'
  4. theString
  5. '; and that works fine unless the appended string is advanced HTML that includes both JavaScript variables and text.
  6. I had to replace some of the other information as it is private Thanks for all the help.
  7. The error could possible be the actual string.

Please see my code As you can see, the above code breaks the

Any suggestions for modifications is highly appreciated thanks! Javascript Unterminated String Literal Line Break First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. You may have to register before you can post: click the register link above to proceed.

Using an array can be efficient/readable; var buff = []; buff.push("
  • ..."); buff.push(""); document.getElementById('theID').innerHTML += buff.join("\r\n"); share|improve this answer edited Nov 17 '11 at 15:31 answered Nov 17 '11 at 14:32 Alex
  • share|improve this answer answered Jan 10 '13 at 11:00 Alnitak 215k42281353 add a comment| up vote 2 down vote I have copied and pasted the code into my machine. Advanced Search Forum Client-Side Development JavaScript [RESOLVED] Unterminated string literal? It's fine to have spaces within any HTML element outputted to the browser, but not if it is outside the tag (i.e. Unterminated String Error Enroll in a course and start learning today.

    Join them; it only takes a minute: Sign up unterminated string literal error up vote 2 down vote favorite 2 I have placed the below code inside of the tag.