简体   繁体   English

Ajax加载后调用jQuery函数

[英]Call jQuery Function after ajax load

So, the thing is i'm trying to import a slider with ajax, the slider works if you access the page directly: 所以,问题是我正在尝试使用ajax导入一个滑块,如果您直接访问该页面,该滑块将起作用:

http:// www.iloja.pt/ajaxload/ipod.php http:// www.iloja.pt/ajaxload/ipod.php

if you try to access iloja.pt and click "reparações" and after that click "iPod" it calls the ipod.php page but the slider doesn't work. 如果您尝试访问iloja.pt并单击“reparações”,然后单击“ iPod”,它将调用ipod.php页面,但滑块不起作用。 I tried to include the js files in many ways but the 我试图以多种方式包括js文件,但

i know i have to use bind function, but don't know how to do it. 我知道我必须使用绑定功能,但不知道该怎么做。

There seems to be some javascript errors, specifically: 似乎有一些JavaScript错误,具体是:

"animation is not defined" “动画未定义”

You have many errors in that page, see Javascript console on Chrome or Firebug on Firefox. 该页面有很多错误,请参阅Chrome上的Javascript控制台或Firefox上的Firebug。 In particular I can see this errors: 我尤其可以看到以下错误:

Failed to load resource: the server responded with a status of 404 (Not Found) [http://www.iloja.pt/js/jquery.ennui.contentslider.js?_=1326816532863]
Uncaught TypeError: Object [object Object] has no method 'ContentSlider'

your problem is that the browser can't load the contentslider.js library so you have an exception when using ContentSlider Method. 您的问题是浏览器无法加载contentslider.js库,因此在使用ContentSlider方法时会出现异常。

Try to fix the loading of the js. 尝试修复js的加载。

您是否尝试过将async:'false'参数添加到ajax调用中,那样它应该在执行其他任何操作之前完全加载代码...

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

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