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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:51:09+00:00 2026-05-17T20:51:09+00:00

I cant figure out why the this alert() part below is not working when

  • 0

I cant figure out why the this alert() part below is not working when I call it from $.getJSON???

function parseInfo(data)
    {
       alert("getJSON worked");
    }

Firebug says I connecting to the server with a 200 OK code

<!DOCTYPE html>
 <html lang="en">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
   <script type="text/javascript">
       $(document).ready(function(){
                 $.getJSON('getData.php', {'data_id' : 'mysql_data'}, parseInfo);
                 });


function parseInfo(data)
{
    alert("getJSON worked");
}

   </script>
</head>
<body>


<form action="getData.php" method="get">
Name: <input type="text" name="fname" />
<input type="submit" />
</form> 


</body>
  • 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-17T20:51:10+00:00Added an answer on May 17, 2026 at 8:51 pm

    Doc here.

    PART 1

    I think it is best to put the callback directly inside of the getJSON() method.

    $(document).ready(function(){
            // DATA IS LOADED FIRST AND PARSED TO GET READY TO ME MAPPED AND PUT INTO SORTABLE TABLES
            $.getJSON("getData.php",
                function(json){
                    alert( "Got JSON Data  ");
                    //DO STUFF HERE
                        }
                        }
    

    PART 2

    I simplified the .php file

    getData.php can simply look like this:

    $all_tdys = array();
    echo json_encode($all_tdys);
    

    PART 3

    as @mway warned I made sure to pass an array and not a MySQL object.

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

Sidebar

Related Questions

Why does this work: a = [] a.push(['test']); (function() {alert('poop')})() But this gives the
I have been looking into this for some hours now and can't figure it
I am working with an ActiveX control in Internet Explorer 8 that is to
I am trying to use python to login to this page(which i own!) http://ninitelist.yolasite.com/passprotected.php
im using kaminari. It's working with a chain and i have ActiveRecord::Relation object, but
struct node* NewNode(int data) { struct node* node = new(struct node); node->data = data;
I have an issue I can't get over. I made a simple jQuery album
i'm new to android and i have a question. i'm using a SimpleAdapter with
So I wrote a small bit of jQuery that uses .toggleTrigger and a rel
How do I write an XPath sum over the following structure ? <Order> <Details>

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.