Permalink
Browse files

ADSAFE.has

  • Loading branch information...
1 parent c63d075 commit 0df8afdedea2533ed71d506a4d8359d92242fc59 @douglascrockford committed Mar 1, 2011
Showing with 14 additions and 2 deletions.
  1. +9 −2 adsafe.js
  2. +5 −0 index.html
View
@@ -1,5 +1,5 @@
// adsafe.js
-// 2011-02-06
+// 2011-02-28
// Public Domain.
@@ -42,7 +42,7 @@
getMark, getMarks, getName, getNames, getOffsetHeight, getOffsetHeights,
getOffsetWidth, getOffsetWidths, getParent, getSelection, getStyle,
getStyles, getTagName, getTagNames, getTitle, getTitles, getValue,
- getValues, go, h1, h2, h3, h4, h5, h6, hasOwnProperty, hr, i, id, img,
+ getValues, go, h1, h2, h3, h4, h5, h6, has, hasOwnProperty, hr, i, id, img,
inRange, indexOf, input, ins, insertBefore, isArray, kbd, key, keyCode,
klass, label, later, legend, length, li, lib, log, map, mark, menu,
message, name, nextSibling, nodeName, nodeValue, object, off,
@@ -1761,6 +1761,13 @@ var ADSAFE = (function () {
adsafe_lib = null;
},
+// ADSAFE.has returns true if the object contains an own property with the
+// given name.
+
+ has: function (object, name) {
+ return owns(object, name);
+ },
+
// ADSAFE.id allows a guest widget to indicate that it wants to load
// ADsafe approved libraries.
View
@@ -161,6 +161,11 @@ <h1>The <code>ADSAFE</code> Object</h1>
<td>Start the <a href="widget.html">widget</a>. The <var>id</var>
string must match the <code>id</code> of the widget's <code>div</code>.</td>
</tr>
+ <tr>
+ <td valign="top"><code>has(</code><var>object</var><code>,</code>
+ <var>name</var><code>)</code></td>
+ <td><code>true</code> if the <var>object</var> has an own proerty with that <var>name</var>.</td>
+ </tr>
<tr>
<td valign="top"><code>id(</code><var>id</var><code>)</code></td>
<td>Identify the <a href="widget.html">widget</a>. The <var>id</var>

0 comments on commit 0df8afd

Please sign in to comment.