CakePHP 2.0 JSHelper 链接不调用插件
我正在尝试使用 JS 助手,如下所示:
echo $this->Js->link(
'Incluir'
, array('controller' => 'events', 'action' => 'add')
, array(
'title' => 'Incluir'
, 'update' => '#content-outer'
, 'before' => $this->Js->get('#content-outer')->effect('fadeOut', array('buffer' => false))
, 'success' => $this->Js->get('#content-outer')->effect('fadeIn', array('buffer' => false))
)
);
结果是这个 ajax 和下面的链接:
link: <a href="/bilheteria/events/add" id="link-473478646" title="Incluir">Incluir</a>
ajax: $j("#link-473478646").bind("click", function (event) {$j.ajax({beforeSend:function (XMLHttpRequest) {$j("#content-outer").fadeOut();}, dataType:"html", success:function (data, textStatus) {$j("#content-outer").fadeIn();$j("#content-outer").html(data);}, url:"\/bilheteria\/events\/add"});
该链接使用淡入淡出效果打开请求的方法,但我在此视图中有一个tinyMCE插件,但它不渲染。
当我调用控制台并手动执行调用时,tinyMCE 插件会正确渲染,并且当我使用完整地址 调用链接时http://192.168.50.7/bilheteria/events/add 插件也可以工作。
我已尝试在 js 链接中使用以下所有选项:
method - GET / POST / PUT
type - ‘json’
evalScripts - True / False
Why does the js->link 行为如此? (即正确渲染ajax和链接,但是当使用链接访问页面时,tinyMCE插件被破坏了?)
I am trying to use the JS helper as shown below:
echo $this->Js->link(
'Incluir'
, array('controller' => 'events', 'action' => 'add')
, array(
'title' => 'Incluir'
, 'update' => '#content-outer'
, 'before' => $this->Js->get('#content-outer')->effect('fadeOut', array('buffer' => false))
, 'success' => $this->Js->get('#content-outer')->effect('fadeIn', array('buffer' => false))
)
);
The result is this ajax and this link below:
link: <a href="/bilheteria/events/add" id="link-473478646" title="Incluir">Incluir</a>
ajax: $j("#link-473478646").bind("click", function (event) {$j.ajax({beforeSend:function (XMLHttpRequest) {$j("#content-outer").fadeOut();}, dataType:"html", success:function (data, textStatus) {$j("#content-outer").fadeIn();$j("#content-outer").html(data);}, url:"\/bilheteria\/events\/add"});
The link opens the method requested, using the fade effect, but i have a tinyMCE plugin in this view and it does not render.
When I call a console and execute the call manually the tinyMCE plugins render properly and when I evoke the link using the complete address http://192.168.50.7/bilheteria/events/add the plugins work as well.
I have tried using all of the following options in the js link:
method - GET / POST / PUT
type - ‘json’
evalScripts - True / False
Why does the the js->link behave in this way? (i.e. rendering the ajax and the link correctly but when the link is used to access the page the tinyMCE plugins are broken?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论