Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

ASP: MSXML2.ServerXMLHTTP object question

I am using classic ASP and I am trying to pull the HTML from a URL with the following code:

url = "URL GOES HERE" 
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
    xmlhttp.open "POST", url, false 
    xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
    xmlhttp.send "COMPANY="& request.form("company")
    pageContents = xmlhttp.responseText 
    document.write(pageContents)

Open in new window


When I try to out put pageContents in a response.Write(pageContents) i get the following error:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

I upload the code to a different domain and when I execute it, the code successfully pulls the HTML from the url i provide, but when I upload the code to this problem website, it does not work.
0
nickgross19
Asked:
nickgross19
1 Solution
 
G_HCommented:
try RESPONSE.write, rather than "document.write"...?

GH
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now