getJSON issue not seeing retrieved data

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

getJSON issue not seeing retrieved data

I am familiar with programming using PHP and javascript but have not used jQuery much at all.
I am using sample code that does work but when I try to implement a similar function I can't get any output at all.

Here is a sample of the working function I am trying to build upon

This goes to an external server and retrieves and process the data then displays it.

This is my segment of code which I can not get to work properly. All I see is the Go Back button

This is the part of my code block where the data should be displayed

When I browse the link I am using the getJSON on in a regular browser this is what I see

Now in PHP I can use the print_r command to view data in an array where as if try just echo all that is output is Array but I do not know the equivalent in query if it is indeed needed

From what I have read I believe the syntax of my script is correct
This should as I understand it

sets the content of the element with the ID of datasrc to be the data I get from the call
and that ID is in the DIV with the ID of page2
When the page is starts to load that element is hello and then when the page finishes loading the ready function is called and the information there should be replaced with data

The code is being run from an iOS device and as stated earlier the original function succeeds calling an external server.

My function calls another external server.

I think the problem is the format of the data I am receiving and it may be that I am not processing it correctly.

I hope someone can please point my in the right direction