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
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!',
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
s AppController {
>
> public $components = array(
> 'RequestHandler'
> );
>
> public function index(){
>
> /
> json response
> /
> $this->RequestHandle
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()
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
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
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
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',
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":{"
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
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
12 matches
Mail list logo