Re: Using Jquery-JSON to Send Data to the Server

2011-05-26 Thread darkwolf
Usually I work with Firefox and Firebug for Web programming. The Firebug doesn't shows anything wrong. I do not understand what happen. When I do document.frm.submit() in the Onclick input to send data, I have been checked what you said and only shows array indexes, and i need to pick the values a

Re: Using Jquery-JSON to Send Data to the Server

2011-05-26 Thread huoxito
did you check on firebug if all params are passed correctly? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this grou

Re: Using Jquery-JSON to Send Data to the Server

2011-05-25 Thread darkwolf
Thanks for answer me. I used debug($this->params) and i could see the array, it seems like print_r($this->data). I could see that json maybe i'm not using it correctly, it could be the function $.ajax i have a problem there. At this group i posted a larger version of my question with the code form

Re: Using Jquery-JSON to Send Data to the Server

2011-05-25 Thread huoxito
do some debug($this->params) on the controller and you should see that data -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe

Re: CakePHP, jQuery & JSON

2011-03-18 Thread Daniel
@cronet, i always make my Ajax Request as u tried. I tried like you to use .json ext and it never worked for me, so i parsed .ajax extension and all work fine.. you should try .ajax extension. On 18 mar, 10:12, cronet wrote: > That works very well... Thank you guys ! > > On 18 Mrz., 12:28, LipeD

Re: CakePHP, jQuery & JSON

2011-03-18 Thread Miles J
I wrote some blog posts about this. http://milesj.me/blog/read/62/Doing-AJAX-Calls-In-CakePHP%3A-Part-1-_-The-Front_end On Mar 18, 7:12 am, cronet wrote: > That works very well... Thank you guys ! > > On 18 Mrz., 12:28, LipeDjow wrote: > > > Yes. > > > Instead returning the value in action, you

Re: CakePHP, jQuery & JSON

2011-03-18 Thread cronet
That works very well... Thank you guys ! On 18 Mrz., 12:28, LipeDjow wrote: > Yes. > > Instead returning the value in action, you can set it to view and load a > general element for JSON. > Like this (using Taffarel's example): > > function json(){ >     //bring some data in database >      $json

Re: CakePHP, jQuery & JSON

2011-03-18 Thread LipeDjow
Yes. Instead returning the value in action, you can set it to view and load a general element for JSON. Like this (using Taffarel's example): function json(){ //bring some data in database $json = $this->Test->find('all'); $this->set('json', $json); $this->render('../elements/

RE: 2 Col Layout / Jquery / JSON

2011-01-28 Thread Dave Maharaj
riday, January 28, 2011 7:42 AM To: cake-php@googlegroups.com Subject: Re: 2 Col Layout / Jquery / JSON convert a php array to a json array with json_encode (there's a built in function in php) and then on your response on ajax request you can do a foreach to put each key content of the arra

Re: 2 Col Layout / Jquery / JSON

2011-01-28 Thread huoxito
something like this $array( 'nome' => 'huoxito', 'bebida' => 'vinho', 'musica' => 'reggae' ); $jsonArray = json_encode($array); $.ajax({ ... on request result success: function(result){ var json = $.parseJSON(result); $.each(json, function(i,item) { $('#divnome').html(item.no

Re: 2 Col Layout / Jquery / JSON

2011-01-28 Thread huoxito
convert a php array to a json array with json_encode (there's a built in function in php) and then on your response on ajax request you can do a foreach to put each key content of the array anywhere you want on the page. -- Our newest site for the community: CakePHP Video Tutorials http://tv.

2 Col Layout / Jquery / JSON

2011-01-27 Thread Dave Maharaj
How can you update 2 div areas with 1 response? Simple 2 col layout with side menu in col 1 main page content in col 2. Click on menu loads the proper page in col 2, pretty standard straight forward stuff. Now depending on the link I also want to change the content under the side menu in col 1.

Re: Jquery JSON Ajax Callback Not Working

2009-10-24 Thread Dr. Loboto
); > >> >                              }, "json"); > >> >         }); > > >> > controller code: > >> > function getlastid() { > >> >            $newid = "SHOE"; > >> >         $array = array('result'

Re: Jquery JSON Ajax Callback Not Working

2009-10-23 Thread hahmadi82
: item }, >> >                              function(data){ >> >                                alert(data.result); >> >                              }, "json"); >> >         }); >> >> > controller code: >> > function getlastid()

Re: Jquery JSON Ajax Callback Not Working

2009-10-23 Thread Dr. Loboto
t;json"); > >         }); > > > controller code: > > function getlastid() { > >            $newid = "SHOE"; > >         $array = array('result' => $newid); > >         echo json_encode($array); > >     } > > -- > V

Re: Jquery JSON Ajax Callback Not Working

2009-10-23 Thread hahmadi82
function(data){ > alert(data.result); > }, "json"); > }); > > controller code: > function getlastid() { > $newid = "SHOE"; > $array = array('result' => $new

Re: Jquery JSON Ajax Callback Not Working

2009-10-20 Thread hahmadi82
function(data){ > alert(data.result); > }, "json"); > }); > > controller code: > function getlastid() { > $newid = "SHOE"; > $array = array('

Jquery JSON Ajax Callback Not Working

2009-10-19 Thread hahmadi82
uot;json"); }); controller code: function getlastid() { $newid = "SHOE"; $array = array('result' => $newid); echo json_encode($array); } -- View this message in context: http://www.nabble.com/Jquery-JSON-Ajax-Callback-Not-W

Re: JQuery + JSON

2008-09-08 Thread hydra12
It's been awhile since I tried this, and I'm not in a position to test this code, but I think you can do something like this: Make sure to include these 2 lines in your controller: Configure::write('debug', '0'); //set debug to 0 for this function because debugging info breaks the XMLHttpReques

Re: JQuery + JSON

2008-09-07 Thread Jonathan
I'm still having trouble with this. Any ideas? On Aug 27, 8:36 am, Jonathan <[EMAIL PROTECTED]> wrote: > I did this http://www.pagebakers.nl/2007/06/05/using-json-in- > cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the Pagebakers > blog to get JSON working with my installation of CakePHP.

Re: JQuery + JSON

2008-09-04 Thread Jonathan
Hey guys. Thanks for all the responses. I set my debug to 2 and I started getting something in my response, but it's not what I wanted. It looks like my database query might be failing for some reason. Also, according to firebug, my request still isn't being seen as JSON. I've tried "text/javascr

Re: JQuery + JSON

2008-08-28 Thread David
The reason I suggested changing the Content-Type header to text/ javascript is that jQuery's .getJSON method sends an accept header of text/javascript, and not text/x-json. You can see this in the dump of the headers that the op attached to the message. David On Aug 27, 6:24 pm, clemos <[EMAIL

Re: JQuery + JSON

2008-08-27 Thread [EMAIL PROTECTED]
just an idea. Try in beforeFilter of controller add next if ($this->action == 'your json action name') { $this->RequestHandler->enabled = false; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP"

Re: JQuery + JSON

2008-08-27 Thread clemos
Hi Maybe I'm missing something, but what he gets from his json queries is only headers, no content. So I guess his debug is already to 0, because otherwise the content would at least be filled with the "" in the end... >From his first message, his problem is not about errors parsing the JSON obje

Re: JQuery + JSON

2008-08-27 Thread [EMAIL PROTECTED]
Add this to your view, because JSON can't be parsed if it presents any kind of text besides the JSON string and Cake presents it whe debugging is set to 2 or 1 In your view object($post); Configure::write('debug', 0); ?> This will disable the output from the debugging --~--~-~--~~

Re: JQuery + JSON

2008-08-27 Thread clemos
Hi As always, you should start by setting debug level to 2 in your config/core.php, to see if there's any error displayed... ++ Clément On Wed, Aug 27, 2008 at 2:36 PM, Jonathan <[EMAIL PROTECTED]> wrote: > > I did this http://www.pagebakers.nl/2007/06/05/using-json-in- > cakephp-12/"Using

Re: JQuery + JSON

2008-08-27 Thread David
Have you tried setting the header content-type to text/javascript, rather than the text/x-json that you've got? David On Aug 27, 1:36 pm, Jonathan <[EMAIL PROTECTED]> wrote: > I did this http://www.pagebakers.nl/2007/06/05/using-json-in- > cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the

Re: JQuery + JSON

2008-08-27 Thread Dardo Sordi Bogado
Have you added Javascript to the helpers array? And maybe you can paste some code at bin.cakephp.org... On Wed, Aug 27, 2008 at 9:36 AM, Jonathan <[EMAIL PROTECTED]> wrote: > > I did this http://www.pagebakers.nl/2007/06/05/using-json-in- > cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the

JQuery + JSON

2008-08-27 Thread Jonathan
I did this http://www.pagebakers.nl/2007/06/05/using-json-in- cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the Pagebakers blog to get JSON working with my installation of CakePHP. Almost everything seems to be working fine. When I go to http://localhost/mkb/index I get the page like norm