0

On button click ajax function for redirecting the page.

   $.ajax({
                   type: "POST",
                   url: "logindata.php",
                   data: {request:uname,request1:upass},
                   success: function(){ 
},
complete: function(response)
    {
if((response.responseText)=="Done"){
window.location.assign('enter.php');
}

  $("#status").html("<font color='red'>"+response.responseText+"</font>");

 }

my php code logindata.php

echo "Done";

I AM getting output Done but can't redirect the page

user3829658
  • 159
  • 2
  • 7
  • 18

2 Answers2

0

I think the problem is in window.location.assign('enter.php'). You have to show the path correctly.

DAKZH
  • 243
  • 2
  • 12
0

Have you tried window.location.href = "enter.php" in place of window.location.assign('enter.php'); ?

nexuscreator
  • 835
  • 1
  • 9
  • 17