View Full Version : JavaScript
Programm3r
08-19-2003, 01:46 PM
I think i am interested in learning JavaScript.
Does JavaScript have many terms to learn, or i can learn it in 7(!) days? It will be easy to learn it?
Can you give me some directions about this language? ( Preferably about your personall experiences and thoughts, rather than links.. )
Thanks...
Javascript is pretty easy and stright forward.
I have extensive experience with it.
Javascript can be both client side(JavaScript) as well as server side(JScript). In seven days, you wont know it inside and out, but you should have the basics down to create web apps and site functionality.
--
here is a simple example that will pop up an alert box.
This example will provide you with the basics of how to call a function, how to pass a variable and assign it, and how to use it.
==
<html>
<head>
<Script language="javascript">
function alertMe(var_test){
var test = var_test;
alert('I made a alert box '+test);
}
</Script>
</head>
Welcome to my site!
<input type="button" onclick=javascript:alertMe("boo") name="test" value="Press me">
</html>
</head>
<html>
Welcome to my site!
<input type="button" onclick=javascript:alertMe("boo!")>
</html>
another example
===
<html>
<head>
<Script language="Javascript">
function Sample_loop(){
var cnt = 0;
var nNum = 10;
for (i = 0; i < nNum; i++){
cnt++;
document.write(cnt+"
")
}
return;
}
</Script>
</head>
<body onload="Sample_loop()">
</body>
</html>
Programm3r
08-19-2003, 03:46 PM
Thanks for your answer gish! ( and sorry for the wrong forum.. )
Em.. lets have a little conmversation about this language..
Do you think it is a good choise ?
I want to learn , if possible, all the aspects of this language.. Say i work on it 2 hours per day. How long it will take me to learn the entire language?
If i were to choose between JavaScript and XML and some other scripting languages, what would you reccomend me to do? I think that the more stuff i can find on the internet is about JavaScript. What do you think?
>side(JavaScript) as well as server side(JScript).
What do you mean? i thought that JavaScript was "only one thing". ?. The programms i'll write in JavaScript will run to all browsers, isn't it?
Say that learning the entire C took me half a year. How much will it take me to learn JavaScript? ( i mean, if you were to compare the 2 languages, which one has more aspects, and is more difficult to learn.. you get my point )
Thanks in advance, and i hope that you'll expand on mthese topics, if you don't mind..
Programm3r
08-19-2003, 03:54 PM
Ah! Also i forgot this one:
iF you were to choose between HTMl and JavaScript, what would you have choosen?
And,
SQL and ASP suck! what do you think?
Also, what is PHP and what CGI?
They are scripting languages like the above ones?
I heard that they are not good... what do yo think?
And what do you think about Perl?
Thanks in advance
EscapeCharacter
08-19-2003, 04:25 PM
sql most certainly does not suck, asp may but sql doesnt. you cant really choose between html or javascript they compliment eachother, you cant have a html document without html and only javascript.
php is a server side scripting language just like asp, though it is based more on perl and c than visual basic like asp. cgi is not a scripting language it is a way of server side scripting which can be done with any language, and by any language i mean every language that the server supports.
as for are they good, i think cgi scripting and php are awesome, they are both very flexible, cgi moreso and allow the programmer much more control over ontent than just plain javascript and html. though like all html documents you need html to actually have content on the page.
What I mean regarding server side:
ASP (Active Server Pages)
Unlike PHP (which is a language?)
ASP is a "container", in which you can code with a few languages, VBScript or JScript.
Javascript between <% %> tags is then server side and thus it is JScript.
SQL = Structured Query Language. It is a universal language for all Database communication. The same (with minor modifications) SQL statement will work on MySql as it wold on MSSQL or Firebird, or MS Access or Oracle.
For example:
var sSQL1 = "SELECT * FROM tblContacts WHERE ID = 1"
will work the same on all databases that support SQL.
====
There is nothing wrong with ASP technology. WHen using the advanced modules/build in functions, one can create very powerfull applications, just like you could with PHP/CGI.
The only draw back is ASP is 99.999% platform dependant. There are interpreters for Unix, for example, Chili Soft. But there are limited functions/advanced features you can use in the code.
I like Javascript/JScript due to the fact that I love C/C++.
Same style of coding.
Javascript is a very common and is, in my opinion a language one needs to learn if they create web apps. It is predictable, stable, and easy to learn, easy to read.
There would be no harm done if you spent the time learing this language. It would be benificial.
I have never used XML. So I cannot really coment on this subject. I do know that is hasn't caught on as many had predicted it would.
In comparing C to Javascript.
Basically the same. Very easy and straight forward
EscapeCharacter
08-19-2003, 06:43 PM
Originally posted by gish
ASP is a "container", in which you can code with a few languages, VBScript or JScript.
Javascript between <% %> tags is then server side and thus it is JScript.
i never knew that :)
for example:
the first line on a page is:
THe server default is VBScript.
<%@Language="VBScript"%>
-or-
<%@Language="JScript"%>
-or-
<%@Language="PerlScript"%>
AND finally but not least!!
<%@Language="Python"%>
the server now knows what language to actually compile
<%
//code in here
%>
check out ASP for Python (http://starship.python.net/crew/pirx/asp/pydemo.src.html)
Programm3r
08-20-2003, 02:18 AM
ok thanks
Now i have some other work to do, so i might be able to start JavaScript after one year.. exept if i am doing J/S the same time with my other jobs... I'll see what to do..
Thank buddy
vBulletin® v3.7.0, Copyright ©2000-2010, Jelsoft Enterprises Ltd.