www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] Script not working in IE

  1. #1
    Join Date
    Jan 2012
    Location
    San Diego, CA
    Posts
    2

    resolved [RESOLVED] Script not working in IE

    I have the following script which I am using at http://www.screenshop.com

    This script operates perfectly on Chrome, Firefox, Safari, and Dolphin HD.

    In Internet Explorer, it does not function at all. Any help would be greatly appreciated.

    Code:
    <!-- Begin
    function Login(form) {
    var username = form.username.value;
    var password = form.password.value;
    var server = form.server.value;
    if (username && password && server) {
    var htsite = "http://" + username + ":" + password + "@" + server;
    window.location = htsite;
    }
    else {
    alert("Please enter your username and password.");
    }
    }
    //  End -->
    </script> </head>
    <form name="login"><input type="hidden" name="server" value="www.screenshop.com/index.php" /> Username: <input type="text" name="username" size="20" /> <br /><br /> Password: <input type="password" name="password" size="20" /> <input type="button" value="Login!" onClick="Login(this.form)" name="button" /> </form>

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Not sure if this will fix it, or not, but try changing this:
    Code:
    if (username && password && server) {
    .. to this:
    Code:
    if (username !="" && password != "" && server != "") {
    As I see it, the way you have it, now, is that it's checking to see if those variables exist. They do, even if the person submitting the form leaves them blank, they still exist. Check to see if they actually contain anything, instead.

    Just a thought.

  3. #3
    Join Date
    Jan 2012
    Location
    San Diego, CA
    Posts
    2

    No solution for my issue

    Thanks for the suggestion. I have found in fact that IE no longer supports this type of form at all. the useridassword@www.dot.com redirect on submission of the form was removed in IE 8 and is not longer functional for Microsoft Browsers. In any other browser, the fields are not accepted if blank with the current check. The site will simply remain unavailable for Internet Explorer users until the beta has passed.

  4. #4
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    Checking the console messages in IE9:

    SCRIPT14: A security problem occurred.
    ... on the following line ...

    Code:
    function Login(form)
    {
    	var username = form.username.value;
    	var password = form.password.value;
    	var server = form.server.value;
    
    	if (username && password && server) {
    		var htsite = "http://" + username + ":" + password + "@" + server;
    		window.location = htsite;
    	} else {
    		alert("Please enter your username and password.");
    	}
    }
    Using a different url eg "http://www.google.com/" it worked fine.
    It must not like how the url is being formatted?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles