This is my index.js file:
function fun()
{
var obj;
}
This is my index.html file:
<script>
src="js/index.js"
</script>
I want to use variable obj here.
I saw some solutions to create a variable and pass in index.html but is there any way of injection?
Actually, obj is a JSON object. I forgot to mention that previously. How would I use the JSON object keys and values in my index.html outside of the script tag?
objis local to thefun()function. Where are you trying to use it?attributeinside the tag.