Check out the LimeSurvey source code on GitHub!

Javascript runs in chrome but not IE

More
5 years 2 months ago #70689 by chinglnc
When I write inline HTML/javascript in the editor and save, the <script></script> tags and everything between are removed

This only happens in IE- it's fine in Chrome

Any ideas how to fix this?

Thanks

Please Log in to join the conversation.

More
5 years 2 months ago #70691 by tpartner
Have you set the XSS filter to "Off"?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 2 months ago #70693 by chinglnc
yes, it's off- it's weird because it only has problem in iE

Please Log in to join the conversation.

More
5 years 2 months ago #70695 by tpartner
Yeah, it is odd - I can't reproduce the problem using 1.91 (11616) and IE8.

Can you give us an example of a script that doesn't work?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 2 months ago #70699 by chinglnc
I put this code in the editor using chrome:

<div id="div1">push the button</div><br />
<button type="submit" onclick="thisClick()" value="submit"></button>
<p>
<script LANGUAGE=JAVASCRIPT>
function thisClick(){
alert('CLICKED');
}
</script>
</p>
</div>

It runs fine

Then if I go to IE9 and look in the editor I see:
<div id="div1">push the button</div>
<br />
<button type="submit" onclick="thisClick()" value="submit"></button>
<p> </p>

- the <script> tag has been removed

Thanks

Please Log in to join the conversation.

More
5 years 2 months ago #70702 by tpartner
Try using a "type" instead of a "language" attribute:
<script type="text/javascript" charset="utf-8">
 
	function thisClick(){
		alert('CLICKED');
	}
 
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #70703 by chinglnc
I put this in the editor and it was removed as before

Also I've tried using the online Demo with this code - the survey is called 'java test' and the question is 'q1'

The code is totally reformatted when I enter it there and save the changes

<div id="div1">
push the button</div>
<br />
<button onclick="thisClick()" type="submit" value="submit"></button>
<p>
<script type="text/javascript charset="utf-8"">
function thisClick(){
alert('CLICKED');
}
</script></p>

Thanks

edit: have just realised that the global security setting to turn off html XSS filtering cannot be turned off
Last Edit: 5 years 2 months ago by chinglnc. Reason: html xss filtering cannot be turned off in the demo

Please Log in to join the conversation.

More
5 years 2 months ago #70704 by tpartner
It may be a bug in the editor with IE9. I'll test and get back to you when I have access to IE9 tonight.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form