what i Need
- i need to pass url variable from html to javascript file.
html code
<script>
var p = "{{ page_param.asy_request | replace('&','&')}}";
p = p.replace(/\&/g, "&");
p = "{{ DomainDetect() }}/ajax?for=event_listing&ajax=1" + p;
</script>
<input type="hidden" name="mobilepage" id="mobilepage" value="'+p+'"/>
Accesing p variable in javascript code
var mobile=document.getElementById("mobilepage").value;
console.log(mobile);
Error
Uncaught TypeError: Cannot read property 'value' of null
i need url should be passed from html file to js file.
i have used hidden element for that.
any suggestion are most welcome.