Jump to content
Killersites Community
Sign in to follow this  
activeworker

Some Definitions Of Javascript

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×