Home | Forums | Articles | F@H
Help | Search | Members | Calendar | Forum Map | Cybervillage | Archive
Welcome Guest ( Log In | Register | Resend Validation Email )


>  IceTeks Forums -> Technology -> IceTeks Articles


Pages: (2) [1] 2   ( Go to first unread post ) Reply to this topicStart new topic

>  Javascript Tutorial
Track this topic | Email this topic | Print this topic
Red Squirrel
Posted: Apr 15 2005, 12:41 PM
Quote Post

ZOMG!

Group Icon

Group: Admins
Posts: 14 039
Member No.: 1
Joined: 18-December 02
Ice Cubes: 118907



Allowing visitors to post content to your website is a great way to keep those visitors coming back and a great way to attract new visitors.bbCode is a simple way to give your visitors the ability to jazz up their plain text without leaving yourself open to the risks of html.

http://www.iceteks.com/articles.php/javascript/1


--------------------
user posted image
http://www.redsquirrel.me my blog
http://www.uovalor.com AoS/ML Ultima Online Shard
PMEmail PosterUsers Website Top
Red Squirrel
Posted: Apr 27 2005, 12:13 PM
Quote Post

ZOMG!

Group Icon

Group: Admins
Posts: 14 039
Member No.: 1
Joined: 18-December 02
Ice Cubes: 118907



This section does not parse html, that, for example, would be disasterous if parsed. (text areas, tables, etc can be lethal for the layout)


--------------------
user posted image
http://www.redsquirrel.me my blog
http://www.uovalor.com AoS/ML Ultima Online Shard
PMEmail PosterUsers Website Top
Streety
Posted: Apr 27 2005, 01:17 PM
Quote Post

Liquid Nitrogen Blaster

Group Icon

Group: Ice Age Members
Posts: 185
Member No.: 475
Joined: 16-August 04
Ice Cubes: 5



Well spotted guest . . . needless to say I put that in just to make sure you're all still awake. wink.gif


--------------------
user posted image
PMEmail Poster Top
Red Squirrel
Posted: Apr 27 2005, 04:48 PM
Quote Post

ZOMG!

Group Icon

Group: Admins
Posts: 14 039
Member No.: 1
Joined: 18-December 02
Ice Cubes: 118907



Not sure why the hits on this article are so low though, I did the mailing a few days ago. ohmy.gif Maybe I should try slashdot.


--------------------
user posted image
http://www.redsquirrel.me my blog
http://www.uovalor.com AoS/ML Ultima Online Shard
PMEmail PosterUsers Website Top
rovingcowboy
Posted: Apr 28 2005, 08:31 AM
Quote Post

Stubborn and bull headed.

Group Icon

Group: Ice Age Members
Posts: 1 568
Member No.: 28
Joined: 18-December 02
Ice Cubes: 856



unsure.gif did not read the article red but since most places dont let you post to the
site servers on the free hosts javascript posting does not work. some places let you use a cgi folder for which you can use the posting that way. but not many.

sad.gif


--------------------
roving cowboy/ keith
PMEmail PosterUsers WebsiteMSN Top
Red Squirrel
Posted: Apr 28 2005, 10:02 AM
Quote Post

ZOMG!

Group Icon

Group: Admins
Posts: 14 039
Member No.: 1
Joined: 18-December 02
Ice Cubes: 118907



Yeah php only works on hosts that you pay for. Really, not sure why free ones don't allow php since it's not really all that hard to do. I guess it's a security issue.


--------------------
user posted image
http://www.redsquirrel.me my blog
http://www.uovalor.com AoS/ML Ultima Online Shard
PMEmail PosterUsers Website Top
Streety
Posted: Apr 30 2005, 08:52 PM
Quote Post

Liquid Nitrogen Blaster

Group Icon

Group: Ice Age Members
Posts: 185
Member No.: 475
Joined: 16-August 04
Ice Cubes: 5



javascript is client side (although there is a server side - don't think i'll go there though) so that isn't a problem but a bbCode editor is fairly useless without running scripts on the server.

There are free hosts that allow you to use php (and MySQL). I used lycos tripod for a while before deciding to pay for a decent host.


--------------------
user posted image
PMEmail Poster Top
rip_phreaker
Posted: May 6 2005, 10:19 PM
Quote Post

Ice Cube

Group Icon

Group: IceTeks Members
Posts: 34
Member No.: 861
Joined: 5-May 05
Ice Cubes: 0



hey, i would suggest getting the jsdk from sun java (version 1.4.2 i believe not 1.5) and getting either j-creator or eclipse...it is all open source and is some of the best java scripting software out there right now....with j-creator all u need is the sdk and the doc files no need for setting up your eutoexic.bat file for running programs and it is just an over-all great program i use it like almost everyday (when i am not using the mighty turing)
PMEmail PosterMSN Top
Red Squirrel
Posted: May 6 2005, 10:21 PM
Quote Post

ZOMG!

Group Icon

Group: Admins
Posts: 14 039
Member No.: 1
Joined: 18-December 02
Ice Cubes: 118907



I need to get into javascript, you can do neat stuff with that to make a site more interactive. We sort of "learned" it in our html class, but we did not really learn it. It was more like "copy this code here, and here's what it does". laugh.gif


--------------------
user posted image
http://www.redsquirrel.me my blog
http://www.uovalor.com AoS/ML Ultima Online Shard
PMEmail PosterUsers Website Top
rip_phreaker
Posted: May 6 2005, 10:26 PM
Quote Post

Ice Cube

Group Icon

Group: IceTeks Members
Posts: 34
Member No.: 861
Joined: 5-May 05
Ice Cubes: 0



well if u want me too i will find the links and stuff for getting the programs that i described above? i will tell ya now java scripting is a pain in the a$$ i do not like it very much, but it is more versatile then turing and delphi and c and c++ and python and cobalt...lol what other lingo's do i use? i forget but ya java is great cus it is multi=platformed and will work on sooo many different os'es or else i would not touch it
PMEmail PosterMSN Top
Red Squirrel
Posted: May 6 2005, 10:29 PM
Quote Post

ZOMG!

Group Icon

Group: Admins
Posts: 14 039
Member No.: 1
Joined: 18-December 02
Ice Cubes: 118907



Oh are you talking about java or javascript? Get's confusing but java is different then javascript. Well I think they're the same it's just that java is for applications while JS is for client side web, but I think the syntax is the same. May be wrong though. If you want you can actually post that app in the download section. Not much in there so we need more stuff. em320.gif


--------------------
user posted image
http://www.redsquirrel.me my blog
http://www.uovalor.com AoS/ML Ultima Online Shard
PMEmail PosterUsers Website Top
rip_phreaker
Posted: May 6 2005, 10:36 PM
Quote Post

Ice Cube

Group Icon

Group: IceTeks Members
Posts: 34
Member No.: 861
Joined: 5-May 05
Ice Cubes: 0



well javascript is the name for java...they are the same thing really java scripting is just used by java programmers really... and the files are huge (the doc file is like 60 Mb) plus u really need to look on the sites for proper downloading types...also my schools programming site is AMAZING for learning the java....some great links and excersise there
PMEmail PosterMSN Top
Streety
Posted: May 7 2005, 05:04 AM
Quote Post

Liquid Nitrogen Blaster

Group Icon

Group: Ice Age Members
Posts: 185
Member No.: 475
Joined: 16-August 04
Ice Cubes: 5



QUOTE (rip_phreaker @ May 6 2005, 10:36 PM)
well javascript is the name for java...they are the same thing really java scripting is just used by java programmers really... and the files are huge (the doc file is like 60 Mb) plus u really need to look on the sites for proper downloading types...also my schools programming site is AMAZING for learning the java....some great links and excersise there

Java is NOT the same as javascript. The fact they have a similar name is just some messed up marketing gimic. Javascript was originally put out by Netscape as LiveScript around the same time that Java was getting a lot of attention as 'the next big thing'. When Netscape then started supporting java applets they changed the name of LiveScript to JavaScript hoping some of the success of Java would rub off on their offering.

In summary, they're totally different.


--------------------
user posted image
PMEmail Poster Top
rip_phreaker
Posted: May 7 2005, 11:22 AM
Quote Post

Ice Cube

Group Icon

Group: IceTeks Members
Posts: 34
Member No.: 861
Joined: 5-May 05
Ice Cubes: 0



actually BOB (the original form of java) was produced by netscape

javascripting is the name for coding and java is just the common name for running javascripting if u do not program it... java scripting is just the name for programming java

it was originally programmed for use in handheld devices (not palmpilots) but for the original lcd remotes, because it was versatile then they figured out that it was a much more dynamic way to get live animation over the web (at the time most websites where static and this was pre-flash and before .gif's where big)

if you would like i can post the link for the history of java
PMEmail PosterMSN Top
Streety
Posted: May 7 2005, 11:34 AM
Quote Post

Liquid Nitrogen Blaster

Group Icon

Group: Ice Age Members
Posts: 185
Member No.: 475
Joined: 16-August 04
Ice Cubes: 5



Ok, script written in java could be called java script but that isn't the same as 'JavaScript'.

Java is a programming language, you can use it to produce complete programs. Javascript is a scripting language and so can only be used inside browsers.

To use javascript inside a website you include the code within SCRIPT tags, to use java via applets in a browser I believe you use applet of object tags.


--------------------
user posted image
PMEmail Poster Top
rip_phreaker
Posted: May 7 2005, 12:41 PM
Quote Post

Ice Cube

Group Icon

Group: IceTeks Members
Posts: 34
Member No.: 861
Joined: 5-May 05
Ice Cubes: 0



ya javascripting would be like:
CODE
import java.awt.*
-codes of the program




and then u must creat and html file to call the .class file of the java program u ust wrote




PMEmail PosterMSN Top
Streety
Posted: May 7 2005, 12:55 PM
Quote Post

Liquid Nitrogen Blaster

Group Icon

Group: Ice Age Members
Posts: 185
Member No.: 475
Joined: 16-August 04
Ice Cubes: 5



I'll take your word for it as I've never used Java.

However a javascript file would be something like this:

CODE

<html>
<head>
<title>Basic Hello, World Javascript file</title>
</head>
<body>
<script LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">

document.write("Hello, World!")

</SCRIPT>

</body>
</html>


--------------------
user posted image
PMEmail Poster Top
rip_phreaker
Posted: May 7 2005, 01:09 PM
Quote Post

Ice Cube

Group Icon

Group: IceTeks Members
Posts: 34
Member No.: 861
Joined: 5-May 05
Ice Cubes: 0



since i am not too great with java i will do the basic form of applet i was taught

CODE
import java.awt.*


public class applet
{
  public static void main (String[] args)
  {
     System.out.println ("Hello World")
  }
 
}
this program would then be compiled
then you would need an html file with like
CODE

[html]
[import java class = applet.class]  % not too sure about this coding
[/html]


not too sure about the html but then you would just open the .html file and it would show "Hello World" in the window

so basically how i was taught was free running java programs and applet java are both the same coding and so forth i am not too great with html tho

This post has been edited by rip_phreaker on May 7 2005, 01:10 PM
PMEmail PosterMSN Top
art
Posted: Jun 29 2005, 02:23 AM
Quote Post

Unregistered











QUOTE
The opening tag and closing tag are both supplied as variables to the function and all that happens is they are both tacked onto the end of the users post. In some bbcode editors (certainly phpBB and probably others) highlighting text and then using this function will wrap the highlighted text in the appropriate bbcode tags. This editor doesn't have this functionality. If this is something you feel your users will need it should be possible to reconstruct this functionality by looking at the source html for an editor that allows this.


These articles are great! Thanks a million for taking time to write them up.

There are two problems with the method you've presented, as I'm sure you're aware. One is that if you want to add bold (as an example) to text that isn't at the end of what has been typed in, you're out of luck. Some might not figure out that they have to type in the [b] code manually. The other is that many users will try to highlight the text and then click the bold button (because they've learned to do that in word processors). So I think we need a little more functionality, especially if it's not too hard to do.


When I looked at phpBB's bbcode, it looked like they had to create workarounds for the javascript capabilities of different browsers. In particular it seemed like they needed alternatives for the arrayname.length, arrayname.pop(), and arrayname.push(value) properties.

I'm wondering if it's possible to work around those problems? Is it even a problem if you're using 6th generation browsers?


Do you have any thoughts on how to go about solving the problem?

Thanks, Jonathon!
Top
Streety
Posted: Jun 29 2005, 03:29 PM
Quote Post

Liquid Nitrogen Blaster

Group Icon

Group: Ice Age Members
Posts: 185
Member No.: 475
Joined: 16-August 04
Ice Cubes: 5



Hi art,

I'm glad you liked the article. You're absolutely right in that some functionality is missing though, not applying bbcode to highlighted text and not autocompleting tags on submission are the two major issues in my opinion. They'll both throw a lot of new users.

To be honest though I haven't looked in detail at either issue though I do remember phpBB used a workaround from reading through the code when I wrote the article. I would like to think that this is just a segment of code from an earlier version (why fix it if it isn't broken?) that still works but isn't needed with more modern browsers. Changing the user agent to IE breaks the functionality in firefox but thats to be expected using IE specific code. I'm not sure how to change the user agent in IE and don't really have the time at the moment to mess around with the code.

If you do have the time to play around and report back though that would be great.


--------------------
user posted image
PMEmail Poster Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | IceTeks Articles | Next Newest »

Topic Options Pages: (2) [1] 2  Reply to this topicStart new topic

 



[ Script Execution time: 0.0428 ]   [ 13 queries used ]   [ GZIP Enabled ]

< Home | Forums | Contact >