Reputation: 1079
I have tried to use .htaccess but my rewriting work fine but note ajax codes there just froze not doing any thin is this because rewriting?
MY .Htaccess Code
#Turn Rewriter on
RewriteEngine on
RewriteRule ^testthis test/test.php [Nc,L]
My Php Code
<!DOCTYPE html>
<html>
<head>
<title>THaalinda</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
Testing
<script src='testthis/content/test.js' type="text/javascript">
</script>
</body>
</html>
My Jquery Separate file
$(document).ready(function(){
alert('Thaalinda');
})
in here test.js located at (./content/test.js/) before re-Writing it's working perfectly after that it's not working at all
Upvotes: 0
Views: 330
Reputation: 5672
You need to use absolute path in your url of ajax instead of relative path. Change this var link = "./content/php/updatequantity.php?quan="+value+"&id="+updateId; to var link = "/content/php/updatequantity.php?quan="+value+"&id="+updateId;
Upvotes: 1