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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:37:07+00:00 2026-06-11T18:37:07+00:00

when using ajax, will this code bring up javascript content? var xmlhttp; var nocache

  • 0

when using ajax, will this code bring up javascript content?

 var xmlhttp;
var nocache = 0;



function further($id)
{
    xmlhttp=getXmlHttpObject();
    if (xmlhttp==null)
    {
        alert ("Browser does not support HTTP Request");
        return;
    }
    var url="further.php?Pid=" + $id;
    //url=url+"cachestopper=" + Math.random();

    xmlhttp.onreadystatechange=handleAjaxResponse;
    xmlhttp.open("GET",url,'&nocache = '+nocache,true);
    xmlhttp.send(null);
}

function handleAjaxResponse()
{
    if (xmlhttp.readyState==4)
    {
        document.getElementById("output").innerHTML = xmlhttp.responseText;

    }else{
        document.getElementById("main").innerHTML = "";
    }
}

function getXmlHttpObject()
{
    if (window.XMLHttpRequest)
    {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        return new XMLHttpRequest();
    }
    if (window.ActiveXObject)
    {
        // code for IE6, IE5
        return new ActiveXObject("Microsoft.XMLHTTP");
    }
    return null;
}

I know this works well for html and text content, but in my case, I need to produce a diagram that is generated using javascript, d3.js to be exact. Will .innerHTML = xmlhttp.responseText; work for this? If not, what will I have to use instead to produce the javascript content?

  • 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-11T18:37:08+00:00Added an answer on June 11, 2026 at 6:37 pm

    A small bug in your code while opening a XMLHttpRequest Object.

    xmlhttp.open("GET",url,'&nocache = '+nocache,true);
    
    It should be 
     xmlhttp.open("GET",url+'&nocache = '+nocache,true);
    

    Try this http://jsfiddle.net/nubgw/7/

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

Sidebar

Related Questions

I am making a 2D game in javascript/ajax, that will be using data stored
HTML5 will be next super star. So~~~How to using new idea to implement AJAX
EDIT: iam using ajax to load text in my content that is why onload
On my Code I have this callback $('#tagList').tagit({ //Every new dag will be pushed
How can I make a table sortable using javascript without loading data via AJAX?
I'm building a webapp using php, ajax, javascript, mysql. I've been worring about something
I'm trying to open a jQuery dialog using AJAX. The content of the dialog
I have the following code which I'm using to populate form fields. This code
Im using ajax loading for children nodes in JQuery JsTree plugin. I need to
I am using Ajax to post the comments of the website. No the user

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.