Click to See Complete Forum and Search --> : URL search string


jimrains
06-25-2003, 11:10 PM
I'm lost and considering I'm a newbie I guess that is understandable. I can aquire the URL search/query string ok with the code below, but I can not figure out how to append it to the popup window file so that it will be passed. How would I append the "substr" to the popuppdf('pdfrequest.htm') so that it would be passed in the URL as a query string. Also, how would I pass the value of the javascript variable "substr" in an html "value="?

Thanks for your help :)


<html>
<head>

<SCRIPT language=JavaScript>
substr=location.search.substring(0)

var exit=true;
function popuppdf(filename){
if(exit){
var centerWidth=(screen.width/2)-(450/2);
var centerHeight=(screen.height/2)-(800/2);
window.open(filename, "","height=450,width=450,top="+centerHeight+",left="+centerWidth+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no");
}
}

</script>
</head>
<body>
<a href="#" onClick="popuppdf('pdfrequest.htm'); return false">
</body>
</html>

Moderators Note
Please do not post multiple posts for the same question.Give our volunteers time to respond.

jimrains
06-25-2003, 11:45 PM
I'm lost and considering I'm a newbie I guess that is understandable. I can aquire the URL search/query string ok with the code below, but I can not figure out how to append it to the popup window file so that it will be passed. How would I append the "substr" to the popuppdf('pdfrequest.htm') so that it would be passed in the URL as a query string. Also, how would I pass the value of the javascript variable "substr" in an html "value="?

Thanks for your help :)


<html>
<head>

<SCRIPT language=JavaScript>
substr=location.search.substring(0)

var exit=true;
function popuppdf(filename){
if(exit){
var centerWidth=(screen.width/2)-(450/2);
var centerHeight=(screen.height/2)-(800/2);
window.open(filename, "","height=450,width=450,top="+centerHeight+",left="+centerWidth+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no");
}
}

</script>
</head>
<body>
<a href="#" onClick="popuppdf('pdfrequest.htm'); return false">
</body>
</html>

Khalid Ali
06-26-2003, 12:17 AM
Like this

window.open(filename+searcStr,

And do change the substr varaible to somethingelse as I changed it to searchStr,reason is that "substr" is a js function and it potentially screw up the results in your JavaScript

jimrains
06-26-2003, 05:02 PM
Thanks, that was my problem.:D :cool: :p :)