Hi all!
I have a problem with a piece of JS coding that works in FF 3.6 but not in IE8. The function retrieves the users name upon login to provide a welcome message. In IE8 the username is not displayed in the browser. In FF it is. Any help would be greatly appreciated. Thank you!
Best, Kasper
The coding in my .htm file:
HTML Code:
Welcome <script language="javascript" src="tt.js"></script>!
The coding in my x.js file:
Code:
function getusername()
{
if (document.cookie.length<0) return '';
begin=document.cookie.indexOf('mtusr=');
if (begin==-1) return '';
begin=begin+6;
end=document.cookie.indexOf(';',begin);
if (end==-1) end=document.cookie.length;
username=unescape(document.cookie.substring(begin,end));
return username;
}
document.write(getusername());
|