Hi subhro,

you can try this kind of code. First file, the main HTML page:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title> iframe loaded verification </title>
    <script src="prototype.js" type="text/javascript"></script>
    <script src="scriptaculous.js" type="text/javascript"></script>
  </head>
  <body>
    <div id="wrapper">
    Hello, click here
    </div>
    <div id="framed"></div>
    <script>
      function MyIframeReadyStateChanged(){
        alert('great, it\s loaded');
      }

      Event.observe('wrapper','click',function(_evt){
        var _iframe=document.createElement('IFRAME');
        _iframe.src="test.html";
        $('framed').appendChild(_iframe);
      });
      document.observe('PDF:loaded',MyIframeReadyStateChanged);

    </script>
  </body>
</html>



and it calls the test.html file that in your exemple will contain the
PDF (here to simplify, it's an image):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>the PDF file replaced with an image</title>
  </head>
  <body onLoad="window.parent.document.fire('PDF:loaded');">
    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/
Wikipedia-logo.svg/300px-Wikipedia-logo.svg.png" />
  </body>
</html>


the first script will create the i-frame, and will listen to a custom
event: 'PDF:loaded' and on the body tag of the second file, on the
onload event, it will call the custom event. Or it could be possible
to do it in the other way, by applying an event from the main page
directly to the iframe (but I'm not successfull to do this).

--
david



On 6 fév, 15:19, disccomp <discc...@gmail.com> wrote:
> It looks like your on your way to a solution. It's one thing to post
> technical questions, your first post was great. You'll probably see
> this again GIYF(Google is your friend) Try experimenting with events.
> (Event.observe)
>
> Before asking for code, Ask yourself, "Am I a help 
> vampire?"http://www.slash7.com/pages/vampires
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to