Store domain in local storage and call it in href - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Anchor

Description

Store domain in local storage and call it in href

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> 
      <title>Ripping Status</title> 
      <script type="text/javascript">
    domain = localStorage['domain'] || '';
    function init() {/*ww w.j  a  v a 2  s  .  co m*/
      window.location=domain+'/';
      document.getElementById( 'box' );
    };
  
      </script> 
   </head> 
   <body onload="init();"> 
      <div id="box"></div>  
   </body>
</html>

Related Tutorials