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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:29:56+00:00 2026-05-23T07:29:56+00:00

I have a php script that returns an echo of ‘Hello’ when accessed half

  • 0

I have a php script that returns an echo of ‘Hello’ when accessed half the time (just based on a random number).

Is it possible to make a javascript script on a HTML page that will:

Go to the the PHP page,

If ‘Hello’ is returned it will show an alert of ‘Goodbye’

ELSE

It shows ‘nothing found’

What do I need to do this?

  • 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-23T07:29:57+00:00Added an answer on May 23, 2026 at 7:29 am

    That is called AJAX. Example:

    var msg = 'Nothing found';
    var xhr = new XMLHttpRequest();
    
    xhr.onreadystatechange = function() {
      if (xhr.readyState == 4 && xhr.status == 200) {
        alert(xhr.responseText != "Hello" ? msg : "Goodbye");
      }
    };
    
    xhr.open('GET', 'http://example.com', true);
    xhr.send(null);
    

    See also:
    https://developer.mozilla.org/en/AJAX/Getting_Started

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

Sidebar

Related Questions

The goal is to have a PHP script with a certain section of the
I have designed a file upload form in PHP where it takes 3 pictures
I have identical code on my production and local *AMP servers. I've created a
i have function which is something like this function multiple_delete($entity1,$entity2,$entity2) { $query = SELECT
I am just trying to test a simple ajax call on my server using
I am using php/ajax to submit a form without page refresh. Here are my
I've got a function like: function get_div(){ $fileLocation = 'form.php'; $returnString = '<div id=myDiv>'
I am using wordpress as a CMS and trying to allow user fields to
Here is what I figured so far: To get content of the spreadsheet od6
I am trying to grab data a user selected from a drop down menu.

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.