Announcement

Collapse
No announcement yet.

Update widget from annother one

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Update widget from annother one

    Hallo,

    i have to widgets,
    one is autorefreshing the other not.
    One is a grid, showing a picture, the other is a control, which should only refresh the grid, when the active picture was changed in the DB.
    What i tried is:


    ?>
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF8">
    <script type="text/javascript">
    function reload_frame_12()
    {
    var frame_id = "id-iframe-widget12";
    parent.document.getElementById(frame_id).contentWi ndow.location.reload(true);
    }

    </script>
    </head>
    </html
    <?php

    reload_frame_12();



    the widget id is correct, but it`s not working.
    Any ideas ?

    ok, i figured it out
    the call
    reload_frame_12() is javascript and does not work under php
    in the script i had to do a window.onload = reload_iframe_12
    instead
    Last edited by Gerd Dietrich; 07-03-2015, 02:19 PM.

  • #2
    I've had several problems with getelementById in JavaScript, try the same but with GetElementsByName

    Regards

    Comment


    • #3
      After a long night and a couple of beer i figured it out:

      the start of the script has to be in the script section:
      window.onload = reload_frame_12;
      and the element has to be:
      window.parent.document.getElementById(frame_id).co ntentDocument.location.reload(true);

      Comment

      Working...
      X