Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Christof Donat
Hi, > function addScript( url, doc ) { > doc = doc || document; > var script = doc.createElement( 'script' ); > script.type = 'text/javascript'; > script.charset = 'utf-8'; > script.src = url; > doc.getElementsByTagName('head')[0].appendChild( sc

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Michael Geary
> From: Michael Geary > > If you're just trying to load a stylesheet dynamically, all > you need to do is this... Just to be clear, I wasn't disparaging jsPax! It just depends on whether you need a full-featured package system or a simple loading function. -Mike _

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread París Prieto , José Ignacio
} } }); })(jQuery); Thanks to all. Jip -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Michael Geary Enviado el: jueves, 28 de diciembre de 2006 17:58 Para: 'jQuery Dis

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Michael Geary
If you're just trying to load a stylesheet dynamically, all you need to do is this: function addSheet( url, doc ) { doc = doc || document; var link = doc.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = url; d

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Christof Donat
Hi, > I'm trying to develope a small piece for dynamic loading in jquery, wich > loads the .js and .css source files on the fly without any special markup > in the html page. For .js files you can use jspax (www.jspax.org). I use it to load jQuery and plugins on demand (actually I made it for th

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread París Prieto , José Ignacio
>> But if you only need to include/require other JS files once at the beginning >> and not in the callback functions for inclusions, then you should be able to >> use my method. That's the case, the callback should be enough for me. I'll try this and keep you informed. Many thanks Jip

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Felix Geisendörfer
Alright, I've been working on this kind of stuff quite intensively a while back. The good news is, all major browsers (ie 6, ff 1.5+, opera 9) can include JS on the fly and trigger a callback function after that is done. In your case you would only need to modify your plugin like this: ---

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Mike Alsup
> For example, in $(document).ready( ... > jQuery.require('jquery.accordion'); > $('#myaccordion').Accordion(); > > jq.getScript(src); > // here it should wait, but how? That won't wait, obviously, because it's an async call. You either need to use synchrnous ajax (like dojo

[jQuery] dynamic plugin loading

2006-12-28 Thread Jip
Hello all, this is my first posting, although I've been watching you for some time :) I'm trying to develope a small piece for dynamic loading in jquery, wich loads the .js and .css source files on the fly without any special markup in the html page. Probably you've seen this before (dojo.require