A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: popup problems

  1. #1
    Member
    Join Date
    Apr 2002
    Posts
    99

    popup problems

    Hi there

    I posted this question a while back, but I still haven't come up with a solution, so I thought I'd give it another shot...

    Basically what I need to do is have a window popup a specific size, but the url has to include a user-entered variable. ie.

    http://www.url.com/search.asp?type=s...me=USERDEFINED

    Obviously 'name=USERDEFINED' would be the result from a text field the user defined!!

    I can open a new window with this search string and return the proper results no problem using the getURL command, but if I try to use a javascript command to control the size of the window it won't work because I need the USERDEFINED to be outside the quotes surrounding the url. ie.

    getURL("javascript:popup('http://www.url.com/search.asp?type=search&name=','','features');");

    won't work because I need to specify the user defined variable in there somewhere

    'http://www.url.com/search.asp?type=search&name=' + "name"

    Hopefully that makes some sense and isn't too long-winded. Any help would be appreciated

    Cheers[COLOR=red][COLOR=red]

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    getURL("javascript:popup('http://www.url.com/search.asp?type=search&name=" + name + "', 'newWin', 'width=400,height=300');");

    where name is the variable name (and path to the variable if needed) of the variable you want to send to the new page. This assumes a popup window function like this in your html page,

    function popup (url, name, features){
    newWindow = window.open(url, name, features);
    }

  3. #3
    Member
    Join Date
    Apr 2002
    Posts
    99
    Thank you very much. That worked perfectly, even with multiple user defined variables.
    Could have sworn I had tried that and every other format using extra sets of quotes to escape the url and they never worked, but apparently not!

    Cheers, it's very much appreciated
    Gerry

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

HTML5 Development Center