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
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
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
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
@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
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
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
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/
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
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
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.
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.
);
> >> > }, "json");
> >> > });
>
> >> > controller code:
> >> > function getlastid() {
> >> > $newid = "SHOE";
> >> > $array = array('result'
: item },
>> > function(data){
>> > alert(data.result);
>> > }, "json");
>> > });
>>
>> > controller code:
>> > function getlastid()
t;json");
> > });
>
> > controller code:
> > function getlastid() {
> > $newid = "SHOE";
> > $array = array('result' => $newid);
> > echo json_encode($array);
> > }
>
> --
> V
function(data){
> alert(data.result);
> }, "json");
> });
>
> controller code:
> function getlastid() {
> $newid = "SHOE";
> $array = array('result' => $new
function(data){
> alert(data.result);
> }, "json");
> });
>
> controller code:
> function getlastid() {
> $newid = "SHOE";
> $array = array('
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
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
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.
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
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
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"
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
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
--~--~-~--~~
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
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
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
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
29 matches
Mail list logo