Showing posts with label prototype. Show all posts
Showing posts with label prototype. Show all posts

Tuesday, February 03, 2009

forcing repaint DOM in IE6 and IE7?

I have loop that makes server-side Ajax calls on each iteration, and returns data. This could be 50 iterations, 500, 5000, whatever. Upon each iteration, I update that particular row with a server-side response (i.e. "success" or "fail"), and then update the total count processed ("26 out of 432 processed"). -- I update the innerHTML of a div or span, and another div showing the total number of records processed (at the end of an iteration, or in the onComplete callback handler of the Ajax.Request). That is all working perfectly fine... in Firefox, Safari, and every other browser except IE6 and IE7.

I have tried IE hacks such as adding a class to the div, and dropping a class from the div, adding and dropping child nodes from the div, etc -- to attempt to force IE to repaint, I have tried waiting a small interval, to no avail. If you pop up an alert("hai"); at the end of the iteration, the the IE6 and IE7 DOM will repaint with the updated values. (btw, how dumb is that?)

Does anybody have any tried and true ways to make IE6 or IE7 repaint a particular DOM element in these cases (without obviously popping an alert)? It works flawlessly in Firefox. I know IE is a steaming pile, but just wondering if anyone has had any success with a hack that works here.

Wednesday, October 22, 2008

Sizzle

Browsers are getting faster (see: Google Chrome, see next release of Firefox) with JIT compliation, improved Javascript VM's, etc... but not only that, developers are getting better at writing codez and finding things in browsers... all of it makes the interwebs better: It's good to keep an eye on what is coming down the pike, as they say:

John Resig (jQuery author)... is working on Sizzle... which will become part of jQuery... check out the performance here:
http://jamesdonaghue.com/static/peppy/profile/slickspeed/#

Here's a link to Sizzle on GitHub: http://github.com/jeresig/sizzle/tree/master

Also, it was bounced around today on the Prototype mailing list that Prototype (traditionally slower than other mainstream libraries when traversing the DOM with CSS Selectors), is mulling over including Sizzle as well. Very nice developments -- check them out.

Wednesday, July 11, 2007

Prototype version 1.5.2_pre0

I notice on Backpack, that the 37signals guys are using a new version of Prototype.js. I haven't had time to check the diffs, but wonder what has been added:

http://asset0.backpackit.com/javascripts/prototype.js?1181176787

Sunday, May 27, 2007

Core Javascript & Ajax Development Links

...some handy references for all of us writing Javascript and Ajax apps (specifically with Prototype.js, but many of the links help writing and testing JS in general) Enjoy:

Core Javascript 1.5 Reference
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference

Javascript Style Guide on Mozilla's Development Center:
http://developer.mozilla.org/en/docs/JavaScript_style_guide

Prototype Javascript Framework API docs:
http://www.prototypejs.org/api

Script.aculo.us Effects Library tag docs:
http://wiki.script.aculo.us/scriptaculous/tags/

Dan Webb's LowPro.js:
http://www.danwebb.net/2006/9/3/low-pro-unobtrusive-scripting-for-prototype

Joe Hewitt's Firebug plugin docs and download:
http://www.getfirebug.com/docs.html

https://addons.mozilla.org/en-US/firefox/addon/1843


Selenium:
http://www.openqa.org/selenium/