Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Shawn on Nov 10, 2008 08:06
open dhtmlx forum
Calling javascript in layout frame with Firefoxw

I am trying to call a javascript function in a layout frame and keep getting the error that the function does not exist.

parent.dhxLayout.cells('b')._frame.contentDocument.RPC();

Any ideas?
Answer posted by Support on Nov 14, 2008 06:07
Answer posted by Shawn on Nov 25, 2008 12:29
Well the above method does work for accessing html elements, but I still was not able to access a javascript function.  Currently the only way I have called a js function in another frame is to do it this way:

parent.frames[4].activateDD();

I have tried this in firefox with no luck:

parent.dhxLayout.cells('b').window._frame.contentDocument.activateDD();

I would like the second way to work since the first way could change. 

Can someone please tell me what I am doing wrong?


Answer posted by Support on Nov 26, 2008 07:21
    page_1.html >>
    ...
    <script>
        function myFunc() {
             ...
        }
    </script>

    page index.html >>
    ...
    var dhxLayout = new dhtmlXLayoutObject(...);
    ...
    dhxLayout.cells("a").attachURL("page_1.html");
   
    // calling function from inner page
    dhxLayout.cells("a").window._frame.contentWindow.myFunc();