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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:09:24+00:00 2026-06-05T20:09:24+00:00

I have a page being ajaxed in, but the document ready code will not

  • 0

I have a page being ajaxed in, but the document ready code will not run. I’m running in IE7. I get no alert, but “Page is here” shows fine. The method “ajax” is a utility method I wrote. It works fine for all my ajax calls, so I know that’s not the issue. I just can’t get my javascript to run. Why would my javascript not be running?

AJAX Page

<script src="Utilities/Javascript/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
        alert("RUN PLEASE");
</script>
Page is here

Main Page

<html>
<head>
<script src="Utilities/Javascript/Utilities.js"></script>
<script src="Utilities/Javascript/jquery-1.7.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
    $(document).ready(function () {
        ajax("scrolltest.aspx", "divy2");
    });
</script>
<div id="divy2">

</div>
</body>
</html>

ajax method from Utilities.js

/*
* Ajax page loads with url and updates element's innerHtml
* @param url : URL to call for ajax page load
* @param element : Element ID to be updated
*/
function ajax(url, element) {
    var ajx;
    if (window.HXMLHttpRequest) {
        ajx = new XMLHttpRequest();
    }
    else {
        ajx = new ActiveXObject("Microsoft.XMLHTTP");
    }
    ajx.open("GET", url, true);
    ajx.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    ajx.onreadystatechange = function () {
        if (ajx.readyState == 4 && ajx.status == 200) {
            document.getElementById(element).innerHTML = ajx.responseText;
        }
        else if (ajx.readyState == 4 && ajx.status == 400) {
            alert("Page Error. Please refresh and try again.");
        }
        else if (ajx.readyState == 4 && ajx.status == 500) {
            alert("Server Error. Please refresh and try again.");
        }
        else if (ajx.readyState == 4) {
            alert(ajx.status + ":" + ajx.statusText);
        }
    }
    ajx.send();
}
  • 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-06-05T20:09:25+00:00Added an answer on June 5, 2026 at 8:09 pm

    Javascript from an “AJAX” request will not be processed unless you call eval on it – which is not really the best idea

    edit this answer is a little too brief – there are ways to native force execution – refer to this more detailed and similar question / answer

    How to Force Javascript to Execute within HTML Response to Ajax Request

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

Sidebar

Related Questions

i have a ie7 add on, i'm adding html elements to the page being
I have a page menu being generated that will be similar in structure to
I have a page being loaded in an <iframe> . Inside the <iframe> ,
Is it possible to render Razor in Html.Raw()? I have a dynamic page being
I have a repeater on my page being populated on page load con.Open(); SqlDataReader
I have studied most of the posts concerning web page being viewed in an
I have a page with a Flash animation being used for the logo. When
I have multiple pages being pulled together into a single page. Some of these
I have a simple on my page with the opacity being set to 0.5.
I currently have a loop of items being shown on a page. I would

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.