Jump to content

Microsoft grr


Recommended Posts

When my page opens, thd IE Information bar appears and informs the user that the page they are viewing may be trying to download a file. The actual problem seems to be

<script type="text/javascript" src="action/form.js" ></script>

I know I can turn off the information bar - but I want my web page working on IE, with all it's default security settings. Can I not have an external JS file?

Link to comment
Share on other sites

That shouldn't happen unless your script is actually opening a link to a downloadable file.
No, it is not. Though it may see
<script src="action/form.js" type="text/javascript"></script>

as linking to a downloadable file. If that line of code is commented out, then I do not get the IE block message. Here is the entire HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="description" content="Form Example" /><title>Form Example</title><link href="style\form.css" media="screen"  /><script src="action/form.js" type="text/javascript"></script></head><body>The IE alert message is due to the javascript <br /><form action="#" method="post" onsubmit="return false;" id="myform"><input name="firstname" value="First Name" size="15em" /><input name="lastname" value="Last Name" size="15em" /><input name="address1" value="Address One" size="25em" /><input name="address2" value="Address Two" size="25em" /><input name="city" value="City" size="20em" /><input name="state" size="2em" /><input name="zip" size="5em" /><input name="plus4" size="4" /><input name="phonePart1" size="3em" /><input name="phonePart2" size="3em" /><input name="phonePart3" size="4em" /><input type="radio" name="######" value="female" /><input type="radio" name="######" value="male" /><input type="checkbox" name="CB1" value="checkbox one" /><input type="checkbox" name="CB2" value="checkbox two" /><input type="button" name="submit" value="Submit" onclick="submitForm()" /></form><div id="displayParameterString"></div></body></html>

And the java script:

function submitForm() {	var x = document.getElementById('myform');	var param = '';	for (var i=0; i<x.length; i++) {		param = param + "&" + x.elements[i].id  + "=" + x.elements[i].value;	}	document.getElementById('displayParameterString').display = 'block';	document.getElementById('displayParameterString').innerHTML = param;}

Link to comment
Share on other sites

Have you tried lowering your IE security temporarily to see if that helps? Although in all honesty if it's set to default I am not sure why it'll warn you in such a way.Oh by the way I just spotted this:<link href="style\form.css" media="screen" />Change the slash so it's like this<link href="style/form.css" media="screen" />

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...