Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 915367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:52:33+00:00 2026-05-15T17:52:33+00:00

<html> <body> <SCRIPT type=text/javascript> var xmlHttp = new XMLHttpRequest(); var async = true; xmlHttp.open(GET,

  • 0
<html>
<body>
<SCRIPT type="text/javascript">
 var xmlHttp = new XMLHttpRequest();
    var async = true;

    xmlHttp.open("GET", "http://www.google.com", async);
    if(async) 
    {
        xmlHttp.onreadystatechange = function() 
        {
            if(xmlHttp.readyState == 4)
            {
                if (xmlHttp.status==200) alert("It works!")
                else if (xmlHttp.status==0) alert("Arggggg!")
                else alert("Status is "+xmlHttp.status)
            }
        }
    }
    xmlHttp.send();
</script>

</body>
</html>

I am just curious of XMLHttpRequest to see it up and working, but I can’t get status to be non-zero. The examples seem so easy, yet it’s not working. I’ve tried about 4 examples. What the heck ?

All I want to do is read a webpage and see the HTML in plain text.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:52:33+00:00Added an answer on May 15, 2026 at 5:52 pm

    I think this is your problem.

    http://en.wikipedia.org/wiki/Same_origin_policy

    Simply put, you cannot access google through an XMLHttpRequest because the page/JS isn’t served from Google.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<html> <body> <script type=text/javascript> var str=Welcome to Microsoft! ; var val=Microsoft!; document.write(str.replace('/'+val'+/gi', W3Schools)); </script>
<html> <head></head> <body> <script type = text/javascript> var x = 5; var y =
<html> <head> <script type=text/javascript src=jQuery.js> <script type=text/javascript> x=document.getElementByTagName(p); document.write(x.lastChild.nodeValue); </script> </head> <body> <p id=intro>Hello
Below is my html <html> <head> <meta http-equiv=Content-Type content=text/html; charset=windows-1252> <title>New Page 1</title> <script
I made this Greasemonkey script: var maxpi = 250; var p1 = /html/body/div/div[2]/div/div[2]/table[2]/tbody/tr[1]/td[11]; var
<html> <head></head> <body> <span class=mtb-price> <label Class=mtb-ofr><b class=lb1></b>AAAAA</label></span> <script> var sku = document.getElementsByClassName(mtb-ofr).childNodes[1].nodeValue; alert(sku);
<html> <head></head> <body> <div id=ctl00_ContentPlaceHolder1_ctl00_ctl01_Showcase> <div style=width:100%;text-align:center;><img src=http://www.xyz.com/aaa.gif id=ctl00_ContentPlaceHolder1_ctl00_ctl01_loderImg alt=Loading /></div> </div> <script> q=
<html> <head></head> <body> <div class=abcd></div> <script> var y = document.getElementsByClassName('abcd'); var x = document.querySelectorAll(abcd);
this is my page Test1.asp <html> <head> <meta http-equiv=Content-Language content=en-us> <meta http-equiv=Content-Type content=text/html; charset=windows-1252>
$('a').click(function(event){ $('body').html('loading...'); $.post('www.sitename.com/hello',{site:http//:www.google.com},function(data) { alert(data); }); event.preventDefault(); }); I am using the above script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.