脚本# - 事件的浏览器兼容性问题 [英] Script# - Browser compatibility issue on events

查看:120
本文介绍了脚本# - 事件的浏览器兼容性问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是Script#和Ajax的新手。

Hi All,
I'm new to Script# and Ajax.

我有一个自定义的HTML网格控件。尝试通过从AJAX'Control'类扩展的类来附加行为。这个类在Script#中被遗忘了。我在网格DOM元素中添加了
onmouseover onmouseout 事件,并为这些事件提供了实现。脚本#为html控件生成了Javascript,即
在IE上工作。但是相同的代码无法使用Mozilla Firefox和Chrome浏览器

I've a custom HTML grid control. Trying to attach behaviour through a class extending from AJAX 'Control' Class. The class is wirtten in Script#. I've added onmouseover and onmouseout events the grid DOM Element and given the implementation to those events. The script# generated the Javascript for the html control and that is working on IE. But the same code is not working on Mozilla firefox and chrome browsers.

用于添加事件的行是,

this.Element.AddEvent(" onmouseover",this.mouseOverEventHandler);

(此AddEvent来自System.DHTML)



此代码生成以下javascript,

this.getElement()。AddEvent(onmouseover",this.mouseOverEventHandler);

this.Element.AddEvent("onmouseover", this.mouseOverEventHandler);
(this AddEvent is from System.DHTML)

This code is generating the following javascript,
this.getElement().AddEvent(onmouseover", this.mouseOverEventHandler);

尝试调试脚本和发现,在firefox上,控件不会超出这个addEvent行,它会转到另一个Microsoft Ajax脚本(我认为是默认的Ajax脚本)。由于未加载事件,因此事件不会被触发。

Tried to debug the script and found that, on firefox, the control is not going beyond this addEvent line, its going to someother Microsoft Ajax script (default Ajax script i think). Since the event is not loaded, the event is not getting fired.

那么,是否有其他方法可以添加事件,这应该适用于所有浏览器?

So, is there any other way of adding events in general, which should work for all browsers?

发现有另一种方法可以从Sys.UI.DOMEvent.AddEvent添加事件,但不确定从Sys.UI AddEvent和System.DHTML.AddEvent添加事件有什么区别。

Found that there is another method to add events from Sys.UI.DOMEvent.AddEvent, but not sure what is the difference between adding events from Sys.UI AddEvent and System.DHTML.AddEvent.

谢谢,

Venkat。

推荐答案

Hi Venkat,

Hi Venkat,

除非您询问Reactive Extensions(Rx),否则您已发布到错误的论坛。

Unless you're asking about Reactive Extensions (Rx), you've posted to the wrong forum.

以下是官方Ajax论坛:

Here's the official Ajax forum:

http://forums.asp .net / 1022.aspx / 1?ASP + NET + AJAX + Ajax + Control + Toolkit

我不确定脚本#是什么,所以你会必须自己找到该论坛。

I'm not sure what Script# is though, so you'll have to find that forum on your own.

- 戴夫


这篇关于脚本# - 事件的浏览器兼容性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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