Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Open windows from server with ASP or Javascript

    Is it possible to open a window while running asp/javascript server code?

    Here's the 411:
    <%
    Connect to my database...
    open the users table and retrieve their cell numbers
    attach @company.com to each number and attatch the string to "sendStr"

    (Cdonts component lies on a different server from the server the database is on)
    so i need to send a queryString to "somewhere.asp?sendto=" & sendStr

    to that asp file....
    how would i get that done

    (GOD, i hope some out there can understand what i just wrote... hell it confuses me!!!)

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    you could make javascript itterate though these urls with a for loop, an array and a delay and change the location of a frame on the document

    in asp you can run pages with XMLHTTP (also useful to get passed blocked sites for work at college ) but im not sure if this is the best way to do this, it seems to work about 30 times a day on my server and after that it just hangs if someone tries to run any page on the server that uses it but apparently im the only person in the universe that this happens to *shrugs*

    http://www.w3schools.com/xml/xml_http.asp

    serverside:
    Code:
    strURl = Request.Form("frmURL")
    strPostData = Request.Form("frmPostData")
    
    Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
    'Set objXMLHTTP = Server.Createobject("MSXML2.ServerXMLHTTP")
    
    objXMLHTTP.Open "GET", strURL, false
    objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    objXMLHTTP.send strPostData 'comment this line if you dont want to send post data to the form
    'Response.ContentType = "text/xml"
    'Response.Write objXMLHTTP.responsexml.xml
    
    Response.Write objXMLHTTP.responseText 'comment this line if you dont want it to show the html the server generated
    this can be used to POST data if you send it in a similar way to request.form outputs it, ie field1=something&field=somethingelse&...


    there are also some lines in there that arent needed (the commented ones) because i was just playing with a way of stopping mine from hanging but it didnt work )

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    So lets see if i understand coz I'm a lil bit totally lost here....

    You're suggesting that I put the code you posted in the window that will be opened? So that it will automatically grab all the form data from the parent window that trigger it?


    And I don't get the delay part, please rephrase


  •  

    Posting Permissions

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