yup i got control over the page what i load into the iframe but i got no idea how to make it work for a dynamically loading php file
I used this normal script
<script>
function count_li()
{
var n1,n2;
n1=document.getElementById("myframe");
n2=n1.getElementsByTagName("li");
document.write(n2.length);
}
$(document).ready(count_li());
</script>
inside the php file but it did not work. . .
the structure of the files is like this->
mysite.com/emd_dyn.php?key=bfdsbd23239mkf
the emb_dyn.php only contains the php code to interact with the mysql and some other php code and it has no echo html statements at the bottom of this file i include another php file say
include('emb_dyn_ht.php');
The emb_dyn_ht.php file contains the actual html echo statements and the actual html starts in this file i included the javascript here aznd it returned nothing but this script worked for static pages where the design is predefined with all tags not changing.
I am not able to understand the code given by superficial,I am a newbie to jquery and javascripts
- function acceptNumberOfNodes (nr) {
-
alert("number of nodes in the iframe = " + nr);
- }
- $(function () {
- if
(top.acceptNumberOfNodes) {
-
top.acceptNumberOfNodes($("*").length);
- }
- })
The 1st part of the code is fine with me i did not understand why he used "top." thing can u please explain.
-Thank you guys for replying... :)