• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 465
  • Last Modified:

Using an Request Querystring in a external JS file

Hi,

I have an ASP/VB page that loads an Javascript file i.e.

Main.asp

<script type="text/javascript" src="js/emaillist.js"></script>


But within the emaillist.js file I need a <%=Request.QueryString("userID")%>

How can this be used?

Thanks
0
sanjshah12
Asked:
sanjshah12
1 Solution
 
neeraj523Commented:
hello

try this

<script>
var mystr = "<%=Request.QueryString("userID")%>";
</script>
<script type="text/javascript" src="js/emaillist.js"></script>

in emaillist.js file, you can use 'mystr' variable which will return you the value of Request.QueryString("userID")..
0
 
sanjshah12Author Commented:
Thanks neeraj that works great!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now