Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement