Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can someone explain to me why my function is still undefined even if I loaded it already with 'load' and callback has fired? #195

Closed
rodoabad opened this issue Nov 9, 2013 · 11 comments

Comments

@rodoabad
Copy link

rodoabad commented Nov 9, 2013

Assuming there's no error on my JS file. Why is it that my function is still undefined?

Doesn't 'callback' happen because the script has been loaded? Or am I completely misunderstanding the meaning of 'callback' and 'complete'. Thanks.

@hugofelp
Copy link

Can you please provide more details on your issue? Also, could you please have a look at this fix and let me know if it works for you? - #196

@rodoabad
Copy link
Author

I'll let you know tomorrow at work and yes this is exactly the same issue that I'm having since IE loads and executes scripts immediately.

@rodoabad
Copy link
Author

Update: Still gives the undefined errors on scripts that are loaded and then executed immediately.

@hugofelp
Copy link

Silly question... you didn't use the minified file, did you? I applied changes only to the source - https://github.com/hugofelp/yepnope.js/blob/a9f4518bf8b4faebd1b893e8af6c485ec4e5af01/yepnope.js

@rodoabad
Copy link
Author

Yep, that's what I used.

@rodoabad
Copy link
Author

You can take a look at my dev site.

http://www.eabad-dev.townnews365.com/

  • Works flawlessly on modern browsers except IE (even with your fix).

@hugofelp
Copy link

It actually works fine on IE here. IE9 doesn't throw any error, and IE8 complains about a chain of methods with a null value in the middle - "'exec(...)' is null or not an object"
But nothing related to yepnope... 10 out of 10 it hit the callback after the loaded file had been parsed (I was looking at the lazyload bit).

@rodoabad
Copy link
Author

Hmm, I also used our IE9 testing environment and I was able to reproduce the undefined function. This is so weird. Do you have a another test case? This is the only test case I can constantly reproduce the error.

@hugofelp
Copy link

Well, this is my case - http://trustpower.co.nz/for-your-home/plans-and-pricing
It breaks on my IE8. I will be pushing the fix to live later on today, let's see how it behaves...

@rodoabad
Copy link
Author

That site works for me (IE10/IE11). That's a very cool side menu. What plugin are you using for that one?

@ultimatedelman
Copy link

FWIW - I am also having this issue. Every once in a while, the complete function will fire before the file is either loaded or executed, causing inexplicable errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants