using dynamic querystrings with js

Reply

Join Date: Jun 2007
Posts: 5
Reputation: dolomitedave is an unknown quantity at this point 
Solved Threads: 0
dolomitedave dolomitedave is offline Offline
Newbie Poster

using dynamic querystrings with js

 
0
  #1
Jun 1st, 2007
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

  1. <a href="http://www.someurl.com" onclick="openwin(testvar)" target="_blank">
  2. <img src=<a rel="nofollow" class="t" 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

  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC