JavaScript question related to the use of ' and "

Posted by vatismarty on Stack Overflow See other posts from Stack Overflow or by vatismarty
Published on 2010-06-02T07:28:34Z Indexed on 2010/06/08 8:42 UTC
Read the original article Hit count: 117

Filed under:
my_window.document.write(' 
  <script type="text/javascript"> 
    function redirect(linkid) { 
      opener.location.href=linkid;
      window.close();
    }
  </script>
  <h1>Hello</h1>
  <p>Thank you.If you accidentally closed our website click 
  <a href="javascript:redirect('http://google.com')">here</font></a> 
  to go back to our  website</p>
'); 

This is my piece of code to close a already opened pop up window by redirecting it to google.com. I think there is some problem with matching the apostrophes ' and "... how to code with (' (" (' ') ") ')... is this correct? please help me with this.

Please help me with the necessary changes wherever required.

© Stack Overflow or respective owner

Related posts about JavaScript