Welcome, Guest. Please Login or Register
HTMLfixIT home
  News:
The forum has been upgraded to allow image capture on registration and email verification (as well as other things) to end our spamming issues. We hope this improves your experiance.
  HomeHelpSearchLoginRegister  
 
Pages: 1
Send Topic Print
poooh (Read 1865 times)
dagoo
Guest




poooh
May 21st, 2004, 1:51pm
 
my OS is Linux Mandrake 9.2.Now i am doing my own homepage.i am trying to use DHtml that has Java script in it.When i try to use JavaScript like (ex. <!-- function .... --//> it become comment in HTMLWhat can i do to make the JavaScript work in the html.
Back to top
 
 
  IP Logged
Don
YaBB Administrator
*****
Offline

Franki is smarter,
but I have more
experience!

Posts: 212
USA
Gender: male
Re: poooh
Reply #1 - May 21st, 2004, 11:33pm
 
this has nothing to do with mandrake ... it is purely an html/javascript issue

to have a javascript execute, you need to have script tags around it ... like this:

<script type="text/javascript">
alert("Hello World");
</script>

Many suggest including a comment around the actual javascript thus:
<script type="text/javascript">
<!--
alert("Hello World");
// -->
</script>

Note that this has two //'s at the beginning of the last line so it is a javascript comment inside an html comment.

If you have your problematic page on the net, posting the url is helpful.
Back to top
 
 

Don
HTML Fix IT . com Co-Admin
-----------------------------------
Welcome to our pages. We hope we help you with your coding!
View Profile WWW   IP Logged
Pages: 1
Send Topic Print