PDA

View Full Version : changing the location of iframe in script


Shecky
03-09-2003, 01:45 AM
document.frames(songshow).src = "page_songshow.php?lyrics="+lyrics;

i think its resonably easy to figure out what i wanted there... what am i doing wrong?

GoHF
03-09-2003, 02:24 AM
document.frames('songshow').src = "page_songshow.php?lyrics="+lyrics;

document.frames['songshow'].src = "page_songshow.php?lyrics="+lyrics;

document.frames.songshow.src = "page_songshow.php?lyrics="+lyrics;

pick one. :)

chrismiceli
03-09-2003, 04:29 AM
or give it an id and do this
document.getElementById("id").src = "page_songshow.php?lyrics="+lyrics;

GoHF
03-09-2003, 03:05 PM
or, also using DOM2, do this:

window.document.getElementsByName('songshow')[0].src = "page_songshow.php?lyrics="+lyrics;

^_^ so many ways, so little time to use them all...