I have
<script type="text/javascript" src="http://doamin.com/js/whatever.js?ref=images"></script>
Note the ref=images at the end of the url. My questions is, how do i get the ref variable from the url and use it inside this same js file.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If
whatever.jsis a just js file, you can’t.If it is just a request uri and using the server side script to output the javascript content, you can get the variable from the get parameter.
If you want to pass the variable to the whatever.js, you can just define the variable before include
whatever.jsand then use the variable inwhatever.js.