Re: JSON response!

2012-04-17 Thread Serkan Sipahi
Thanks :) Von meinem iPhone gesendet Am 16.04.2012 um 20:51 schrieb Rob : > It is not possible to send both a HTML and a JSON response for the same > request. However, you can detect the type of request and respond with HTML > or JSON accordingly. For example: > > public

Re: JSON response!

2012-04-16 Thread Rob
It is not possible to send both a HTML and a JSON response for the same request. However, you can detect the type of request and respond with HTML or JSON accordingly. For example: public function index() { $this->set('test', array( 'Hallo World!',

Re: JSON response!

2012-04-16 Thread Serkan Sipahi
Hi, hi, i need some datas on the window object. Von: lowpass An: cake-php@googlegroups.com Gesendet: 21:33 Sonntag, 15.April 2012 Betreff: Re: JSON response! Sending both concurrently makes no sense. What is it you're trying to do? On Sat, A

Re: JSON response!

2012-04-15 Thread lowpass
s AppController { > >     public $components = array( >     'RequestHandler' >     ); > >     public function index(){ > >             / >     json response >     / >     $this->RequestHandle

Re: JSON response!

2012-04-14 Thread Serkan Sipahi
et('test_2', array(     'Hallo World 2',     ));     }     }     is that possible? ____ Von: stork An: cake-php@googlegroups.com CC: Serkan Sipahi Gesendet: 15:56 Samstag, 14.April 2012 Betreff: Re: JSON response! If you called Router::parseExtensions()

Re: JSON response!

2012-04-14 Thread stork
If you called Router::parseExtensions() in routes.php, you don't need to call $this->RequestHandler-> setContent() manually - as long as requested URI does have .json extension at the end or ajax request was called with proper dataType/accept request header. -- Our newest site for the communit

Re: JSON response!

2012-04-14 Thread Serkan Sipahi
ialize', array('test'));     }     }       P.S. In addition to the html document, i want to send json data, too! Von: Tilen Majerle An: cake-php@googlegroups.com Gesendet: 14:59 Samstag, 14.April 2012 Betreff: Re: JSON response! you

Re: JSON response!

2012-04-14 Thread Tilen Majerle
you have to set view to json public $viewClass = 'Json'; something like that :) read manual again :D -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/4/14 Serkan Sipahi > Hi all, > > I want to create a JSON response! Scripting my file according to the > manuel: h

JSON response!

2012-04-14 Thread Serkan Sipahi
Hi all, I want to create a JSON response! Scripting my file according to the manuel: http://book.cakephp.org/2.0/en/views/json-and-xml-views.html It does not work. I get no response from the server! what am I doing wrong? RequestHandler->setContent('json', 

question about json response

2011-09-07 Thread heohni
Hi, I can get 3 possible answers from a ajax call: var obj = $.parseJSON(data); 1. {"noresult":true} which I can get by if(obj.noresult == true) 2. {"errormsg":"Error found..."} by if(obj.errormsg == true) But when I get my database values (in short version) I get this response: [{"tabelone":{"

Re: How to get JSON Response with AJAX link

2008-04-25 Thread Sam Sherlock
here is a simplification of how I make json requests I am using jquery views/layouts/ajax.ctp header('Content-Type: text/x-json'); e(json_encode(Array('title' => $title_for_layout, 'content' => $content_for_layout))); webroot/js/common.js in a function that I attach to all links funct

How to get JSON Response with AJAX link

2008-04-25 Thread Tomka
Hello. I try to get a JSON object as response of an AJAX request. The code in my view looks like this: echo $ajax->link("TEST", array("controller" => "mycontroller", "action" => "myjsonview"), array("complete" => "testfunction(request, json);") ); If I set the o