SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2. var nextUrlArticle = null;
  3.  
  4. $(document).ready(function() {
  5.     $.get("{{ path('next_video_url', { 'id' : article.id })}}", function(result) {
  6.         nextUrlArticle = result.url;
  7.     });
  8.  
  9.     function getNextVideo(ext) {
  10.         if (nextUrlArticle) {
  11.             window.location.href = nextUrlArticle;
  12.         }
  13.     }
  14. });
  15. </script>
  16.    
  17. $(document).ready(function() {
  18.     $.get("{{ path('next_video_url', { 'id' : article.id })}}", function(result) {
  19.         nextUrlArticle = result.url;
  20.         getNextVideo(); // call function after update
  21.     });
  22.  
  23.     function getNextVideo() {
  24.         if (nextUrlArticle) {
  25.             window.location.href = nextUrlArticle;
  26.         }
  27.     }
  28. });
  29.    
  30. nextUrlArticle = {{ nexturl }} //django syntax to pass context vars to template
  31. function getNextVideo() {
  32.     if (nextUrlArticle) {
  33.         window.location.href = nextUrlArticle;
  34.     }
  35.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top