943,972 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 1161
  • ASP RSS
Jun 1st, 2007
0

using dynamic querystrings with js

Expand Post »
Hi,
i have a page with pictures on it, when a user clicks on a picture 2 things happen at the same time a new window pops up and a function is called.

the function does a few checks then calls another page when it calls this page i want to use a querystring, but i want to send data from a database.

i understand js is client side so how do i use server data with it?

the only way i could think of doing this was to put the data needed into a var then use the code below to call the function and pass on the var

ASP Syntax (Toggle Plain Text)
  1. <a href="http://www.someurl.com" onclick="openwin(testvar)" target="_blank">
  2. <img src=<a rel="nofollow" href="http://www.pic.com/pic.jpg" target="_blank">http://www.pic.com/pic.jpg</a> width="125" height="125" alt="some picture" border="0"/></a>

then once the function has received the var it can use it to open the page with the querystring

ASP Syntax (Toggle Plain Text)
  1. function openwin(testvar){
  2. if(popUpsBlocked)
  3. window.location.replace("sorrypop.asp");
  4. else
  5. window.open("tmp.asp?var="+testvar);
  6. }

this doesnt work for me ami doing something wrong or am i way of track if anyone couldpoint me in the right direction would be really helpful
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dolomitedave is offline Offline
5 posts
since Jun 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Using Client(JS) to get Server(VBS) value.
Next Thread in ASP Forum Timeline: ASP on a stand alone 2k machine





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC