Linked Questions
85 questions linked to/from When is a CDATA section necessary within a script tag?
196
votes
6
answers
210k
views
What is CDATA in HTML? [duplicate]
What is the use of CDATA inside JavaScript tags and HTML?
<script type="text/javascript">
// <![CDATA[
// ]]>
</script>
5
votes
1
answer
5k
views
Why use *//<![CDATA[* and *//]]>* in a jQuery script? [duplicate]
I have this working piece of javascript:
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function() {
jQuery("#page_template option[value='sidebar-...
1
vote
0
answers
70
views
Does the CDATA tag change anything in javascript [duplicate]
What does the cdata tags do in javascript? As in:
<script type="text/javascript">
//<![CDATA[
code...
//]]>
</script>
0
votes
0
answers
54
views
Got errors when using XMLHttpRequest [duplicate]
I have problems when using XMLHttpRequest. One occurs in Chrome; the other in firefox
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (...
1324
votes
13
answers
1.8m
views
What does <![CDATA[]]> in XML mean?
I often find this strange CDATA tag in XML files:
<![CDATA[some stuff]]>
I have observed that this CDATA tag always comes at the beginning, and then followed by some stuff.
But sometimes it is ...
180
votes
11
answers
57k
views
Do you need text/javascript specified in your <script> tags?
I read somewhere that you no longer need things like type="text/javascript" and the weird CDATA and <!-- things in your script tags. So, instead of:
<script type="text/javascript">
//<![...
111
votes
10
answers
51k
views
Are HTML comments inside script tags a best practice? [closed]
The following practice is fairly commonplace in the inline JavaScript I have to work with:
<script type="text/javascript">
<!--
// Code goes here
//-->
</script>
I know ...
24
votes
8
answers
1k
views
JavaScript <!-- //--> are required?
I just like to ask what the title says. The following string required into HTML script tags?
<!--
//-->
If I don't use them what would happen?
14
votes
8
answers
49k
views
How to remove `//<![CDATA[` and end `//]]>`?
How can I remove the (//<![CDATA[ , //]]>) blocks; tags inside a script element.
<script type="text/javascript">
//<![CDATA[
var l=new Array();
..........................
...
10
votes
6
answers
68k
views
how to call js function without event
How can I just call a js function from within an html file, with no event trigger? I want to have code like:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://...
16
votes
7
answers
3k
views
(Rails) Assert_Select's Annoying Warnings
Does anyone know how to make assert_select not output all those nasty html warnings during a rake test? You know, like this stuff:
.ignoring attempt to close body with div
opened at byte 1036, line 5
...
10
votes
3
answers
57k
views
Howto rotate image using jquery rotate plugin?
How do you rotate an image using jQuery-rotate plugin?
I have tried the following and it doesn't seem to work:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; ...
5
votes
5
answers
13k
views
Can't run JavaScript in CDATA
I am trying to run following HTML in every browser: Opera, FF, IE, Chrome
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html ...
6
votes
2
answers
6k
views
How to escape '$' and '#' in Facelets/EL?
I'm using Java Facelets and jQuery, however the expression
$('...')
in jQuery conflicts with EL expression, how do I escape the jQuery's one?
I'd like to escape a large chunk of Javascript, too.
...
11
votes
2
answers
8k
views
Is CDATA necessary when styling an inline SVG?
I've read mixed things about this, so I'm hoping to get it sorted definitively.
If I have SVG markup that is inline within an HTML document, and I am styling it with CSS, do I need to wrap that CSS in ...