I am doing
$.ajax({
type: "GET",
url: url, //valid url..The ajax part works fine
dataType: 'html',
success: function(response) {
if (loginStatus !== 'false') {
testFunction(response); //assuming there is a function called testFunction
}
}
});
The response is a mixed content of html and it also contains
<script>var loginStatus = 'false'</script>
if(loginStatus !== 'false') does not work in the success. What am I doing wrong?
The response looks like this
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
This is a test page
<script>var loginStatus = 'false'</script>
</body>
</html>
loginStatus !== 'false'it means false !== false` ? it will never do your condition