Nate Posted March 21, 2006 Share Posted March 21, 2006 I know Java and Javascript are completely different. In Java you need to use methods to compare strings to return a boolean answer. In javascript do you use some type of other method? or just use "==" in an if statement? I don't know if Strings are objects in this script. I'm new to learning and understanding it. Thank you for your help.Nate Link to comment Share on other sites More sharing options...
spider_designs Posted March 21, 2006 Share Posted March 21, 2006 I know Java and Javascript are completely different. In Java you need to use methods to compare strings to return a boolean answer. In javascript do you use some type of other method? or just use "==" in an if statement? I don't know if Strings are objects in this script. I'm new to learning and understanding it. Thank you for your help.Nate <{POST_SNAPBACK}> == I think:)eg.if ("xxx" == "xx") {alert ('xxx')}if ("xxx" == "xxx") {alert ('xx')}spider Link to comment Share on other sites More sharing options...
scott100 Posted March 21, 2006 Share Posted March 21, 2006 Yes you just use ==like: <head><script type="text/javascript">var test="Hello";if (test=="Hello") alert("hello");else alert("Goodbye");</script></head> Link to comment Share on other sites More sharing options...
Nate Posted March 21, 2006 Author Share Posted March 21, 2006 Thank you for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now