well i explain it in detail
well im trying to count the script request send in cross domain scenario
as almost all the browsers have it restricted
i need a way to get the no of request for my script when i traverse through different pages which all request this script
i need to keep a count for the no of requests for the script and if gets more than 5 then the script should display that u cannot request for this script more than 5 times
it seems to work when i call the script more than 5 times from a single webpage
but it fails when i traverse through 1 page to another which all request it
like in main.html page i have <iframe src="next.html"> and in the next.html i have <script src="sample.js"> when i click from main.html to next.html the script count should increase from 1 to 2 and if i keep on traversing through diffrent pages who all request this script, the count should increase
im using this code to check the no of count
Code:
if((n=calculate(document.getElementsByTagName('script')))<6 )
if the no of counts r less than 6 then the script should do what its supposed to do otherwise it should reply as script cant be accesed more tha 5 times
the function calculate counts the no of request for that script
i use a countScript to keep the no of count and i use
Code:
if(top.countScript==null){top.countScript=1;}else{top.countScript=top.countScript+1;}
this works fine when all requests originate from a single html page but if i traverse through multiple webpages which all request this script
the top.countScript always returns as null
i need the top.countScript to keep the no of record of requests earlier made which it doesnt
can u help me with some code that can keep the no of counts for the scripts when it is a cross domain issue
thanks in advance