Permalink
Browse files

don't overwrite global $ if jQuery is undefined

  • Loading branch information...
1 parent a8f5d68 commit a34de9722d57477cccf98806d8a0aff2b25815fb @daepark committed Jan 6, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 postmessage.js
View
@@ -21,14 +21,15 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
**/
+var NO_JQUERY = {};
(function(window, $, undefined) {
if (!("console" in window)) {
var c = window.console = {};
c.log = c.warn = c.error = c.debug = function(){};
}
- if (!$) {
+ if ($ === NO_JQUERY) {
// jQuery is optional
$ = {
fn: {},
@@ -405,7 +406,7 @@
}
});
- })(this, typeof jQuery === "undefined" ? null : jQuery);
+ })(this, typeof jQuery === "undefined" ? NO_JQUERY : jQuery);
/**
* http://www.JSON.org/json2.js

0 comments on commit a34de97

Please sign in to comment.