SUKOHI / Surpass

A PHP package mainly developed for Laravel to manage uploading images using Ajax and displaying thumbnail.
29 stars 8 forks source link

jQuery Dependency #3

Closed coxw closed 9 years ago

coxw commented 9 years ago

Right now, the jQuery dependency requires that jQuery is loaded before this is called. You need to consider a deferred loaded to be more compatible with other sites. A lot of sites will load all javascript(and jQuery) files at the end of the page for performance. This package spits out $(document) calls before $ is defined in most cases.

Here is a good example of how to do a deferred loader: http://stackoverflow.com/questions/8298430/handling-code-which-relies-on-jquery-before-jquery-is-loaded

It's still ugly, and should have a max wait time set (like 5 seconds) to prevent memory hogging, but should fix this one. What do you think?

SUKOHI commented 9 years ago

Hi, coxw. Thank you for your advice. Unfortunately, I don't have time to improve the package because I'm so busy now.:( I'll check it sometime in the future for sure.

SUKOHI commented 9 years ago

Hi, coxw. This package is suppose to be use with @section('script')~@stop and @yield('script') as I changed readme.md.

However, your tip might be more useful for this package. I'll consier it. Thank you!