jquery.mockjax.js 615 B

123456789101112131415161718192021222324252627
  1. (function() {
  2. var parts = document.location.search.slice( 1 ).split( "&" ),
  3. length = parts.length,
  4. scripts = document.getElementsByTagName("script"),
  5. src = scripts[ scripts.length - 1].src,
  6. i = 0,
  7. current,
  8. version = "2.2.1",
  9. file = "../lib/jquery.mockjax-2.2.1.js";
  10. for ( ; i < length; i++ ) {
  11. current = parts[ i ].split( "=" );
  12. if ( current[ 0 ] === "jquery.mockjax" ) {
  13. version = current[ 1 ];
  14. break;
  15. }
  16. }
  17. if (version != "git" || version < "3") {
  18. file = src.replace(/jquery.mockjax\.js$/, "jquery.mockjax-" + version + ".js");
  19. }
  20. document.write( "<script src='" + file + "'></script>" );
  21. })();