[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread Josch
Do you get an empty alert or nothing? On 16 Apr., 12:13, spstieng spsti...@hotmail.com wrote: Hi, I'm trying to use jQuery.post() function to retrieve som data. But i get no ouput. My PHP file looks like this: ?php   inlcude_once('dal.php');   //Get store data, and ouput it as JSON.  

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread spstieng
No, I don't get alert. That means it's failing silently. I've tested the functions.php (by running it) and it ouputs the data in JSON format. So retrieveing and echo'ing the data works fine. It's the jQuery that I got wrong. 1. How do I call a specific funtion within functions.php? I got a bad

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread Josch
1. Some questions :-) The click-Handler works? The post is triggered? 2. You can't call a function just with func: getStoreInformation. You could use your func: getStoreInformation on Javascript, but then you have to do something like $func = $_POST['func']; $storeID = $_POST['sID'];

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread Donny Kurnia
spstieng wrote: Hi, I'm trying to use jQuery.post() function to retrieve som data. But i get no ouput. My PHP file looks like this: ?php inlcude_once('dal.php'); //Get store data, and ouput it as JSON. function getStoreInformation($storeID) { $sl = new storeLocator();

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread spstieng
I haven't figured out how to use this yet. How can I debug a javascript file? I only see the html code from my index.php. (I have lots of experience using debugger tool in Visual Studio) Steven On 16 Apr, 15:19, Donny Kurnia donnykur...@gmail.com wrote: Try running it in firefox with firebug

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread Josch
By hitting F12, firebug opens up in Firefox. On the first use, you have to check all three options (Console, Javascript, Network). After reloading the page, you can see the requests and its answers under Console. Under Script, you can debug your scripts. Above Script you can select which script

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread Donny Kurnia
Josch wrote: By hitting F12, firebug opens up in Firefox. On the first use, you have to check all three options (Console, Javascript, Network). After reloading the page, you can see the requests and its answers under Console. Under Script, you can debug your scripts. Above Script you can

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread spstieng
Ah, got it. The Post is correct and the Respons is correct... I think. It's in JSON, but not sure if it's correct. According to http://docs.jquery.com/Ajax/jQuery.post, last example, they have the following line in the php file: ?php echo json_encode(array(name=John,time=2pm)); ? This is why

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread Josch
Please paste here what the servers' response is. On 16 Apr., 16:35, spstieng spsti...@hotmail.com wrote: Ah, got it. The Post is correct and the Respons is correct... I think. It's in JSON, but not sure if it's correct. According tohttp://docs.jquery.com/Ajax/jQuery.post, last example,

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread spstieng
Ok, I found the answer. It was as simple as doing this: alert(data[0].name); Notice the [0]. So here is the functional code for anyone who is wondering about this: javascript file --- jQuery(document).ready(function() { jQuery('#storeListTable tr').click(function() {

[jQuery] Re: jQuery.post() not working for me

2009-04-16 Thread Donny Kurnia
spstieng wrote: Ah, got it. The Post is correct and the Respons is correct... I think. It's in JSON, but not sure if it's correct. According to http://docs.jquery.com/Ajax/jQuery.post, last example, they have the following line in the php file: ?php echo