Meta redirect to open in new window

by vjboc
9 replies
Is there a way to auto redirect a link in new window. Either meta refresh or java. What is the html ? Thanks in advance.
#meta #open #redirect #window
  • Profile picture of the author Charles Profit
    Hi ... Simple Javascript

    PHP Code:
    <script type="text/javascript">window.open('http://google.com');</script> 
    I think you may have some issue with popup blocking by most browsers.
    {{ DiscussionBoard.errors[6974155].message }}
    • Profile picture of the author vjboc
      Originally Posted by Charles Profit View Post

      Hi ... Simple Javascript

      PHP Code:
      <script type="text/javascript">window.open('http://google.com');</script> 
      I think you may have some issue with popup blocking by most browsers.
      Thanks Charles. Is there any javascript code that need to be added to make this code work?
      {{ DiscussionBoard.errors[6980979].message }}
      • Profile picture of the author Charles Profit
        Originally Posted by vjboc View Post

        Thanks Charles. Is there any javascript code that need to be added to make this code work?
        Sorry - that is the Javascript (not phpcode --- I used the wrong bbcode). It will work on an html page as well as a php page.

        But as I mentioned earlier, and as andy789 said, new browsers will block the popup.
        {{ DiscussionBoard.errors[6981766].message }}
  • Profile picture of the author andy789
    bad idea ... new browser will automatically block it.
    {{ DiscussionBoard.errors[6981730].message }}
  • Profile picture of the author vjboc
    Is there a meta redirect that lets you redirect to more than one url?
    {{ DiscussionBoard.errors[6982709].message }}
    • Profile picture of the author mesmsgs
      Originally Posted by vjboc View Post

      Is there a meta redirect that lets you redirect to more than one url?
      No, impossible !
      {{ DiscussionBoard.errors[7075770].message }}
  • Profile picture of the author gowthamgutha
    <meta http-equiv="refresh" content="0;url=NEW PAGE URL" />

    Example: <meta http-equiv="refresh" content="0;url=java-demos.blogspot.com" />
    {{ DiscussionBoard.errors[7257152].message }}
  • Profile picture of the author gowthamgutha
    In Java if using Servlets,

    response.sendRedirect("url");

    Example: response.sendRedirect("java-demos.blogspot.com");

    Don't forget the protocol
    {{ DiscussionBoard.errors[7257159].message }}
  • Profile picture of the author ashok999333
    Use the following hybrid :

    <meta http-equiv="refresh" content="5; URL=javascript:window.open('URL to redirect','_parent');">
    {{ DiscussionBoard.errors[7259368].message }}

Trending Topics