.load与.on("load") [英] .load vs .on("load")

查看:252
本文介绍了.load与.on("load")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在div内加载一个php页面,该页面需要一个已发布的变量来显示正确的内容.它可以使用以下方式工作:

i am loading a php page inside a div that takes a posted variable to display the proper content. it works using this:

$(".mainArea").load("page.php", {'folder': 'a'}).fadeIn(); 
//passes vars, but all my jquery event handlers no longer work

问题在于,我动态加载了此内容后-我无法使事件处理程序正常工作.所以我认为解决方案是这样的:

the problem is that after i dynamically load this content - i cant get my event handlers to work. so i thought the solution would be this:

$(".mainArea").on("load", "page.php", {'folder': 'a'}).fadeIn(); 
// all event handlers still work - but the variables do not get posted...

关于如何将两者结合或让后者实际传递变量的任何想法?

any ideas on how i can combine these two or get the later to actually pass variables?

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆