简体   繁体   English

加载内容内的Ajax链接

[英]Ajax link inside loaded content

I got problem using ajax->link inside a loaded view. 我在加载的视图中使用ajax-> link遇到问题。

In my index page, i load dynamically a div with the content of a view. 在索引页面中,我会动态加载带有视图内容的div。 Inside this view i got a ajax->link to update content in itself. 在此视图内部,我获得了一个ajax-> link来更新自身内容。

If i go on the view, the update work correctly. 如果我继续查看,更新工作正常。 Therefore, if in try in the loaded div, it doesn't work. 因此,如果尝试在已加载的div中尝试,则无法使用。

Firebug, notice me when i load the div : Firebug,当我加载div时注意我:

registry is undefined
     var respondersForEvent = registry.get(eventName);

Is it any solution about this ? 有什么解决办法吗?

A workaround for this would be to use something like the jquery .live() function which will do the magic for you. 一种解决方法是使用类似jquery .live()函数的方法 ,它将为您带来魔力。 If thats useful and you want to move from prototype, have a look at this jquery helper . 如果那很有用,并且您想脱离原型,请查看此jquery helper

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM