Loading ...

Redirect to other URL with jQuery

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  client side web development   » Redirect to other URL with jQuery

Redirect to other URL with jQuery

Posts under the topic: Redirect to other URL with jQuery

Posted: 3/28/2010

Lurker 235  points  Lurker
  • Joined on: 10/16/2009
  • Posts: 47

Hi,

I want to redirect the page on hyperlink click to some other location with jQuery. I need solution for it ?


Posted: 4/5/2010

Starter 710  points  Starter
  • Joined on: 11/11/2009
  • Posts: 34
  Answered

Hi,

var url = "tu-URL-a-direccionar";

$(location).attr('href',url);

http://carlosnuel.com/como-hacer-un-redirect-con-jquery.html

 

good luck

 


Posted: 4/19/2010

Guru 16813  points  Guru
  • Joined on: 4/19/2009
  • Posts: 490
  Answered

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
</head>
<body>
    <input id="btnTest" type="button" value="Test" />
</body>
<script type="text/javascript">
    $('#btnTest').click(function ()
    {
        $(window.location).attr('href', 'http://www.google.com');

    });
</script>
</html>


Page 1 of 1 (3 items)