1 reply [Last post]
dcanfield87
Offline
Regular
Last seen: 14 years 29 weeks ago
Joined: 2007-07-18
Posts: 18
Points: 0

Hello,

I'm trying to impliment something similar to what can be found here:
http://webdeveloper.50webs.com/js.login.code.htm
for a simple javascript login. When I was using that code and testing I noticed it did not work in Safari (current version 3.0.3)

Could someone take a look to see if they can figure out why it isnt working in Safari?
Worked in all my other browsers on my Mac.

The code just to make it easier:

<?xml version="1.0" encoding="iso-8859-1"?>

Javascript User Login

//
// Javascript User Login 3.0
// Some Rights Reserved
// http://webdeveloper.50webs.com
//

var userFolder = ""; // Folder where userfile (e.g. PizzaMan127~Cheese.htm) is located (e.g "users/")
var HTMLextention = ".htm"; // Extension of the user-file (usually .htm or .html)
var inProgressMSG = "Attempting login..."; // Message displayed during a login
var userFailMSG = "Invalid username or password"; // Message displayed after failed attempt

// Do not edit
function login(){
var username= document.getElementById('username').value; // location of username
var password= document.getElementById('password').value; // location of password
username= username.toLowerCase(); // convert to lowercase for case-sensitive servers
password= password.toLowerCase(); // convert to lowercase for case-sensitive servers
var fullURL= "";
fullURL= userFolder + username + "~" + password + HTMLextention; // compiled filename the loads user-file
setTimeout("failEvents();", 15000); // after 15 seconds display error message
document.getElementById('errorDisplay').value = inProgressMSG; // show in-progress message
showMSG();
setTimeout("showMSG();", 5000); // hide in-progress message after 5 seconds
verifWin.document.open();
verifWin.document.location.href = fullURL; // trys to find user-file
verifWin.document.close();
}
function passEvents(data){ // Events that occur for valid login
var URL = data;
location.href=URL;
}
function failEvents(){ // Events that occur for invalid login
document.getElementById('errorDisplay').value = userFailMSG;
showMSG();
}
function showMSG() { // Controls the opening/closing of messages
if ((document.getElementById("isShown_errorConsole").value)=="N") {
document.getElementById("errorConsole").style.display='';
document.getElementById("isShown_errorConsole").value="Y";}
else if ((document.getElementById("isShown_errorConsole").value)=="Y") {
document.getElementById("errorConsole").style.display='none';
document.getElementById("isShown_errorConsole").value="N";}
}


Authorization Required





Username



Password













showMSG();

Tags:
thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 22 weeks 3 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Could you define "not

Could you define "not working"?

Verschwindende wrote:
  • CSS doesn't make pies