Results 1 to 2 of 2

Thread: request.querystring javascript popup

  1. #1

    Thread Starter
    Lively Member nfo1212's Avatar
    Join Date
    Aug 2001
    Location
    Near Boston, U.S.A.
    Posts
    82

    request.querystring javascript popup

    Hi,

    I am trying to pass data to a popup window. The javascript that creates the popup is this:

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=500,left = 362,top = 134');");
    }
    // End -->
    </script>
    and I would like to create a link like this:

    Code:
    <%
    response.write("<A HREF='javascript:popUp('popup.asp?ID='" & intID & ")'>Edit</A>")
    %>
    I would like to grab the intID variable with request.queystring in popup.asp, but I must be constructing the string wrong, maybe concatenating it wrong. I know vb/vbscript and not really javascript. Could someone help?

    Thanks a bunch-
    Nick

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    here's a function that i did a while ago:

    Code:
    function request(obj){
    var position=0;
    var fullLength=0;
    var value='';
    
    url=new String(location.href);
    fullLength=parseInt(url.length);
    position=url.indexOf(obj);
    if(position==-1 || url.charAt((position+obj.length+1))=='&'){
    	return '';
    }else{
    	position += obj.length;
    
    	do{
    		position++;
    		value+=url.charAt(position);
    	}while(url.charAt((position+1))!='&' && (position+1)!=fullLength); 
    
    	return unescape(value);
    	}
    }
    just use like in asp!

    someVariable=request('ID');

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width