Ajax不显示包含带有javascript的html页面的DIV [英] Ajax does not display a DIV which contains a html page with javascript

查看:112
本文介绍了Ajax不显示包含带有javascript的html页面的DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




尝试使用AJAX重新加载DIV区域时,我遇到了一个问题

使用2000ms的计时器,其中包含一个带有另一个DIV和javascript的html页面。


场景

-------------

我有perl脚本,它只是在Solaris服务器上运行ps并生成

a静态html页面,所有代码都完美无缺,这个html页面工作正常

静态查看或使用META REFRESH标头标签。这个想法是以运行时的方式为用户提供实时cpu图形的外观。


我有4台服务器受到监控,这些服务器都在IFRAME html中被认可

页面,每2秒刷新一次。这很好用但非常直观

烦人。


所以我决定使用AJAX刷新页面。 ajax代码使用2000ms的定时值

并刷新页面,希望对用户的闪烁更少。


我工作的ajax脚本100静态或CGI生成页面的百分比和

相应地更新DIV。


当我尝试使用包含<的基本HTML页面更新AJAX div时br />
静态工作的图形信息,图形不会出现在a / b $ b $ a bax div中。如果我在创建

图表的代码之前和之后放置一些文本,数据显示正常。


有谁知道为什么会发生这种情况?


ajax脚本只返回页面上的Foo和Bar而不是图形。


我调用/使用lg的javascript代码.html页面可以在
http://www.sbmkpm.com找到/line.html


图表的基本代码如下。 (lg.html)

------>

Foo

展开 | 选择 | Wrap | 行号

解决方案





我一直遇到问题尝试使用AJAX重新加载DIV区域

使用2000ms的计时器,其中包含一个带有另一个DIV和javascript的html页面。


场景

-------------

我有perl脚本,只需在Solaris服务器上运行ps并生成

a static html页面ll代码完美,这个html页面工作正常

静态查看或使用META REFRESH标头标记。这个想法是以运行时的方式为用户提供实时cpu图形的外观。


我有4台服务器受到监控,这些服务器都在IFRAME html中被认可

页面,每2秒刷新一次。这很好用但非常直观

烦人。


所以我决定使用AJAX刷新页面。 ajax代码使用2000ms的定时值

并刷新页面,希望对用户的闪烁更少。


我工作的ajax脚本100静态或CGI生成页面的百分比和

相应地更新DIV。


当我尝试使用包含<的基本HTML页面更新AJAX div时br />
静态工作的图形信息,图形不会出现在a / b $ b $ a bax div中。如果我在创建

图表的代码之前和之后放置一些文本,数据显示正常。


有谁知道为什么会发生这种情况?


ajax脚本只返回页面上的Foo和Bar而不是图形。


我调用/使用lg的javascript代码.html页面可以在
http://www.sbmkpm.com找到/line.html


图表的基本代码如下。 (lg.html)

------>

Foo

展开 | 选择 | Wrap | 行号



使静态页面动态,因为它不适用于静态。

实际上AJAX不适用于静态页面上传。


亲切的问候,

Dmjpro。






感谢您的反馈。


您的意思是,得到一个pl脚本或类似的东西打印出与静态生成的页面中出现的相同的

数据?


干杯。






感谢您的反馈。


你的意思是,得到一个pl脚本或类似的东西打印出与静态生成的页面中出现的相同的数据?


干杯。



是的! :-)


你试过了,你的O / P是什么?


亲切的问候,

Dmjpro。


Hi,

I have been experiencing an issue when trying to use AJAX to reload a DIV area
using a timer of 2000ms, which contains a html page with another DIV and javascript.

Scenario
-------------
I have perl script which simply runs a ps on a Solaris server and generates
a static html page with all of the code perfectly and this html page works fine
when viewing it statically or with a META REFRESH header tag. The idea is to give the user the appearance of a live cpu graph in a runtime fashion.

I have 4 servers being monitored which are all conaitned within an IFRAME html
page, each refreshing every 2 seconds. This works fine but very visually
annoying.

So I decided to use AJAX to refresh the page. The ajax code uses a timed value
of 2000ms and refreshes the page with hopefully a lot less flickering to the user.

The ajax script I have works 100% for a static or CGI generated page and
updates the DIV accordingly.

When I try to update the AJAX div with the very basic HTML page containing
the graph information which works statically, the graph does not appear within
the ajax div. If I place some text before and after the code which creates the
graphs that data appears fine.

Would anyone know why this could be happenning?

The ajax script will only return Foo and Bar on the page and not the graph.

The javascript code I am calling/using with the lg.html page can be found at
http://www.sbmkpm.com/line.html

The basic code for the graph is as follows. (lg.html)
------>
Foo

Expand|Select|Wrap|Line Numbers

解决方案

Hi,

I have been experiencing an issue when trying to use AJAX to reload a DIV area
using a timer of 2000ms, which contains a html page with another DIV and javascript.

Scenario
-------------
I have perl script which simply runs a ps on a Solaris server and generates
a static html page with all of the code perfectly and this html page works fine
when viewing it statically or with a META REFRESH header tag. The idea is to give the user the appearance of a live cpu graph in a runtime fashion.

I have 4 servers being monitored which are all conaitned within an IFRAME html
page, each refreshing every 2 seconds. This works fine but very visually
annoying.

So I decided to use AJAX to refresh the page. The ajax code uses a timed value
of 2000ms and refreshes the page with hopefully a lot less flickering to the user.

The ajax script I have works 100% for a static or CGI generated page and
updates the DIV accordingly.

When I try to update the AJAX div with the very basic HTML page containing
the graph information which works statically, the graph does not appear within
the ajax div. If I place some text before and after the code which creates the
graphs that data appears fine.

Would anyone know why this could be happenning?

The ajax script will only return Foo and Bar on the page and not the graph.

The javascript code I am calling/using with the lg.html page can be found at
http://www.sbmkpm.com/line.html

The basic code for the graph is as follows. (lg.html)
------>
Foo

Expand|Select|Wrap|Line Numbers


Make your static page dynamic as it does not work with static.
Actually the AJAX is not for Static page upload.

Kind regards,
Dmjpro.

Hi,

Thanks for the feedback.

Do you mean, get a pl script or something like that which prints out the same
data as what would appear in the static generated page?

Cheers.


Hi,

Thanks for the feedback.

Do you mean, get a pl script or something like that which prints out the same
data as what would appear in the static generated page?

Cheers.

Yeah! :-)

You tried that and what''s your O/P?

Kind regards,
Dmjpro.


这篇关于Ajax不显示包含带有javascript的html页面的DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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