javascript - How to run open function from iframe so it will take iframes base url -


i'm trying run javascript function iframe, here code

i have on page:

function start_course() {   ifrm = document.getelementbyid('mycourse');   var bt = ifrm.contentdocument.createelement("base");   bt.setattribute("href", "http://yourdomain.com/course/review/html/");   ifrm.contentdocument.getelementsbytagname("head")[0].appendchild(bt);   document.getelementbyid('mycourse').contentwindow.launch_course(); } 

this function want call , in iframe page.

function launch_course() {   url = "flash/engine.htm"   remote = open(url, "m", "fullscreen=0, height=853,width=1280,,toolbar=0,menubar=0,maximize=1,titlebar=1,status=1,resizable=yes, left=1,top=0") } 

but when call start_course() on page take webpage url base instead iframe webpage url.

when launch_course() run within iframe picks wrong path mean path of wrapping window.

note: page runs iframe , content loaded iframe same domain, can have different folder levels


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -