Click to See Complete Forum and Search --> : Need some help with j/script
no/good/at/this
07-14-2008, 11:21 AM
Hi everybody, i've only recently learned the wonders of markup that are (x)html and css, through a home learning course,and im now writing my own site. The course has tought me (x)html to a high level but only the very basics of css (which im now learning more of). Unfotunatley the course doesn't teach any j/script atall, so im now at a cross roads,do i finish my site without j/script? or do i learn it?
If i learn it, how do i learn it i.e where do i get some good material to teach me?
Please bare in mind everyone that i have no previous experience in markup and ive only known how to write html and css for 5 months!
Any advice would be great from anyone willing to give it.
Kind regards
p.s thanks for reading this.
toicontien
07-14-2008, 11:56 AM
Try out www.w3schools.com.
no/good/at/this
07-14-2008, 12:17 PM
Thanks il give it a look, i also tried a little experiment with my brousers by turning off javascript support and seeing which sites ran effectively without it, and out of 10 of the sites i tried it with only 2 worked! I can't name the sites(for obvious reasons) but all were leading names on the net, surely a site should work wether j/script is on or off?
One of the sites i tried completely froze!
Declan1991
07-14-2008, 01:35 PM
Yes, so that is why you must always build the page with JavaScript off first, and add the JavaScript unobtrusively later, when possible.
JavaScript should be a third layer (after semantic HTML the basic, and then CSS) to enhance the website, but not to be needed.
no/good/at/this
07-15-2008, 12:25 PM
Hi ya, great advice. To be honest i hadn't ever looked at it that way, obviously ive built my site (so far) using just html and css, im still not enitirely convinced by j/script but time will tell, well i have to learn it first but i've started.
But for a site to completely cease to work with j/script turned off is shocking!
One of the first things i was taught when learning html was site accessibility, for obvious reasons, if a user cannot use it, it's useless!!!.
Declan1991
07-15-2008, 12:39 PM
I like JavaScript (although I often have it disabled), it's great for sorting tables on the fly and things like that. Just realise that, like Flash, it's an enhancement.
Just don't be put off by bad JavaScript. Learn it properly, and always be unobtrusive, and you'll find it easier.
donatello
07-15-2008, 03:01 PM
www.lynda.com has some good stuff and online tutorials. Go and try the free ones.
no/good/at/this
07-16-2008, 11:26 AM
Is it considered bad practice to use someone elses code in a published site?
Because that sliding menu on dynamic drive is great!
donatello
07-16-2008, 06:27 PM
Is it considered bad practice to use someone elses code in a published site?
Because that sliding menu on dynamic drive is great!
Everybody does it, just give the author credit and a link if they ask for one, otherwise you can buy some code. Hot scripts has code for sale.
no/good/at/this
07-20-2008, 09:03 AM
excellent good to know, im just finding javascript a bit difficult to learn at the moment.
no/good/at/this
07-24-2008, 02:34 PM
How on earth do i use a javascript library?
I downloaded a script for rounding the corners on div elements but everytime i try to use it, its doesn't do anything.
And as i dont know hop to write javascript i cant do anything about it!
The script is called 'curvycorners' from a site of the same name.
This is driving me mad.
toicontien
07-24-2008, 03:38 PM
What HTML are you using to include the JavaScript on your page?
no/good/at/this
07-24-2008, 04:14 PM
Not 100% usre what you mean but if its this im using, xhtml-1 transitional.
I've tried 3 different librarys, prototype/ajax dont even ask me what thats all about (talk about out of my league) and yahoo ui (yui) and none of that makes any sense, then i tried this new one 'curvy corners' and im still none the wiser!
Do you think i'd be better off leaving javascript all together and using css?
I dont understand javascript and i dont think i ever will.
There must be sites on he net that dont use j/script at all that work perfectly fine?
toicontien
07-25-2008, 08:36 AM
You should be using a script tag to actually include the JavaScript source code on your page. How are you writing this HTML tag?
<script type="text/javascript" src="/path/to/file.js"></script>
OR
<script type="text/javascript">
// JavaScript code here
</script>
no/good/at/this
07-25-2008, 05:02 PM
<script type="text/javascript" src="/path/to/file.js"></script>
But everytime i try linking a file to it, it never works.
I tried using a simple file, it was just a menu i put 4 tabs in it (made with a j/script menu generator) and copied the code to a fresh notepad document then saved it as tabs.js. i then put the file into the same folder as my site e.g fscwebsite/tabs.js and linked to that file path, but nothing at all.
I cant sus out what im doing wrong, either that or im just plain stupid.
I've also tried putting code directly in a page between the <script></script> tags but that was for another code but again it didnt work.
The pages all validated afterwards!
Declan1991
07-25-2008, 05:23 PM
You have to configure it too. Have you tried to implement their test page too?
no/good/at/this
08-02-2008, 11:08 AM
No i didnt even know i had to do that.
I've found one problem with what ive been doing, in one linked file i left the <script> tags in as well as putting it in my html so i sorted that out but that was just for a good morning/afternoon/evening message.
AMan2008
08-02-2008, 07:56 PM
http://www.w3schools.com/ has a good tutorial. But my personal favourite is the book called JavaScript Bible 6th Addition.
Here's a tip for your external file: I had the same problem, eventually I figured out that you have to have the external file in the same folder of the HTML you want it in (or in a sub-folder within the folder). If that doesn't work then try typing the entire location (eg. C:\MyCode\JS\file.js\)
no/good/at/this
08-03-2008, 04:24 PM
Hi ya AMan2008, yeah i was doing that but it wasn't working, turns out i have to edit the text, but as i dont know how to do that i cant use the librarys but i can write an 'if else' statement and simple stuff like that.
Im gonna stick to stuff like that until i can confidently write j/script from memory but to be honest i really dont like it and i wont be using it very much, also i think 'css' is loads better.
Declan1991
08-03-2008, 05:04 PM
Well JavaScript and CSS do totally different things. Stick at JavaScript, you will figure it out eventually. I would advise you to try not the use libraries and the like until you are confident with the syntax and stuff. The only way to learn is by practice, and by making mistakes.
no/good/at/this
08-06-2008, 10:01 AM
I will stick at it but for some reason its taking me longer to learn this than it did html and css put together but then im not the sharpest tool in the shed so it'll take me longer than most.
Im having loads of fun with css at the mo , i do have a few pirces of script that i know how to write but these are simple things that il add later.
Thanks to everyone for all ya help though.