aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-12-06 20:00:31 -0800
committerJohn Resig <jeresig@gmail.com>2009-12-06 20:00:31 -0800
commit59802928566b6be3a66d65e77c2418fff37e6f5f (patch)
treef8969622b3c9e7ac61afdf54e37f5610fd188192 /src/data.js
parent7d36ccfa8eb018fcf349e1f74e3a0a614385558f (diff)
downloadjquery-59802928566b6be3a66d65e77c2418fff37e6f5f.tar.gz
jquery-59802928566b6be3a66d65e77c2418fff37e6f5f.zip
Make sure that expando properties aren't set on embed, applet, or object elements. An uncatchable exception is thrown and we must avoid it. Fixes #1675 and #2349.
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/data.js b/src/data.js
index 1d993fe58..44d77a902 100644
--- a/src/data.js
+++ b/src/data.js
@@ -6,7 +6,19 @@ jQuery.extend({
expando:expando,
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
data: function( elem, name, data ) {
+ if ( jQuery.noData[elem.nodeNode.toLowerCase()] ) {
+ return;
+ }
+
elem = elem == window ?
windowData :
elem;
@@ -43,6 +55,10 @@ jQuery.extend({
},
removeData: function( elem, name ) {
+ if ( jQuery.noData[elem.nodeNode.toLowerCase()] ) {
+ return;
+ }
+
elem = elem == window ?
windowData :
elem;