I need to check whether javascript in one block, can access or manipulate javascript in any another script block in a webpage. For Example, the second block (inside div) access the first script block inside body.
<body>
<script>
var first_script_block=0;
</script>
<div>
<script >
var secondblock_acess_first =first_script_block;
</script>
</div>
</body>
I though it a lot. I feel horrible. I need some ideas. :(
All the scripts share the same
global-object
If you don't want it to happen(it's hard to tell from your question) use closures: