Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6000189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:39:29+00:00 2026-05-23T00:39:29+00:00

I have this: $(document).ready(function() { $.get(‘getturn.php’, function(data){ if (data!==’4′) { alert (‘ change’); }

  • 0

I have this:

$(document).ready(function() {

$.get('getturn.php', function(data){
    if (data!=='4') { alert ('  change'); }
    if (data=='4') { alert ('no change');}
    });
});

getturn.php echoes 4 if the turn is equal to a session id, and it echoes the turn number if otherwise. The getturn.php does as it should, it echoes 4 or a number like 0,1,2,3; however when I get the data like seen above from a different file, and check if it equals to 4, I can’t get the correct answer… What am I doing wrong? I thought we could check if the output was yes with data==’yes’ ? but we can’t check numbers with data==’4′?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:39:30+00:00Added an answer on May 23, 2026 at 12:39 am

    Have you done an alert(data); to see what is returned?

    I think you should try this slight modification:

    if (data == '4') { alert ('no change');}
                else { alert ('  change'); }
    

    Based on this answer: How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(document).ready(function(){ $(form#fbox).submit(function(){ var msg = $(input#ibox).val(); $.get(foo.php, {m: msg}, function(data){ $('#display').html(data); }); return false;
I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I have this: jQuery(document).ready(function(){ jQuery('a.color2030').click( function() { jQuery('tbody').hide(); jQuery('tbody.color2030').show(); }); jQuery('a.color2031').click( function() { jQuery('tbody').hide();
I have this code, loading XML documents on mouseenter, which works in Firefox: $(document).ready(function()
I have this $(document).ready(function() { //Default Action $(.tab_content).hide(); //Hide all content $(ul.tabs li:first).addClass(active).show(); //Activate
I have this jQuery get request: $.get($(this).attr(href), { searchExpression: schroders }, function (result) {
What's wrong with this function: function() { $.get('/controller/action', function(data) { $('#temporaryPhotos').text(data); } ); return
I have this code here: var infiltrationResult; while(thisOption) { var trNode = document.createElement('tr'); var
I have this code: var $msg = jQuery('<div></div>') .hide() .appendTo(document.body) ; if ($msg.is(:hidden)) {
I am writing an XML document in C#. I have something like this... string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.