Advertisement
furas

SVG - reload page after 3 seconds

Nov 1st, 2016
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.97 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2.  
  3. <svg
  4.    xmlns:dc="http://purl.org/dc/elements/1.1/"
  5.    xmlns:cc="http://creativecommons.org/ns#"
  6.    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  7.    xmlns:svg="http://www.w3.org/2000/svg"
  8.    xmlns="http://www.w3.org/2000/svg"
  9.    version="1.0"
  10.    onload="init(evt)"> // <-- start function after load
  11.    
  12. // http://apike.ca/prog_svg_jsanim.html
  13. // http://www.w3schools.com/jsref/met_loc_reload.asp
  14. // http://stackoverflow.com/questions/5294842/refresh-a-page-using-javascript-or-html
  15.  
  16. <circle cx="50%" cy="25%" r="40" fill="green"/>
  17.  
  18. <script type="text/ecmascript"><![CDATA[
  19. function init(evt){
  20.    setTimeout(function(){ // <-- timer start function with delay
  21.        location.href='http://www.onet.pl'; // <-- load new page
  22.        //location.reload(1); // <-- reload current page. `1` means "load from server instead of cache"
  23.    }, 3000); // <-- delay 3000ms = 3s
  24. }
  25. ]]></script>
  26.  
  27. </svg>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement