English 中文(简体)
在ajax子级中注入父javascript文件
原标题:inject parent javascript files inside ajax child

the story: I use ajax a lot inside a certain project, I build floating divs and populate them with different content using ajax (similar with how facebook works when using the popups).

我遇到的问题是,当获取ajax页面时,我需要在该页面中重新包含所有javascript,以便javascript函数正常工作。

简而言之,当我输出ajax内容时,我会再次执行<;脚本src=事物

最大的问题是,这会减慢应用程序的速度,因为还会对父窗口中已经包含的javascript文件进行额外的调用。

你是如何处理这个问题的?非常感谢。

最佳回答

when getting an ajax page I need to reinclude all javascript inside that page in order for the javascript functions to work properly…
How do you handle this issue?

什么问题?如果您是关于附加到动态添加对象的事件的处理程序,那么,在使用jquery的情况下,最好的选择是livequery插件。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.