倒计时器 - Ajax中的JavaScript无效 [英] count down timer - JavaScript inside Ajax not working

查看:67
本文介绍了倒计时器 - Ajax中的JavaScript无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


i有一个倒数计时器用于正在进行的拍卖。


i得到一个每4秒刷新一次的DIV
DIV由ajax刷新,刷新的文件例如是timer.php !!


我的问题是timer.php没有显示出来。

如果我单独运行timer.php它会显示计时器,问题我认为这是因为计时器位于ajax DIV内部,这就是我认为让我成为问题的!


有什么帮助吗?


thanx:)

解决方案

< blockquote>如果你没有发布你要问的相关代码,真的没办法提出任何建议。


我的问题是从ajax返回的javascript是在php文件里面


javascript是在php中执行的,所以问题是ECHO javascript,即关闭响应!!


这里是代码:

展开 | 选择 | <跨度class =codeLinkonclick =WordWrap(this);> Wrap | 行号


您需要评估JavaScript或将JavaScript代码分别放入调用页的头部。


Hi all!

i got a countdown timer for auctions that runing.

i got a DIV that refreshs every 4 seconds
that DIV is refreshed by ajax ,the file that is refreshed is timer.php for example!!

my problem is that the timer.php is not showing up.
if i run the timer.php alone it is showing the timer ,the problem i think it''s because the timer sits inside the ajax DIV and that is what i think making me the problem!!

any help please?


thanx :)

解决方案

There is really not any way to make any suggestions if you do not post the relevant code you are asking about.


my problem is that the javascript return from ajax is inside php file

the javascript is executed in php so the problem is the ECHO javascript ,that closeing the response!!

here is the code:

Expand|Select|Wrap|Line Numbers


You need to either eval the JavaScript or put the JavaScript code separately into the head of the calling page.


这篇关于倒计时器 - Ajax中的JavaScript无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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