Permalink
Browse files

strict mode impact on calling 'this' inside function.

  • Loading branch information...
1 parent d6104ac commit fca0f8c13345a3c030cfa2a70a1b90463e20a682 @yukinying committed Nov 7, 2012
Showing with 19 additions and 0 deletions.
  1. 0 examples/html/favicon.ico
  2. +19 −0 examples/html/global.html
No changes.
@@ -0,0 +1,19 @@
+<html>
+
+<div id='test'>
+<script>
+
+console.log(this);
+(function(){
+
+ console.log('call global variable directly');
+ console.log(window.addEventListener);
+
+ var j = this;
+ console.log('call this and in hope that it is the global variable');
+ console.log(this.addEventListener);
+
+})();
+</script>
+</div>
+</html>

0 comments on commit fca0f8c

Please sign in to comment.