[prev] [thread] [next] [lurker] [Date index for 2005/04/10]
Last word on all this Javascript crap. Sean Burke came up with something interesting, the upshot being that you write this in your HTML... <script type="text/javascript" src="js/bootstrap.js"></script> <script type="text/javascript" src="js/hello.js"></script> And then you can use bootstrap() inside your code. # hello.js bootstrap("js/greeter.js"); function sayhello () { greet(); } # greeter.js function greet () { alert("Hello world!"); return; } You can poke at it here. http://interglacial.com/temp/Bootstrapping/ Here's what Sean said on IRC while puting it together. Apr 08 21:31:17 <TorgoX> also, if I didn't have to care about error handl ing or gracefully dealing with shitty old browsers, I could make this a one-line r. But as it is, it's about 25 lines or something... Apr 08 21:32:21 <TorgoX> I did have some clever idea about a workaround f or the lack of an @INC -- basically involving a "bundler" program that figures o ut what-all libary functions get used, and does a sultry dance of symlink resolu tion or something. Apr 08 21:47:19 <TorgoX> Schwern -- I think my current modus with JavaScr ipt is that I'm designing semi-general-purpose things, like a bootstrapper that I can live with, without totally making my head explode by trying to catch every case ever. Final hate: JavaScript's been around for TEN YEARS and nobody's figured this out yet??
Generated at 12:00 on 12 Apr 2005 by mariachi 0.52