cancel
Showing results for 
Search instead for 
Did you mean: 

Can not add script inside a webcontent of html type

ramdas_mayya
Champ in-the-making
Champ in-the-making
We are trying to add a html content in a web content.
Whenever we add java script inside that the script tag is getting commented.
The content is as shown below. After creating the content yo can see that the commented script tag.
How to add java script inside this HTML content ?.
<code>
<script type="text/javascript"><!–
// –></script>

<script type="text/javascript"><!–
function switchContent(obj) {
obj = (!obj) ? 'sub1' : obj;
var contentDivs = document.getElementById('container').getElementsByTagName('div');
for (i=0; i<contentDivs.length; i++) {
if (contentDivs.id && contentDivs.id.indexOf('sub') != -1) { contentDivs.className = 'hide'; }
}
document.getElementById(obj).className = '';
}
// –></script>
</p>
<div id="sub1">
<div id="estext"><a class="translink es" onclick="switchContent('sub2'); return false;" href="#">Español</a></div>
<h1 class="sctitle">Frequently Asked Questions</h1>
<code>
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

as far as I can see. the script is not commented. The comment by
//
is a JavaScript comment for the code line, which only comments the
–>
. It should not be affecting the
</script>
tag as this is outside of JavaScript and can only be affected by HTML comments, which is why the HTML comment section is ended just prior to it by
–>
.

Regards
Axel