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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 34 - 31 = ?

 
 [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.