1

i've got a problem, i'm using cakephp and im loading into a div a page

   function loadContent(targetDiv, sourceUrl) { 
       $(targetDiv).empty().html('<img src="/gambu/img/ajax-loader.gif" />');
       $(targetDiv).load(sourceUrl);
   }

it work's ok, but in a loaded page i've got autocomplete and thickbox, and that's not working :( when the page is loaded normally without ajax everything is fine. I think that ajax loaded page can't see mine jquery scripts. I've tried livequery but it work's only on something like that:

   $("#check").livequery('click', function(event) { 
       $("#myform").toggleCheckboxes();
       return false; 
   }); 

but don't know how to use it with autocomplete and thickbox(made by helper in cakephp)

4

1 回答 1

0

sourceUrl不应包含任何<script />. 他们不会被处决。

要么将脚本移动到主页,要么<script src=...js />在页面时动态注入.load()

顺便说一句,.live()可以帮助在加载元素之前绑定它们。

于 2010-11-26T06:52:29.110 回答