Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I redirect a page in jQuery?

Tags:

jquery

php

How what data should I echo from the server to ajaxically redirect my page? Say, suppose this my jQuery:

$.ajax({
            type: "POST",
            url : '<?php echo base_url() ?>Admin/AddNotice',
            data: {noticeTitle: $('#title').val(),noticeDesc : $('#desc').val() },
            success: function(msg){
                //here i want to redirect..fill in the blank please.
            }
        });
like image 884
TCM Avatar asked Aug 07 '10 15:08

TCM


People also ask

How do I redirect a particular section of a page using HTML or jQuery?

One can use the anchor tag to redirect to a particular section on the same page. You need to add ” id attribute” to the section you want to show and use the same id in href attribute with “#” in the anchor tag.

How do I redirect a page to another page?

How to Redirect to Another Page in HTML. To redirect one HTML page to another page, you need to add a <meta> tag inside the <head> section of the old HTML page. The <head> section of an HTML document contains metadata that is useful for the browser, but invisible to users viewing the page.


1 Answers

It's pretty easy:

window.location = "http://www.google.com";

;)

like image 96
Andrea Zilio Avatar answered Sep 30 '22 23:09

Andrea Zilio