A key screen in my application involves a HTML page with several iframes performing various functions. All of these will need access to jQuery. In the interest of speeding up loading time, and reducing HTTP traffic (though I know caching could help with this), it would be good if the jQuery code itself were loaded only once. If my page is like so
<html>
<head>
<script src="jquery-1.5.js" type="text/javascript"></script>
</head>
<body>
<iframe src="other.html"></iframe>
<div id="foo"> ... stuff here ... </div>
</body>
</html>
Then inside other I can refer to parent.$('#foo') but that will refer to the parent’s “foo” element, not the child’s. Is there a way to use the parent’s “instance” of jQuery on the child document or elements in it?
Have you tried:
and: