Jump to content


Photo

Some Definitions Of Javascript


  • Please log in to reply
1 reply to this topic

#1 activeworker

activeworker

    Member

  • Member
  • PipPip
  • 15 posts

Posted 10 April 2013 - 05:06 AM

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.
  • 0

#2 Ed4words

Ed4words

    Member

  • Member
  • PipPip
  • 18 posts

Posted 12 April 2013 - 09:18 PM

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...."
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

★★★★★ 5 Star Rated Web Developer Course - check it out now!