Jump to content

Hello world output

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
12 replies to this topic

#1
Khaotic

Khaotic

    Learning Programmer

  • Members
  • PipPipPip
  • 62 posts
This tutorial is to basically show you how to output text to the browser using javascript

Example:

<script type="text/javascript">

document.write("Hello World");

</script>


<script type="text/javascript"> - This means that anything enclosed in this is javascript code

document.write("Hello World"); - Document is an object that refers the the web page. write is a method that means you want to write to the object. Whatever is defined in the parenthesis means that you want to write that to the object.

</script> - this just tells the web page that you are done defining you javascript code.

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You could also do

alert("Hello World");


#3
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Or just make an HTML file that contains the words "Hello World", and then call window.open().
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#4
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
Interesting.

Maybe you could write a tutorial about using the document object? How about what the different methods in the document object do?

#5
Khaotic

Khaotic

    Learning Programmer

  • Members
  • PipPipPip
  • 62 posts
Thats your way of saying it sucked?

#6
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
its not bad
keep posting tutorials
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#7
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
Not at all, I was giving you constructive criticism. :) Can't wait to see more from you. :)

#8
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
The thing is, a lot of us here are experienced coders. This script is the most basic one I have ever seen - not to say that is necessarily a bad thing, but for many people this tutorial is stating the obvious.

Next time go for something more involved. :)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#9
Khaotic

Khaotic

    Learning Programmer

  • Members
  • PipPipPip
  • 62 posts

Xav said:

The thing is, a lot of us here are experienced coders. This script is the most basic one I have ever seen - not to say that is necessarily a bad thing, but for many people this tutorial is stating the obvious.

Next time go for something more involved. :)

Yeh, I get what you all are saying. I haven't really coded much in javascript. I only do it for site manipulation. I am more on the php/c/c++ side of things. I can do a little more complicated stuff in those.

#10
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
How about giving more detail on the document object? :)

#11
Khaotic

Khaotic

    Learning Programmer

  • Members
  • PipPipPip
  • 62 posts
Document object refers to the current page loaded
Check out my site: www.khaoticirc.net

#12
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
I know that but write a tutorial about the data object, it's methods and what you can do with it.