dolomitedave 0 Newbie Poster

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

<a href="http://www.someurl.com" onclick="openwin(testvar)" target="_blank">
<img src=[URL]http://www.pic.com/pic.jpg[/URL] 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

function openwin(testvar){
 if(popUpsBlocked)
window.location.replace("sorrypop.asp");
  else
window.open("tmp.asp?var="+testvar);
}

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.