Home > syntax error > cdata syntax error javascript

Cdata Syntax Error Javascript

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and

Find Syntax Error In Javascript

policies of this site About Us Learn more about Stack Overflow the company find syntax error in javascript online Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users

Uncaught Syntax Error Javascript

Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a how to use cdata in html minute: Sign up Syntax error while trying to add CDATA within script tags dynamically up vote 1 down vote favorite 1 So there is an ad code which I try to add to the DOM dynamically, something that looks like this: If I paste this code directly in the source code, it works, but if I cdata html5 try to insert it to the DOM with jQuery it throws some untraceable errors - at least I cant trace it. Actually this: The interesting part is that Firebug connects this error to random scripts in the page which contain jQuery. The ad code is inserted into the DOM this way /element is a jQuery object/: element.html(data.content); What I have tried yet: I have tried to remove the html comment tags. I have tried to wrap the wole code to a script tag dynamically created by jQuery. I even tried to remove the CDATA tags, but that broke everything, I think it is important for the main ad handler script provided by the ad manager company. Any help would be appreciated, thanks in advance! (Please dont care about the method, it must be done with ajax.) EDIT: The problem still persists, but I think there must be a problem with the ad code, so I accepted the first useful answer for this topic. javascript jquery ajax cdata share|improve this question edited Mar 11 '13 at 12:25 asked Mar 1 '13 at

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack

Cdata In Javascript File

Overflow the company Business Learn more about hiring developers or posting ads with us what is cdata in javascript Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a

Html Cdata Equivalent

community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Should I use “]]>” or “//]]>” for closing a CDATA section into xHTML up vote http://stackoverflow.com/questions/15154407/syntax-error-while-trying-to-add-cdata-within-script-tags-dynamically 17 down vote favorite 6 I want to inline scripts or CSSs into XHTML without escaping special characters. I can do that using a CDATA marked section. According to http://www.w3.org/TR/xhtml1/#h-4.8 the CDATA section can be defined as: Then, according to http://www.w3schools.com/TAGS/tag_script.asp, the CDATA can look like: Which method for closing the CDATA section is better? http://stackoverflow.com/questions/2375217/should-i-use-or-for-closing-a-cdata-section-into-xhtml ]]> or //]]> ? javascript html css xhtml cdata share|improve this question edited Oct 2 '15 at 5:09 DanAlexson90 2718 asked Mar 3 '10 at 21:43 Marc 88114 1 Or, just to externalize scripts. BTW: there are MVC frameworks which are based on XHTML (because they use a XML tool to parse source/generate output). That's the only where XHTML is good for. –BalusC Mar 3 '10 at 23:21 add a comment| 4 Answers 4 active oldest votes up vote 33 down vote accepted According to www.w3.org/TR/xhtml1/#h-4.8 the CDATA section can be defined as: [no //] Yeah. In XHTML, they can. Proper XHTML, as read by an XML parser like when you serve application/xhtml+xml to a web browser that isn't IE. But probably you're actually serving as text/html, which means your browser isn't an ‘XML processor’ as referenced in that section. It's a legacy-HTML4 parser, so you have to abide by the appendix C guidelines and avoid any XML features that don't work in HTML4. In particular, the strings in a script or