Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.8

Bug #11542 any javascript variable named "i" becomes corrupted by html_ajax call
Submitted: 2007-07-06 12:56 UTC
From: nicklewis Assigned: davidc
Status: Closed Package: HTML_AJAX (version 0.5.2)
PHP Version: 5.2.2 OS: Linux
Roadmaps: 0.5.3    
Subscription  


 [2007-07-06 12:56 UTC] nicklewis (Nick Lewis)
Description: ------------ This bug was introduced between 0.5.0 and 0.5.2 (0.5.1 not tried) It appears to break any pages that use the variable i in their javascipt. Please see test script below If I were to guess it would be that the problem may be in a conjunction of var i and 'X-Ajax-Engine' found in this bit for (i in this.request.customHeaders) { this.xmlhttp.setRequestHeader(i, this.request.customHeaders[i]); } however I am a javascript newbie so don't really understand it in any detail. Test script: --------------- var i = 0; result = HTML_AJAX.grab(example.php); alert (i); Expected result: ---------------- I would expect the alert box to show "0" Actual result: -------------- The alert box shows "X-Ajax-Engine"

Comments

 [2007-07-06 18:11 UTC] jeichorn (Joshua Eichorn)
This should be for(var in this.request.customHeaders)
 [2007-07-06 18:49 UTC] davidc (David Coallier)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.