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

notes and quirk solutions found over time
Post Reply
darknkreepy3#
Site Admin
Posts: 253
Joined: Tue Oct 27, 2009 9:33 pm

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

Post 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);
	}
Post Reply