Who is online?  80 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

Topic RSS Feed

Posts under the topic: Redirect to other URL with jQuery

Posted: 3/28/2010 1:11:50 PM

Lurker 230  points  Lurker
  • Joined on: 10/16/2009 1:00:00 PM
  • Posts: 46

Hi,

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


jQuery

Posted: 4/5/2010 12:58:35 PM

Starter 710  points  Starter
  • Joined on: 11/11/2009 9:12:32 AM
  • Posts: 34
answered  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 10:48:16 PM

Professional 10058  points  Professional
  • Joined on: 4/19/2009 1:46:52 AM
  • Posts: 238
answered  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>


jQuery
Page 1 of 1 (3 items)