帮助在div中使用外部JavaScript [英] help using external javascript in div

查看:55
本文介绍了帮助在div中使用外部JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用Yahoo UI在自定义应用程序中创建Panel。我使用ajax从php页面请求html来创建面板。 php页面回显了整个html页面,包括html页面的javascript(这是一个外部文件)的src。然后将返回的html制作成z的索引为6的div来制作面板。此面板具有使用从php页面传回的javascript函数的按钮。按钮/ javascript在Firefox中工作正常,但在IE中根本没有。


有什么想法吗?

Hello, I''m using the Yahoo UI to create a Panel in a custom application. I use ajax to request html from a php page to create the panel. The php page echo''s out the entire html page including the src for javascript (which is an external file) for the html page. The returned html is then made into a div with a z-index of 6 to make the panel. This panel has buttons that use functions from the javascript that was passed back from the php page. The buttons/javascript work fine in Firefox, but not at all in IE.

Any thoughts?

推荐答案

你能否展示一些代码或测试页。
Could you show some code or a test page.


可能是你在脚本中使用document.getElementById()吗?如果你是,IE 6并不支持所有的网络标准,getElementById就是其中之一。


如果是这种情况,使用这个功能可能会有所帮助:
could it be that you''re using document.getElementById() in your scripts? If you are, IE 6 doesn''t support all the web standards, getElementById being one of them.

If that''s the case, using this function could help:
展开 | 选择 | Wrap | 行号


主页上的一个按钮调用Panel()从PANEL.php获取html然后在div中显示在主页上。所有的HTML显示都很好,但是javasript在ie中不起作用。在FF工作正常。


// **********函数获取我们需要的html ****
A button on the main page calls Panel() which gets the html from PANEL.php This is then displayed in a div on the main page. all the html shows up fine, but the javasript does not work in ie. Works fine in FF.

//**********function that gets the html that we need ****
展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


这篇关于帮助在div中使用外部JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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