AJAX将外部页面加载到div中,没有javascript [英] AJAX loading external page into div, no javascript
问题描述
我一直在努力解决这个问题,并且没有任何地方。
我正在开发一个新网站,并希望它在灯箱中显示一个网页并有一个外部页面添加到主页面,两者都成功分开,但直到我合并它们才发现我有问题。
我的目标是让ajax添加外部页面进入一个div,然后从该div加载灯箱,虽然这就是问题所在,因为我无法运行任何形式的javascript
- 我的AJAX代码(来自dynamicdrive)
I have been trying to fix this issue the whole of today and have gotten no where.
I am developing a new website, and wanted it to display a webpage in lightbox and have an external page added to the main page, both worked successfully apart, but it wasn''t until I combined them that I have had an issue.
My aim was to have ajax add the external page into a div and then load lightbox from that div, though that is where the problem lies as I can not run any form of javascript from it
--My AJAX Code (from dynamicdrive)
推荐答案
所以你的responseText将包含javascript代码?这段代码必须明确规避。你可以将它与页面分开并动态包含脚本标签,或者你需要从响应中提取javascript代码并评估它。
亲切的问候
so your responseText will contain javascript-code? this code has to be evaled explicitly. you may separate it from the page and include script-tags dynamically or you need to extract the javascript-code from the response and eval it.
kind regards
你有解决方案吗?我有同样的问题,但无法找到解决方案!
Did you get a solution? I have the same issue but cant find the solution!
没有人仍在寻找,并试图找到解决方法,但没有出现
No am still looking, and trying to find ways around it, though nothing has come up
这篇关于AJAX将外部页面加载到div中,没有javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!