jquery - get javascripts asynchronously using getScripts -


I get some scripts unlimited on my login page

  $ ($. GetScript ("/ scripts / view / scroll-sneak .js"), $ .getScript ("/ scripts / kendo / kendo custom .jj"), $ .dynamic (function (deferred) { $ (Suspended.rolive)) () () () () () () () () () () () ()) ');});   

I have two questions here,

  1. How can I take advantage of the browser cache here, because matching always takes fresh scripts.
  2. How can I promise that this script will be available on all pages of the same domain.

    Welcome to the alternative solution Thank you.

    The answer to your first question is the true set of the cache Jquery also mentioned in a way

      jQuery.cachedScript = function (URL, option) {// type user data type, cache, and url options = $ .extend (option | | {}, {datatype: "script", cache: True, url: url}); // $ .ajax () because it is more flexible than $$. Return jatiScript / jqXHR object so that we can make callback return jQuery.ajax (options); }; // Usage $ CachedScript ("ajax / test.js") .done (function (script, textstats) {console.log (textStatus);});   

    For your second question: Please explain more, what do you want to achieve?

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -