Category: javascript

« Previous Entries

Could the brilliant people at Google please just solve this already?

Ajaxian has the latest article I’ve come across about remote Javascript using document.write() (and a bit of a related issue when it comes to Google Analytics). They a link to yet another way to get around it by hijacking the browser’s document.write(), just as John Resig suggested to me the last time I complained about […]

Another cautionary remote Javascript tale

It sounds like TechCrunch got burnt yesterday by some remote Javascript appearing too high in their pages’ HTML. Visitors’ browsers were waiting and waiting for the remote script to load, and refusing to render the rest of the page until it did.
All we knew is that our sites all simultaneously went down three times yesterday. […]

Remote Javascript with document.write() is killing me

I have been coming across way too much remote Javascript that uses document.write() to insert its contents. From ad providers to video hosting services, it’s common practice to provide a Javascript tag like:
 
<script src="http://some-remote-server.com/some-tiny-file.js" type="text/javscript"></script>
 
and tell the site owner to just include it in their page where the ad or content should appear.
This is […]

Fix for slow-loading Google ads

Google’s AdSense ads, and lots of others, are added to pages using Javascript, and if that Javascript appears early in the page’s HTML, it can seriously slow down the rendering of the rest of the page. That’s because browsers generally refuse to do any further rendering of the page until they have a requested Javascript […]

Triangle Javascript Users Group

My friend Matt Henry and I are going to try to get a Javascript users group started in Durham so we can meet other users (and probably do a bit of jQuery evangelizing). If you’re interested, visit the Triangle Javascript Users Group page, and join us at the Federal in downtown Durham on May 6.

Bye bye YUI bloat

I’ve been doing some serious work this week cutting down on YUI bloat — our site was including the entire YUI library at the top of every page, at a cost of more than 200k. Worse, because the library was included at the top of every page, the rest of the page had to wait […]

Cache regexes in javascript

This post about precompiling and caching regular expressions came across my Google reader just as I was wrangling with a slow regex issue. Not sure my issue will benefit from this, but neat regardless.

Solved: AJAX returns bad results in Internet Explorer

Note to self: IE6 likes to cache AJAX requests, and this can be a bad thing if other data on the page that will affect the result of the request has changed.
You’ll see this if you have two fields on a page that both contribute to a result, but only send them to the […]

Salivating over server-side Javascript

I came across The End of Web Frameworks in my dzone RSS feed this morning, and it echoes a thought that runs through my brain as I get more and more comfortable with jQuery: who needs the server when you’ve got Javascript? Wouldn’t it be great if the server just handed out data, and the […]

Determine the order of two DOM elements

Inspired by this from PHP, I wanted a utility function to determine whether a given element came before or after another element in the DOM.
 
(function($){
$.order = function($a,$b) {
 
$a = $a.eq(0);
$b = $b.eq(0);
var c = ‘order-test’;
 
$a.addClass(c);
 
[…]

« Previous Entries