If statement doesn't work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Kurzner
    New Member
    • Sep 2011
    • 2

    If statement doesn't work

    Code:
    var showMessageResponse = function (oXML) { 
        
        // get the response text, into a variable
        var response = oXML.responseText;
    
        // update the Div to show the result from the server
    	document.getElementById("responseDiv").innerHTML = response;
    	if 1==1 {
          document.form1.Email.style.backgroundColor="#FF9F9F";
    	};
    };
    In the above example if I remove the If statement the function does work and the responseDiv element is updated. Even though the if statment eveaulates to true, nothing gets updated with the if statment in there? It seems so simple?
    Last edited by Niheel; Sep 20 '11, 10:35 PM.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code.

    That's because if syntax is
    Code:
    if (1==1) {
       document.write("Hello World");
    }

    Comment

    • Jeff Kurzner
      New Member
      • Sep 2011
      • 2

      #3
      Sorry, the cut and paste was not working properly. Will try to repost

      Comment

      Working...