problem while accessing to myFunc

hi…

i created a layout with this code

dhxLayout = new dhtmlXLayoutObject(document.body, "3J","dhx_skyblue");

a window for editing pages…

myWin_Page=dhxWins.createWindow("myWin_Page",0,0,800,600); myWin_Page.center(); myWin_Page.hide(); myWin_Page.setText("Add Page"); myWin_Page.setIcon("page.png", "page.png"); myWin_Page.attachEvent("onClose",function(){myWin_Page.hide();return false;}); myWin_Page.show(); myWin_Page.attachURL("form.page.php?id=" + pageid ,true);

added a javascript wysiwyg editor (wyzz) to mywin_Page

and i added a button to wysiwyg editor to open another window for uploading images…

parent.choosePicture(page_id,wysiwyg_id);

function choosePicture(page_id,wysiwyg_id){ myWin_imguploader.show(); myWin_imguploader.setModal(true); myWin_imguploader.attachURL("form.imguploader.php?&id=" + page_id + "&wysiwyg_id=" + wysiwyg_id, true); }

i upload the image form myWin_imguploader resize etc… after uploading it triggers the function parent.pageImageUploaded(id,wysiwyg_id); everthing is ok so far…

with this(pageImageUploaded) function i want to call another javascript function insertImage2wysiwyg(wysiwyg_id, image_path) which is located in myWin_Page (form.page.php) and change the wysiwyg source… but i can’t call this function.

i tried

dhxWins.window("myWin_Page").insertImage2wysiwyg(wysiwyg_id, image_path); dhxWins.window("myWin_Page")._frame.contentWindow.insertImage2wysiwyg(wysiwyg_id, image_path); dhxWins.window("myWin_Page")._frame.contentDocument.insertImage2wysiwyg(wysiwyg_id, image_path);

what can i do for accessing my function located in myWin_Page (form.page.php) from another function located in parent (index.php)

any ideas? thanks…

Hello,

attachURL(url,true) method loads data using Ajax, an iframe isn’t used in this case. So, the content of the form.page.php is added directly to the index.php

the content of the form.page.php is added directly to the index.php
yes… it’s true… so how can i use my javascript? is it any way to do that…
i’m at the end of the project and that’s really needed… :cry:

When content is loaded by Ajax, it is added by innerHTML. If there was a functionality tags, it is executed.