I am usin开发者_运维知识库g cakephp 1.3.
I want to use its Ajax helper and the CakePHP 1.3 AJAX documentation says that I will have to use prototype.js
and scriptaculous.js
to work with it.
But I am already using jQuery for my project and it conflicts with the prototype.js
file.
So is there any way to work with Ajax helper and jQuery instead of Ajax helper and prototype / scriptaculous? (I don't want to use prototype.)
Thanks.
Quoted from the red box at the top of that page:
Both the JavascriptHelper and the AjaxHelper are deprecated, and the JsHelper + HtmlHelper should be used in their place.
Have a look at the documentation for the JsHelper instead.
From the link you provided:
Both the JavascriptHelper and the AjaxHelper are deprecated, and the JsHelper + HtmlHelper should be used in their place. See The Migration Guide
On Js helper page:
Since the beginning CakePHP's support for Javascript has been with Prototype/Scriptaculous. While we still think these are an excellent Javascript library, the community has been asking for support for other libraries. Rather than drop Prototype in favour of another Javascript library. We created an Adapter based helper, and included 3 of the most requested libraries. Prototype/Scriptaculous, Mootools/Mootools-more, and jQuery/jQuery UI. And while the API is not as expansive as the previous AjaxHelper we feel that the adapter based solution allows for a more extensible solution giving developers the power and flexibility they need to address their specific application needs.
echo $this->Html->script('jquery'); // Include jQuery library
And also take a look at the jQuery AJAX pagination example.
精彩评论