Welcome, Guest
Username: Password: Remember me

TOPIC: Javascript runs in chrome but not IE

Javascript runs in chrome but not IE 2 years 11 months ago #70689

  • chinglnc
  • chinglnc's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
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
The administrator has disabled public write access.

Re: Javascript runs in chrome but not IE 2 years 11 months ago #70691

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4358
  • Thank you received: 826
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Javascript runs in chrome but not IE 2 years 11 months ago #70693

  • chinglnc
  • chinglnc's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
yes, it's off- it's weird because it only has problem in iE
The administrator has disabled public write access.

Re: Javascript runs in chrome but not IE 2 years 11 months ago #70695

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4358
  • Thank you received: 826
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Javascript runs in chrome but not IE 2 years 11 months ago #70699

  • chinglnc
  • chinglnc's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
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
The administrator has disabled public write access.

Re: Javascript runs in chrome but not IE 2 years 11 months ago #70702

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4358
  • Thank you received: 826
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Javascript runs in chrome but not IE 2 years 11 months ago #70703

  • chinglnc
  • chinglnc's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
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: 2 years 11 months ago by chinglnc. Reason: html xss filtering cannot be turned off in the demo
The administrator has disabled public write access.

Re: Javascript runs in chrome but not IE 2 years 11 months ago #70704

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4358
  • Thank you received: 826
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.112 seconds
Donation Image