Just starting out? Need help? Post your questions and find answers here.
skinkairewalker
 
Posts: 42
Joined: Tue Jun 14, 2016 7:17 pm

how can i link a CDN JS to my project ?

by skinkairewalker Sat Mar 24, 2018 6:22 pm

hi everyone !
i am trying link this CDN Js on my projeto but dont works : //cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/alertify.min.js



someone can help me ?

js library website = http://alertifyjs.com/guide.html
User avatar
Peter
 
Posts: 533
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: how can i link a CDN JS to my project ?

by Peter Sat Mar 24, 2018 6:45 pm

Code: Select all
EnableExplicit

Procedure InitAlertify(Callback)
 
  ; <!-- CSS -->
  ; <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/alertify.min.css"/>
  ; <!-- Default theme -->
  ; <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/default.min.css"/>
  ; <!-- Semantic UI theme -->
  ; <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/semantic.min.css"/>
  ; <!-- Bootstrap theme -->
  ; <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/bootstrap.min.css"/>
 
  ! $('<link rel="stylesheet" type="text/css">').attr('href','https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/alertify.min.css').appendTo('head');
  ! $('<link rel="stylesheet" type="text/css">').attr('href','https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/bootstrap.min.css').appendTo('head');
 
  ; <!-- JavaScript -->
  ; <script src="//cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/alertify.min.js"></script> 
 
  ! require(["https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/alertify.min.js"], function(a) {
  !      window.alertify = a;
  !     v_callback();
  ! });   
 
EndProcedure 

Procedure AlertifyAlert(AlertTitle.s, AlertMessage.s)
  ! alertify.alert(v_alerttitle, v_alertmessage);
EndProcedure

Procedure Main()
 
  AlertifyAlert("Alertify running in SpiderBasic", "Ready!")
 
EndProcedure

InitAlertify(@Main())


Greetings ... Peter
munfraid
 
Posts: 11
Joined: Sat Mar 24, 2018 1:33 pm

Re: how can i link a CDN JS to my project ?

by munfraid Sat Mar 24, 2018 7:35 pm

Thanks Peter, your contributions here are invaluable!
skinkairewalker
 
Posts: 42
Joined: Tue Jun 14, 2016 7:17 pm

Re: how can i link a CDN JS to my project ?

by skinkairewalker Sat Mar 24, 2018 7:47 pm

thsnks you very much Peter <3
User avatar
Peter
 
Posts: 533
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: how can i link a CDN JS to my project ?

by Peter Sat Mar 24, 2018 11:24 pm

you're welcome. :)
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 2 guests