Dynamically adding a script/function block in jquery

EDITED: Just wondering if is it possible to add a function (or static script) block or a variable to body of html. Something like this, $('body').add(function(){/../}) or $('body').append('') or $('body').fn.myFunc = function(){} Is it correct to use .extend instead? One example is if I use ExternalInterface, my callbacks have to be statically defined in body/html/js but not in $().ready function unless I have a var defined globally and refer it in $().ready function. I overlooked this requirement, and thats where I wanted to add dynamic callback functions.

以上就是Dynamically adding a script/function block in jquery的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准