Google.Maps.Event 设置 - Va 与 Xa [英] Google.Maps.Event settings - Va versus Xa

查看:23
本文介绍了Google.Maps.Event 设置 - Va 与 Xa的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个事件侦听器,它引用 Firefox 的 relatedTarget 变量或 Chrome 和 IE 的 toElement 变量.但是自从我制作了那部分代码后,父变量就发生了变化.为什么?

I am using an Event Listener that refer to the relatedTarget variable for Firefox or the toElement variable for Chrome and IE. But since I made that part of the code the parent variable changed. Why?

例如,在今天之前我需要使用 evt.Va.toElement 来引用 toElement 变量,但从今天早上开始我需要使用 evt.Xa.toElement.为什么会变?

For example, before today I needed to use evt.Va.toElement to refer to the toElement variable but since this morning I need to use evt.Xa.toElement. Why did it change?

google.maps.event.addListener(polygon,"mouseout",function(evt){ // Mouseout
  if(evt.Xa.toElement){ // For Chrome and IE
    if(evt.Xa.toElement.id != "idName"){
     // Do something
    }
  } else {
    // Do something else
  }
}

有没有办法使用 toElementrelatedTarget 并确保它始终有效?

Is there a way to use toElement or relatedTarget and be certain that it will always work?

推荐答案

evt.Xa 是一个未记录的属性,不应该用于任何事情,它可能随着 API 的任何版本而改变(闭包编译器重新分配未记录的属性)每个版本的属性).只有记录的属性可以安全地用于生产代码.

evt.Xa is an undocumented property, and shouldn't be used for anything, it could change with any release of the API (the closure compiler reassigns the undocumented properties with each release). Only documented properties are safe to use in production code.

这篇关于Google.Maps.Event 设置 - Va 与 Xa的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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