Javascript DOM ready without an entire framework
Asked Answered
O

6

18

Does anyone know of a good javascript DOM ready library that I can use without loading an entire framework? I found one on google code that seems to work, but the library was posted in 2008 and I can't find any confirmation on up-to-date cross browser support.

Omidyar answered 28/4, 2010 at 18:30 Comment(3)
have you taken a look at dean.edwards.name/weblog/2006/06/again ? Specifically this comment. Its not plug'n'play ready...but it shouldn't be too hard to set up.Peridium
I'd have to ask why is the only thing - jQuery is 19k zipped, and loaded once, used by millions of people on a daily basis so you know it has to work.Aquamarine
Im with altcognito, look into jQuery is your best betSeptillion
O
0

It seems that the safest bet is indeed to use a javascript framework. I was able to find some small DOMready libraries - but nothing written recently or claiming to be confirmed working with the most current browser releases.

Omidyar answered 30/4, 2010 at 15:15 Comment(0)
V
9

David Mark's "My Library" has a "DOM ready" functionality:

http://www.cinsoft.net/mylib.html

David is avid anti-framework, anti-bad-javascript-practice so it should be good quality code.

Valuable answered 30/4, 2010 at 15:22 Comment(2)
Also his library is completely modular so you can just use the DOM ready part without having to get "everything".Zipangu
The very minimal core + domready extension are 8K uncompressed and unminified.Fricassee
G
2

Just do this right before the closing body tag:

<html>
<script>
function runAfterLoad() {
}
... lots of stuff
</script>
<body>

... lots of stuff

<script>runAfterLoad();</script></body>
</html>
Garaway answered 20/11, 2012 at 5:57 Comment(0)
C
1

Checkout Dean Edwards' base2. It contains a minimal amount of code necessary to patch up browser differences and provide nice consistent interface as per the standards. The gzipped version is only 6k.

Corrie answered 29/4, 2010 at 7:22 Comment(0)
H
1

Use ded's domready

Hydroxylamine answered 8/3, 2012 at 7:5 Comment(0)
O
0

It seems that the safest bet is indeed to use a javascript framework. I was able to find some small DOMready libraries - but nothing written recently or claiming to be confirmed working with the most current browser releases.

Omidyar answered 30/4, 2010 at 15:15 Comment(0)
B
0

please check out this simple function dom ready function

it has been tested in ie 8 , firefox, chrome and safari .

and check this answer javascript domready?

Bader answered 1/12, 2014 at 22:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.