Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save JavaScript-Packer/8d3816959f01f29f7634 to your computer and use it in GitHub Desktop.

Select an option

Save JavaScript-Packer/8d3816959f01f29f7634 to your computer and use it in GitHub Desktop.
ASP function for loading external URL. Use in a custom 404.asp error page to make dynamic URLS like http://www.holybiblesearch.net/Jesus.htm (Jesus.htm is not found, loads a page anyhow).
<%@ LANGUAGE="VBSCRIPT" %>
<%
sub fetch(URL)
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", URL, false
objXMLHTTP.Send
Response.Write objXMLHTTP.responseText
Set objXMLHTTP = Nothing
response.end 'remove this if not using for 404.asp or it will kill the page after load
end sub
%>
<% fetch("http://www.whak.com") %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment