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 285863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:35:05+00:00 2026-05-12T05:35:05+00:00

The following code is supposed to perform an AJAX request after the page loads,

  • 0

The following code is supposed to perform an AJAX request after the page loads, and then display the response of that AJAX call in a popup. This works in Firefox, but I have no idea why it does not work in IE8.

<html>
<head>
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript">
        // Do this stuff when DOM finishes loading.
        document.observe("dom:loaded", function() {
            new Ajax.Request("page.html", {
                onSuccess: function(response) {
                    alert(response.responseText);
                }
            });
        }); 
    </script>
</head>
<body>
</body>
</html>

page.html just contains

hello world

Am I missing something obvious or is this a result of the prototype js library not being fully compatible with IE8? I tried this with the latest stable prototype release (1.6.0.3) and the bleeding-edge version (1.6.1 RC3) with no luck. Any help would be much appreciated, thanks!

  • 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-12T05:35:06+00:00Added an answer on May 12, 2026 at 5:35 am

    Are you doing this in a web site or using a file? I was able to get your code working in a web site in Visual Studio, but when I tried it from a file I got an “Access Denied” error. I suspect that it is not able to do an Ajax request to a file in the local file system due to security restrictions in IE8.

    Here’s the exact code I used in my Default.aspx page to load the page.htm file. Note that I changed the method — since it’s not a form — and I added callbacks for failure and exceptions. The exception callback was what got triggered for me with a local file. As I said, it works fine when accessing a page in the same web site.

    <script type="text/javascript">
        document.observe( 'dom:loaded', function() {
            new Ajax.Request("page.htm", {
                method: 'get',
                onSuccess: function(response) {
                    alert(response.responseText);
                },
                onFailure: function(response) {
                    alert(response);
                },
                onException: function(request,error) {
                    alert(error.message);
                }
            }); 
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following code, which supposed to create a new item. Proxy type
I have the following code that I managed to come up with: private void
Suppose I have the following code: class some_class{}; some_class some_function() { return some_class(); }
Suppose I have the following code: class siteMS { ... function __CONSTRUCT() { require
Suppose someone (other than me) writes the following code and compiles it into an
Suppose I have the following C code. unsigned int u = 1234; int i
Following code, when compiled and run with g++, prints '1' twice, whereas I expect
The following code works great in IE, but not in FF or Safari. I
The following code doesn't compile with gcc, but does with Visual Studio: template <typename
The following code illustrates an object literal being assigned, but with no semicolon afterwards:

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.