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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:03:56+00:00 2026-06-04T10:03:56+00:00

i am using AjaxRequest.Get() method from AjaxRequest . following is the inline javascript in

  • 0

i am using AjaxRequest.Get() method from AjaxRequest.
following is the inline javascript in analysis.aspx

 function getAnalysis(type) {            
        var innerHtml;      
        AjaxRequest.get(
            {
                'url': 'getAnalysis.aspx?type=' + type
                , 'onSuccess': function (req) { innerHtml = req.responseText; }
            }
        );
        document.getElementById("div_analysis").innerHTML = innerHtml;
    }

when getAnalysis(type) is called in analysis.aspx everything goes fine – ajax request is properly submitted and response is send properly. But at the end value of innerHTML remains undefined.

Following is the code of getAnalysis.aspx –

 protected void Page_Load(object sender, EventArgs e)
 {
    if(type == "somwthing") str = load();    
    Response.Clear();     
    Response.CacheControl = "no-cache";              
    Response.Write(str);      
    Response.End();     
 }

When i debugged javascript using google chrome, i found that value of innerHMTL is undefined, although everything went fine.
So i dont understand why AjaxRequest class is not accepting text output from Reponse.Write().

P.S. : I have also tried Response.ContentType = "text/Html"; and Reponse.Fluch().
please guide me thnx in advance.

  • 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-04T10:03:57+00:00Added an answer on June 4, 2026 at 10:03 am

    You need to set the div contents in the onsuccess function since it is called asynchronously when the AJAX request completes

    function getAnalysis(type) {             
            var innerHtml;       
            AjaxRequest.get( 
                { 
                    'url': 'getAnalysis.aspx?type=' + type 
                    , 'onSuccess': function (req) { document.getElementById("div_analysis").innerHTML = req.responseText; } 
                } 
            ); 
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<script language='javascript' type='text/javascript'> function ajaxFunction(){ var ajaxRequest; try{ // Opera 8.0+, Firefox, Safari ajaxRequest
var request = new Request({ method: 'get', url: 'onlinestatusoutput.html.php', onComplete:function(response) { $('ajax-content').get('tween', {property: 'opacity',
I'm using the following in the web page but can't get a response from
I'm formulating an Ajax request using prototype in the following method: function updateServerStep(stepNumber){ alert(updating
I aam trying to GET an array from a JSON file using JQuery's ajax
I'm using Dojo toolkit to get data from an external JSON source (a web
I'm submitting a form using an ajax request (POST method), and checking the HTTP
I'm using jQuery to setup an Ajax request that grabs an XML feed from
I perform an AJAX request to a PHP script in JavaScript and by using
Using LINQ on collections, what is the difference between the following lines of code?

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.