Page 1 of 1

location.href working in ie but not workiin ff chrome safari

Posted: Sat Mar 26, 2011 10:25 pm
by darknkreepy3#
it seems the strange nature of script dialects between internet explorer and firefox etc has reared it's ugly head again. The document object model (DOM) is respected to load new documents onto the current location as such when there is previous javascript already evaluated before a reload or new load page call:

Code: Select all

location.href="events_editor.php"
works in ie, but not in ff when inside of a function such as:

Code: Select all

//-----
function loadEvent(sID)
	{
	location.href("events_editor.php?id="+sID);
	}
so to make it work in all browsers (03-2011) use this DOM style, declaring 'document' and 'replace'

Code: Select all

//-----
function loadEvent(sID)
	{
	document.location.replace("events_editor.php?id="+sID);
	}