Advertisement
Guest User

Untitled

a guest
Dec 15th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. var script = document.createElement('script');
  2.  
  3. script.type = 'text/javascript';
  4.  
  5. var jq_ready = function () {
  6.  
  7. script.src = 'http://pvaske.playground.legitdesigns.com/wp/wp-content/plugins/Aidee-Bidder/assets/js/form.js';
  8.  
  9. add_script(script);
  10.  
  11. };
  12.  
  13. function add_script(script) {
  14.  
  15. var head = document.getElementsByTagName('head')[0];
  16.  
  17. head.appendChild(script);
  18.  
  19. }
  20.  
  21. function loadJquery() {
  22.  
  23. if (typeof jQuery=='undefined') {
  24.  
  25. console.log('no');
  26.  
  27. script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js';
  28.  
  29. script.onload = loadJqueryUi;
  30.  
  31. add_script(script);
  32.  
  33. } else {
  34.  
  35. console.log('yes');
  36.  
  37. loadJqueryUi();
  38.  
  39. }
  40.  
  41. }
  42.  
  43. function loadJqueryUi () {
  44.  
  45. if (typeof jQuery.ui == 'undefined') {
  46.  
  47. script.src = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js';
  48.  
  49. console.log('no2');
  50.  
  51. script.onload = jq_ready();
  52.  
  53. add_script(script);
  54.  
  55. } else {
  56.  
  57. console.log('yes2');
  58.  
  59. jq_ready();
  60.  
  61. }
  62.  
  63. }
  64.  
  65. loadJquery();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement