git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb.js: Harden setting blamed commit info in incremental blame

From
Stephen Boyd <bebarino@gmail.com>
Date
Dec 7, 2009, 01:04 UTC
Message-ID
<1260147860.1579.47.camel@swboyd-laptop>
In-Reply-To
<200911251536.08993.jnareb@gmail.com>
On Wed, 2009-11-25 at 15:36 +0100, Jakub Narebski wrote:
Show 13 quoted lines
> Well, the one time I was able to run debugger (F12, select 'Script', select
> 'gitweb.js') with error occurring and without IE hanging (for README file)
> it did show an error for the following line:
> 
>   if (xhr.readyState === 3 && xhr.status !== 200) {
> 
> When I checked 'xhr' object, it has "Unknown error" as contents of 
> xhr.statusText field and as contents of xhr.status (sic!), which should
> be a number: HTTP status code.
> 
> Unfortunately I had to take a break... and I was not able to reproduce this
> (without hanging web browser: "program not responding") since then...
> 

Ok. It's December and I've had some more time to look into this. Initializing 'xhr' to null seems to get rid of the "Unknown error" problem (see patch below).

The responsiveness on IE8 is pretty poor. I load the page and then after some waiting (usually 20-30 seconds including IE becoming a "Not Responding" program) the whole page will load. There is nothing incremental about it. I'm trying to figure out why it's slow now.

--->8----
Subject: [PATCH] gitweb.js: workaround IE8 "Unknown error"

Internet Explorer 8 complains about an "Unknown error on line 782, char 2". That line is a reference to xhr and the status code. By initializing xhr to null this error goes away.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 gitweb/gitweb.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.js b/gitweb/gitweb.js
index 2a25b7c..b936635 100644
--- a/gitweb/gitweb.js
+++ b/gitweb/gitweb.js
@@ -126,7 +126,7 @@ function createRequestObject() {
 /* ============================================================ */
 /* utility/helper functions (and variables) */

-var xhr;        // XMLHttpRequest object
+var xhr = null;        // XMLHttpRequest object
 var projectUrl; // partial query + separator ('?' or ';')

 // 'commits' is an associative map. It maps SHA1s to Commit objects.
-- 
1.6.6.rc1.39.g9a42
Previous: Jakub NarebskiNext: Stephen Boyd
Message 34 of 41 in “jn/gitweb-blame fixes”
  1. 0/2 jn/gitweb-blame fixesStephen Boyd, Nov 19, 2009
  2. 1/2 gitweb.js: fix null object exception in initials calculationStephen Boyd, Nov 19, 2009
  3. Jakub NarebskiNov 19, 2009
  4. Stephen BoydNov 19, 2009
  5. 2/2 gitweb.js: use unicode encoding for nbsp instead of html entityStephen Boyd, Nov 19, 2009
  6. Jakub NarebskiNov 19, 2009
  7. Stephen BoydNov 20, 2009
  8. 2/2 gitweb.js: fix padLeftStr() and its usageStephen Boyd, Nov 25, 2009
  9. Jakub NarebskiNov 19, 2009
  10. Stephen BoydNov 20, 2009
  11. Stephen BoydNov 20, 2009
  12. Jakub NarebskiNov 21, 2009
  13. Jakub NarebskiNov 21, 2009
  14. gitweb.js: Harden setting blamed commit info in incremental blameJakub Narebski, Nov 25, 2009
  15. Nanako ShiraishiNov 25, 2009
  16. Jakub NarebskiNov 25, 2009
  17. Stephen BoydNov 25, 2009
  18. Jakub NarebskiNov 25, 2009
  19. Jakub NarebskiNov 25, 2009
  20. Junio C HamanoNov 25, 2009
  21. Jakub NarebskiNov 25, 2009
  22. Junio C HamanoNov 26, 2009
  23. Jakub NarebskiNov 26, 2009
  24. gitweb: Make linking to actions requiring JavaScript a featureJakub Narebski, Nov 26, 2009
  25. Junio C HamanoNov 26, 2009
  26. Jakub NarebskiNov 26, 2009
  27. Junio C HamanoNov 27, 2009
  28. Jakub NarebskiNov 27, 2009
  29. Junio C HamanoNov 27, 2009
  30. Junio C HamanoDec 1, 2009
  31. Jakub NarebskiDec 1, 2009
  32. 1/2 gitweb: Make linking to actions requiring JavaScript a featureJakub Narebski, Dec 1, 2009
  33. 2/2 gitweb: Add link to other blame implementation in blame viewsJakub Narebski, Dec 1, 2009
  34. Stephen BoydDec 7, 2009
  35. Stephen BoydDec 7, 2009
  36. PATCH/RFC] gitweb.js: Workaround for IE8 bugJakub Narebski, Dec 8, 2009
  37. Stephen BoydDec 8, 2009
  38. Jakub NarebskiDec 8, 2009
  39. Jakub NarebskiDec 8, 2009
  40. Stephen BoydDec 9, 2009
  41. Stephen BoydNov 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.