Re: [JSMentors] Onload event is not getting fired for dynamic script loading

2011-12-07 Thread Diego Perini
On Wed, Dec 7, 2011 at 3:02 AM, S.A. game...@gmail.com wrote: Most of what is shown in the example is a scaffolding to have it work in older IEs as well. You are right, to have the code only work on the latest browsers, we don't need all that code. As I have indicated in one of my previous

Re: [JSMentors] Onload event is not getting fired for dynamic script loading

2011-12-07 Thread Mark McDonnell
Is this https://github.com/Integralist/XHRl what you're after? Sent from my iPhone On 7 Dec 2011, at 02:02, S.A. game...@gmail.com wrote: Most of what is shown in the example is a scaffolding to have it work in older IEs as well. You are right, to have the code only work on the latest

Re: [JSMentors] Create full copy of JS object

2011-12-07 Thread Casey Goodhew
Just because you can technically do something doesn't make it a good idea! Have you considered making cloneConfig function on your object that will copy what it needs to, to a config object? You can then feed that config object into a new object constructor. Again, no one is quite sure what

Re: [JSMentors] Onload event is not getting fired for dynamic script loading

2011-12-07 Thread S.A.
It seems that you got the script body through XMLHttpRequest already then doing this? Then you don't have to. Why don't you just create a dynamic script element and assigen the src attribution to it? Yes, Diego's example indicated that and that works in the latest browsers. Any thoughts

Re: [JSMentors] Object Declaration Question

2011-12-07 Thread Peter van der Zee
On Tue, Nov 22, 2011 at 8:32 PM, David Granado davidjgran...@gmail.com wrote: Any insight from the pros would be great. Arian is right. However, Firefox supports something called sharp variables. If you want to play around, that's basically what you want. I don't think it's very useful for ya

Re: [JSMentors] Onload event is not fired for dynamic script insertion

2011-12-07 Thread Peter van der Zee
Even though your script should run synchronous, it might not. The callback might have actually fired before your script got a chance to intercept it. I remember IE could prematurely fire the onload event for an image in primed cache if you set the .src before setting the .onload. Maybe the same is