aboutsummaryrefslogtreecommitdiff
path: root/exampleData/frames/dyniframetest.html
blob: 80f62dbd6bb79fe4263af2ba9d68d0a78c46b76d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
  <head>
    <script type="text/javascript" src="../../contexts/data/jquery-1.7.1.min.js"></script>
    <script type="text/javascript">
      var insertiframe = function() {
        var elt = document.createElement('iframe');
        elt.src = '../basic/headings.html';
        elt.width =600;
        elt.height=300;
        document.getElementById('frameTarget').appendChild(elt);
      };

      var $ = function (sel, context) {
        var ctx = context || document;
        var $results = jQuery(sel, ctx);

        var $iframes = jQuery('iframe', ctx);
        if ( 0 != $iframes.size() ) {
           $iframes.each(function(i, frame) {
              $results = $results.add($(sel, frame.contentDocument));
           });
        }
        return $results;
      };

    </script>
  </head>
<body onload='setTimeout(insertiframe, 1000)'>
  <h1>this document will contain iFrames</h1>
  <br/>
  <div id='frameTarget'></div>
</body>
</html>