Live data from Hacker News

Show HN: Pen.io

pen.io

101–102 of 102 posts

Re: Show HN: Pen.io

#101
post #38

Earlier quoted context omitted.

I am on FFox 4 beta 11 on WinXP and I tried it with IE7 also. I get this on both: http://imgur.com/q0PfT

You may not have correct fonts installed. I get this on Fx nightlies: http://imgur.com/w6s0t

I use Devanagari script extensively and have never faced the problem on other sites (FB, GMail etc). I changed the default encoding to UTF-8 but no avail.

Can you pls tell me what I doing wrong?

Re: Show HN: Pen.io

#102

Earlier quoted context omitted.

You shouldn't have to depend on CDNs as there's no guarantee they'll be up all of the time. I usualayy have a local fallback that can be triggered in this way: !window.jQuery && document.write(unescape('%3Cscript src="/js/jquery-1.4.2.min.js"%3E%3C/script%3E')) The second script looks for the jQuery global object that should exist after the CDN fetch. If it doesn't exist, it knows to get your own copy. (If you're won…

Have you tested that to make sure that it blocks on the first script tag in every browser? Over the internet (as opposed to on your dev box), I'd expect that to always evaluate to false and therefore include your local script. You might want to look into putting that call into window.onload so that it does what you think it does.

The point made (below) by @dspillet is correct, and important for one very good reason:

You will almost definitely have scripts that you have included after these two that depend on the jQuery object existing (otherwise what's the point in having jQuery at all). So imagine this trick wasn't used, and you just served up a local (or CDN hosted) copy of jQuery, then started using it in later scripts. It's reasonable at that point to assume that jQuery exists - which is because each script blocks, or if it doesn't, the browser itself will still make sure they execute in order. So it's perfectly safe to use this script without worrying about the order of things.

This is exactly why I (and many others) suggest that you put all of your tags at the bottom of the element. They block page rendering, so if they're in the , or dotted around the , they're going to delay the presentation of the page to the visitor.

Post reply on HN