|
Check-in Number:
|
29 | |
| Date: |
2007-Apr-12 21:00:35 (local)
2007-Apr-12 19:00:35 (UTC) |
| User: | rse |
| Branch: | |
| Comment: |
do not clutter global namespace with variables
|
| Tickets: |
|
| Inspections: |
|
| Files: |
|
Modified: jquery/jquery.xsajax.test1.js
===================================================================
--- jquery/jquery.xsajax.test1.js 2007-04-12 16:56:15 UTC (rev 28)
+++ jquery/jquery.xsajax.test1.js 2007-04-12 19:00:35 UTC (rev 29)
@@ -1,8 +1,10 @@
/* just produce some distinguishable output */
-$('span#output1').html("script #1 loaded");
-var i = 7;
-setInterval(function () {
- $('span#output1').html("i=" + i++);
-}, 1000);
+(function(){
+ $('span#output1').html("script #1 loaded");
+ var i = 7;
+ setInterval(function () {
+ $('span#output1').html("i=" + i++);
+ }, 1000);
+})();
Modified: jquery/jquery.xsajax.test2.js
===================================================================
--- jquery/jquery.xsajax.test2.js 2007-04-12 16:56:15 UTC (rev 28)
+++ jquery/jquery.xsajax.test2.js 2007-04-12 19:00:35 UTC (rev 29)
@@ -1,8 +1,10 @@
/* just produce some distinguishable output */
-$('span#output2').html("script #2 loaded");
-var j = 42;
-setInterval(function () {
- $('span#output2').html("j=" + j++);
-}, 1000);
+(function(){
+ $('span#output2').html("script #2 loaded");
+ var j = 42;
+ setInterval(function () {
+ $('span#output2').html("j=" + j++);
+ }, 1000);
+})();