简体   繁体   中英

Jquery Not working after Re-writing using .htaccess

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

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM