harshpandya Posted February 27, 2009 Share Posted February 27, 2009 Hi guys, I have this iframe called audio in the main.php and i am loading the audio.php in this audio iframe. code to include audio.php in the audio iframe: document.getElementById("audio").src = ../stream/audio.php";Now in the javascript of main.php, i am calling the function of audio.php called startaudio() and its gives error that object expected.I thought ui alredy loaded he audio.php so now i can call any function from that file... do i have to do something like frame["audio"].startAudio();HOw do i fix this? Thanks, Link to comment Share on other sites More sharing options...
jeffman Posted February 27, 2009 Share Posted February 27, 2009 Yes. The "normal" scope of javascript stuff is limited to a window/viewport. To access stuff in another window/frame/whatever, you need to start with a reference to that window/frame/whatever. Link to comment Share on other sites More sharing options...
harshpandya Posted February 27, 2009 Author Share Posted February 27, 2009 Yes. The "normal" scope of javascript stuff is limited to a window/viewport. To access stuff in another window/frame/whatever, you need to start with a reference to that window/frame/whatever.Thanks Dude, I did audio.startAudio();and it worked....Thanks, Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.