IE (not FF) complains

Posted on 2007-09-27
Last Modified: 2008-06-16
The following function:throws an invalid argument in IE7 when called, but FF performs perfectly. IE reports the error at character 1 of the window.location... line

<!-- 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 + "@" + "";
window.location = htsite
else {
alert("Please enter your username and password.");
//  End -->
Question by:Syllables
    LVL 17

    Accepted Solution

    Well, somewhen along the line Microsoft dopped support for urls with username:password@domain due to a vulnerabillity in their browser-engine. This off course was not a bug, it was actually a bugfix...

    Seeying as how microsoft is notoriously bad at admitting their incompetence, I would assume that such support is no longer part of any of their products and most likely even marked as 'illegal'.

    I could be wrong, but probably not,


    Expert Comment


    use location.href instead of window.location


    *** adverts removed, mplungjan, ee page editor ***

    Author Comment

    Yup, appears as if URLs of the form
    are invalid to IE7. What incredibly bad manners.
    LVL 75

    Expert Comment

    by:Michel Plungjan
    PS: changing location.href has the same effect as changing window.location

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Both jQuery and Mootools offer some nice, easy to use scripts. Mootools is best known for their interactive slideshows and jQuery for their menus, but both have many other uses as well.   jQuery is basically a toolkit with many DOM (http://en.wik…
    I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now