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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:06:30+00:00 2026-05-21T02:06:30+00:00

Example URL: http://twitter.realgamingreview.com/index.php Edit : forgot to mention: use the test sign in: test/test

  • 0

Example URL: http://twitter.realgamingreview.com/index.php

Edit: forgot to mention: use the test sign in: test/test for username/password.

I am attempting to do a simple AJAX request to retrieve some data from a database. The target file, serverTime.php, seems to be working perfectly; it inserts the desired data and returns the desired responseText.

However, the request seems to be firing twice. This is clear when I step through the JavaScript using Firebug. This causes the page to ‘reset’ (not exactly sure), such that my cursor loses focus from its current textbox, which is a new problem. The URL also says, “localhost/twitter/index.php?message=”, even if my message is not actually empty. I want to fix this fairly minor problem before something major comes of it.

The JavaScript is below. ajaxRequest is my XMLHTTPRequest object. Any help is appreciated!

//Create a function that will receive data sent form the server
ajaxRequest.onreadystatechange = function(){
    if (ajaxRequest.readyState == 4){
        document.getElementById('output').innerHTML = ajaxRequest.responseText;
    }
}
// build query string
var message = document.myForm.message.value;
var queryString = "message=" + message;

    //send AJAX request
    ajaxRequest.open("GET", "serverTime.php" + "?" + queryString, true);

    ajaxRequest.send(null);

Thanks,

Paragon

  • 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-21T02:06:31+00:00Added an answer on May 21, 2026 at 2:06 am

    My issue was completely unrelated to AJAX. Instead, it was a simple (but obscure) issue where with two textboxes in my form, I was able to hit enter and not have the page reload, but with only one, the page would reload for some reason.

    I have since changed my event system such that I am not relying on something so unreliable (now using jQuery to listen for the Enter key being pressed for specific textboxes).

    Thanks to those of you who took the time to answer my misinformed question.

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

Sidebar

Related Questions

On a LAMP server, I want the URL http://example.com/index.php to be rewritten to simply
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
Take a very simple case as an example, say I have this URL: http://www.example.com/65167.html
url = http://example.com/file.xml data = urllib2.urlopen(url) data.read() The question is, when exactly will the
For example, here on stack overflow the URL https://stackoverflow.com/questions/tagged/javascript+php will give you all questions
If I was to send a URL to a DNS server, lets say: dev.example.com/?username=daniel,
For example, say I was using the twitter widget here: http://twitter.com/about/resources/widgets/widget_profile And I was
I am passing this url http://new.wadja.com/petty01#bad religion to twitter button and I receive 'url'
I received a list when inputting the following URL - http://api.twitter.com/1/trends/44418.json The list contains
Example RSS feed link: http://twitter.com/statuses/user_timeline/twitter.rss Does anyone know if Twitter limits calls to a

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.