activeworker Posted April 10, 2013 Report Share Posted April 10, 2013 Hi everybody! I am a new member of your community. I hope your suggestion will help me a lot. So, please see the following things and response: What is string? What is parameter? What is parentheses () ? Please see the following codes: <html> <head> <script type="text/javascript"> function show_prompt() { var name=prompt("Please enter your name","Harry Potter"); if (name!=null && name!="") { document.write("Hello " + name + "! How are you today?"); } } </script> </head> <body> <input type="button" onClick="show_prompt()" value="Show a prompt box" /> </body> </html> name!=null && name!="" is included here. Here what is the meaning of null? Here what is the meaning of “”? Thank you. Quote Link to comment Share on other sites More sharing options...
Edscript Posted April 13, 2013 Report Share Posted April 13, 2013 Activeworker dude; I am kind of new too, and the script you are questioning is a basic javascript to check to see if a person has submitted their name like in some kind of form box before being able to continue. And to cue you in to professional computer nerd terms (you either have to pick up some code books or do some of the video classes at killersites; they can be a little fun) a string is a bunch of chactors (like on your key board) strung together; usually letters and numbers. Any word or sentence is a string in the nerd world. I never heard of a parameter in the computer world, but I think you are referring to what nerds call a scope, which is usually in reference to variables that are available to a certain function. But if you are referring to what is between curly brackets that is the code that gets exicuted if conditions are met to fire off a function. When you see " () " parenthesis that signifies a function, and between the parentheses are the arguments that need to be satisfied before the code is exicuted in the curly brackets. I have to tell you that I also am not quite a professional nerd yet (but am working on it) but; I think null is when there is nothing (no string) and double quotes with a blank space represent blank space, and I think a space can be a part of a string. So the javascript code is attempting to say if the text field is not null (totally empty) and does not have a blank space (like maybe between two words) then say "hello...." Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.