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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:42:51+00:00 2026-06-12T09:42:51+00:00

This code is from tiztag tutorial function ajaxFunction(){ var ajaxRequest; // The variable that

  • 0

This code is from tiztag tutorial

function ajaxFunction(){
var ajaxRequest;  // The variable that makes Ajax possible!

try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
} catch (e){
    // Internet Explorer Browsers
    try{
        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try{
            ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e){
            // Something went wrong
            alert("Your browser broke!");
            return false;
        }
    }
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
        document.myForm.time.value = ajaxRequest.responseText;
    }
}
ajaxRequest.open("GET", "serverTime.php", true);
ajaxRequest.send(null); 
}

This is another one I find throughout jQuery website:

$.ajax({
  type:"GET" // or "POST"
  url: url,
  data: data,
  success: success,
  dataType: dataType,
  error: //function
});

I’ve been trying to use both ways to get some sort of response from PHP file. The first example works but I also want to get the second form to work… could someone give me some guidance? In my php all i have is:

<?php
echo("Response from PHP");
?>
  • 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-12T09:42:53+00:00Added an answer on June 12, 2026 at 9:42 am

    The difference between the two is almost nothing. jQuery just prevents you from doing the extra boiler plate code surrounding the cross browser compatibility.

    The jQuery documentation should give you all the information you need.

    You will need to have an url variable, and a success variable.

    The url variable will be a string to the URL in which you’re trying to send this information.

    The success variable will be a ‘callback’ function that will do whatever it is you’re trying to do. It will ONLY be called if your call was a success.

    Always check your Javascript console to see what your errors are.

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

Sidebar

Related Questions

I got this code from Jquery in Action: $.fn.photoslide = function(options) { var settings
i have this code from a tutorial: // Do the search and show the
got this code from a website that helped me in creating buttons and stuff.
when i copied this code from page error found that there is syntax error
I have this code from Yii Example private function _checkAuth() { // Check if
I created this code from a tutorial but have hard time understanding a key
i have this code from t he django sample tutorial from django.db import models
I am using this code from NEHE tutorial in my MFC based application on
I got this code from StackOverflow: $(document).ready(function() { $(function(){ $('img').load(function() { $(this).data('height', this.height); }).bind('mouseenter
In this code from Microsoft's MVC Tutorial NerdDinners: public class DinnerRepository { private NerdDinnerDataContext

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.