Hoe dit script cross-browser te maken?

Status
Niet open voor verdere reacties.

RMS123

Gebruiker
Lid geworden
15 nov 2009
Berichten
873
hallo iedereen,

hoe maak ik dit script cross browser?
Het script dient om links in een iframe van een pagina weer te geven.
In internet explorer doet hij het wel en in chrome niet.

iemand een idee?
alvast bedankt!

Code:
			<script type="text/javascript">
			
			function changeIframe(newLocation) {
				var theLocation = '';
				if (!newLocation && window.location.hash != '') {
					theLocation = newLocation ? newLocation : window.location.hash;
				} else {
					return;
				}
				
				theLocation = theLocation.replace(/#[COLOR="red"]<scheidingsteken dus>[/COLOR]/,"http://");
				document.getElementById('I1[COLOR="red"]<iframe naam hier dus>[/COLOR]').src = theLocation;
			}
			
			window.onload = function() {
				changeIframe();
			};
			</script>

de rode tekst staat er natuurlijk niet standaard in :p
 
weet iemand trouwens of dit script alleen in chrome niet werkt of in alle browsers buiten IE niet?
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan