Reputation: 15841
Currently im doing like this but internet explorer 7 doesn't recognize it:
gf.klass["LoginSkin"] = ""+<r><![CDATA[<div>
<ul>
<li value="login" >
login
</li>
<li value="cancel">
cancel
</li>
</ul>
</div>]]></r>;;
Upvotes: 0
Views: 1273
Reputation: 1074138
The syntax you've quoted is invalid JavaScript. The valid equivalent would be:
gf.klass["LoginSkin"] = '<div>\
<ul>\
<li value="login" >\
login\
</li>\
<li value="cancel">\
cancel\
</li>\
</ul>\
</div>';
Note the use of the trailing backslash to continue the literal to the next line. This is per Section 7.8.4 ("String Literals") of the spec.
Note that the leading characters of subsequent lines are part of the string (just as they are in your CDATA section).
Upvotes: 1
Reputation: 1573
you have element.innerHTML method to retrieve HTML of subelements !
Upvotes: 0