T3 Community Discussion & Support

Let's build the best free Joomla template framework, together!
  1. Michael Harris
  2. General Discussion
  3. Thursday, November 27 2014, 06:42 AM
  4.  Subscribe via email
I found this interesting SweetAlert in http://lipis.github.io/bootstrap-sweetalert/ gave it a shot with this code:

  
document.querySelector('.sweet-12').onclick = function(){
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "success",
showCancelButton: true,
confirmButtonClass: 'btn-success',
confirmButtonText: 'Success!'
});
};

as i tested it via/Chrome, It has an error which said "Uncaught TypeError: Cannot set property 'onclick' of null". I don't get it....I guess JS is not compatible with T3 or joomla?
References
  1. http://lipis.github.io/bootstrap-sweetalert/
Comment
There are no comments made yet.
Khanh Le Accepted Answer Pending Moderation
0
Votes
Undo
Cause T3 using jQuery, you should make a simple change your code to:



jQuery('.sweet-12').click(function() {
swal ({
...
});
});

Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 1
Michael Harris Accepted Answer Pending Moderation
0
Votes
Undo
Ok, I tried that, it worked, but another error in which said "Uncaught SyntaxError: Unexpected token try"

<button class="btn btn-lg btn-warning sweet-13" onclick="_gaq.push(['_trackEvent', 'example, 'try', 'Warning']);">Warning</button>
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.