I have this code that dynamically changes a frame name and address and reloads it in the page. this code works for both firefox and IE but it doesn't for Safari and Opera. Is there a way I can make this code work with all browsers?
Code:
function changeName()
{
var idPassed = this.id;
var nameReceived = this.name.slice(0,-2);
window.parent.frames['mediaPlayer'].name=idPassed;
//checks to see which media plaer to load
if (nameReceived.endsWith("F"))
{
window.parent.frames['mediaPlayer'].window.location="[URL unfurl="true"]http://mydomain/slideshow/firstmediaplayer.html";[/URL]
}
else
{
window.parent.frames['mediaPlayer'].window.location="[URL unfurl="true"]http://mydomain/slideshow/secondmediaplayer.html";[/URL]
}
}