简体   繁体   English

AJAX加载内容后如何调用javascript函数?

[英]How do I call a javascript function after AJAX loads content?

I'm using some code for infinite scrolling on a Tumblr blog using AJAX, and it works very well except for when it comes to loading certain Flash content. 我正在使用AJAX在Tumblr博客上使用一些代码进行无限滚动,除了加载某些Flash内容时,它的效果非常好。 The code for the infinite scroll is here . 无限滚动的代码在这里

I have a partial solution to the problem of Flash content using some code suggested by Daniel K , a user on this site. 我使用本网站用户Daniel K建议的一些代码来部分解决Flash内容的问题。 I have implemented the code for calling the function on page load, however I cannot figure out how to call the function after the AJAX loads content for the infinite scroll. 我已经实现了用于在页面加载时调用该函数的代码,但是我无法弄清楚在AJAX加载无限滚动的内容之后如何调用该函数。

I have several themes for Tumblr and a number of people have asked me to implement infinite scroll. 我有几个针对Tumblr的主题,许多人要求我实现无限滚动。 I have been reluctant to add it because of the Flash problem. 由于Flash问题,我一直不愿意添加它。 Any help would be appreciated, thanks. 任何帮助,将不胜感激,谢谢。

The code in this answer can probably be fixed up a bit, but it should work for you in the time being. 这个答案中的代码可能可以修复一些,但是暂时应该对您有用。 Just make sure to place it within your infinite scroll callback. 只要确保将其放在无限滚动回调中即可。

Tumblr Audio & Video + Infinite Scroll Tumblr音频和视频+无限滚动

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

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