if else used in javascript questions about limitations

F

Frank H. Shaw

In JavaScript

if (expression) {
statements if express is true
} else {
statements if express is false
}

The question is if the if else will not support only one line in the the {
will let more then one line if i use braces is this correct and can the
statements be in HTML unstead of javascript.

I THANK YOU ALL FOR MY TREADS I HAVE BEEN POSTING AND EVERY ONE HAS BEEN
MOST HELPFUL.
 
J

Jens Peter Karlsen[FP MVP]

Yes, only one statement is supported without curly braces.
And no html is not a programming language.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
F

Frank H. Shaw

I was told that you can intermix javascript and HTML I know HTML is a markup
and not a programing language - the question was how can HTML be intermix
which would be in the curly braces just put the HTML markup there or do I
have to surond with any tags ti indactae its HTML markup inside the curly
braces.

Jens Peter Karlsen said:
Yes, only one statement is supported without curly braces.
And no html is not a programming language.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: Frank H. Shaw [mailto:[email protected]]
Posted At: 23. maj 2005 22:00
Posted To: microsoft.public.frontpage.programming
Conversation: if else used in javascript questions about limitations
Subject: if else used in javascript questions about limitations


In JavaScript

if (expression) {
statements if express is true
} else {
statements if express is false
}

The question is if the if else will not support only one line
in the the { will let more then one line if i use braces is
this correct and can the statements be in HTML unstead of javascript.

I THANK YOU ALL FOR MY TREADS I HAVE BEEN POSTING AND EVERY
ONE HAS BEEN MOST HELPFUL
 
J

Jens Peter Karlsen[FP MVP]

Yes, you can mix to a certain extent. Forinstance by having an onclick
event tied to say an image or a link but you can't have html in a
javascript function. You can also use a JavaScript to write text to a
page using document.write(text to write) including html tags.
The tutorial I pointed you to will quickly learn you the basics of
Javascript so you know what is possible and how to write simple
javascripts.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: Frank H. Shaw [mailto:[email protected]]
Posted At: 24. maj 2005 16:44
Posted To: microsoft.public.frontpage.programming
Conversation: if else used in javascript questions about limitations
Subject: Re: if else used in javascript questions about limitations


I was told that you can intermix javascript and HTML I know
HTML is a markup and not a programing language - the question
was how can HTML be intermix which would be in the curly
braces just put the HTML markup there or do I have to surond
with any tags ti indactae its HTML markup inside the curly braces.

Jens Peter Karlsen said:
Yes, only one statement is supported without curly braces.
And no html is not a programming language.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: Frank H. Shaw [mailto:[email protected]]
Posted At: 23. maj 2005 22:00
Posted To: microsoft.public.frontpage.programming
Conversation: if else used in javascript questions about limitations
Subject: if else used in javascript questions about limitations


In JavaScript

if (expression) {
statements if express is true
} else {
statements if express is false
}

The question is if the if else will not support only one line in the
the { will let more then one line if i use braces is this correct
and can the statements be in HTML unstead of javascript.

I THANK YOU ALL FOR MY TREADS I HAVE BEEN POSTING AND EVERY ONE HAS
BEEN MOST HELPFUL
 
F

Frank H. Shaw

CAN this line on HTML markup be contained in javscript below as it is below?

<input type="hidden" name="item_number" value="212-E">

If it CANNOT you said something about using - write text to a
page using document.write(text to write) including html tags. Does that mean
that the line above of HTML markup be written on the fly using document.write
which would be the same as if it was contained in the form is that a way of
getting around the problem. Would you show me a example of how to do that.
THANKS



Jens Peter Karlsen said:
Yes, you can mix to a certain extent. Forinstance by having an onclick
event tied to say an image or a link but you can't have html in a
javascript function. You can also use a JavaScript to write text to a
page using document.write(text to write) including html tags.
The tutorial I pointed you to will quickly learn you the basics of
Javascript so you know what is possible and how to write simple
javascripts.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: Frank H. Shaw [mailto:[email protected]]
Posted At: 24. maj 2005 16:44
Posted To: microsoft.public.frontpage.programming
Conversation: if else used in javascript questions about limitations
Subject: Re: if else used in javascript questions about limitations


I was told that you can intermix javascript and HTML I know
HTML is a markup and not a programing language - the question
was how can HTML be intermix which would be in the curly
braces just put the HTML markup there or do I have to surond
with any tags ti indactae its HTML markup inside the curly braces.

Jens Peter Karlsen said:
Yes, only one statement is supported without curly braces.
And no html is not a programming language.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: Frank H. Shaw [mailto:[email protected]]
Posted At: 23. maj 2005 22:00
Posted To: microsoft.public.frontpage.programming
Conversation: if else used in javascript questions about limitations
Subject: if else used in javascript questions about limitations


In JavaScript

if (expression) {
statements if express is true
} else {
statements if express is false
}

The question is if the if else will not support only one line in the
the { will let more then one line if i use braces is this correct
and can the statements be in HTML unstead of javascript.

I THANK YOU ALL FOR MY TREADS I HAVE BEEN POSTING AND EVERY ONE HAS
BEEN MOST HELPFUL
 
M

MD Websunlimited

Hi Frank,

That is correct. You may also insert HTML in DOM compliant browsers using JavaScript and the DOM.

--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 102 Components For FP
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible

Frank H. Shaw said:
CAN this line on HTML markup be contained in javscript below as it is below?

<input type="hidden" name="item_number" value="212-E">

If it CANNOT you said something about using - write text to a
page using document.write(text to write) including html tags. Does that mean
that the line above of HTML markup be written on the fly using document.write
which would be the same as if it was contained in the form is that a way of
getting around the problem. Would you show me a example of how to do that.
THANKS



Jens Peter Karlsen said:
Yes, you can mix to a certain extent. Forinstance by having an onclick
event tied to say an image or a link but you can't have html in a
javascript function. You can also use a JavaScript to write text to a
page using document.write(text to write) including html tags.
The tutorial I pointed you to will quickly learn you the basics of
Javascript so you know what is possible and how to write simple
javascripts.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: Frank H. Shaw [mailto:[email protected]]
Posted At: 24. maj 2005 16:44
Posted To: microsoft.public.frontpage.programming
Conversation: if else used in javascript questions about limitations
Subject: Re: if else used in javascript questions about limitations


I was told that you can intermix javascript and HTML I know
HTML is a markup and not a programing language - the question
was how can HTML be intermix which would be in the curly
braces just put the HTML markup there or do I have to surond
with any tags ti indactae its HTML markup inside the curly braces.

:

Yes, only one statement is supported without curly braces.
And no html is not a programming language.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: Frank H. Shaw [mailto:[email protected]]
Posted At: 23. maj 2005 22:00
Posted To: microsoft.public.frontpage.programming
Conversation: if else used in javascript questions about
limitations
Subject: if else used in javascript questions about limitations


In JavaScript

if (expression) {
statements if express is true
} else {
statements if express is false
}

The question is if the if else will not support only one
line in the
the { will let more then one line if i use braces is this correct
and can the statements be in HTML unstead of javascript.

I THANK YOU ALL FOR MY TREADS I HAVE BEEN POSTING AND
EVERY ONE HAS
BEEN MOST HELPFUL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top