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

  • Home
  • SEARCH
  • 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 1058363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:00:59+00:00 2026-05-16T18:00:59+00:00

How should I do this? function(id,id2){ if (window.XMLHttpRequest) { // code for IE7+, Firefox,

  • 0

How should I do this?

function(id,id2){

    if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
         xmlhttp=new XMLHttpRequest();
    } else { // code for IE6, IE5
         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

First Request:

   xmlhttp.open("GET", "http://example.com/ajax.php?id="+id, true);

   xmlhttp.send();

Second Request:

   xmlhttp.open("GET", "http://example.com/ajax2.php?id2="+id2, true);

   xmlhttp.send();

}

Because in this way doesn’t works.

I want to make it in plain javascript, so please do not post answers with jQuery or any library etc.

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-16T18:01:00+00:00Added an answer on May 16, 2026 at 6:01 pm

    It should work if you create a new xmlhttp object. Currently you are attempting to reuse the same object, which is already performing a query so it will not work.

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

Sidebar

Related Questions

EDIT: My main code no longer works, should this function work? <script type=text/javascript src=jquery-1.7.2.js></script>
arr=Array.new(3) arr[0]=5 arr[1]=3 arr[2]=2 These lines should call this function, https://github.com/ruby/ruby/blob/trunk/array.c#L568 according to this,
This function works as it should, window.setInterval(function(){ var active = $('#frontpageControls a.active'); var next
Should this work? <script type=text/javascript> function load_i () { img = new Image(); img.onload
This is my test code: describe(Login, function(){ beforeEach(function(){ loadFixtures('login-fixture.html'); }) it(should enable the button
Should this function be: check_login_session() { if (!isset[$_SESSION['user_auth']) ) { header('Location: login.php'); } else
This function resides in a Service when called by an activity it should will
Consider the following snippet: $(document).bind('mousemove', function(e) { $('#someDiv').css({left: e.pageX+'px', top: e.pageY+'px'}); }); This should
Let's say that some function returns object reference. How one should properly spell: this
This is driving me a bit nutty. Javascript link should fire function to fill

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.