Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

IE (not FF) complains

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

<SCRIPT LANGUAGE="JavaScript">
<!-- 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 + "@" + "www.mysite.com/members/";
window.location = htsite
}
else {
alert("Please enter your username and password.");
   }
}
//  End -->
</script>
0
Syllables
Asked:
Syllables
1 Solution
 
mreuringCommented:
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,

 Martin
0
 
sathishtCommented:
Hi

use location.href instead of window.location

Regards
Sathish


*** adverts removed, mplungjan, ee page editor ***
0
 
SyllablesAuthor Commented:
Yup, appears as if URLs of the form
http://username:password@...
are invalid to IE7. What incredibly bad manners.
0
 
Michel PlungjanIT ExpertCommented:
PS: changing location.href has the same effect as changing window.location
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now