SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,154
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post jquery success with window location

    Hi, can i ask about my code is it okay to put inside the success with window.location

    like this

    Code:
     $.ajax{(
       type: 'post',
       url: 'somelink.php',
       success: function(db){
          window.location.href="toanotherpage.php";
      }
    
    
    });

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2011
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi jemz,

    I don't see any problem in that...just check that it gets redirected to the php page or not, else give the entire path i mean with the domain name first and then the page name [window.location.href="http://www.yourdomainname.com/toanotherpage.php"].

  3. #3
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,154
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    yes, i tried it and it's working.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •