PDA

View Full Version : JavaScript - Begginners Guide



Sketti
27-02-2005, 06:24 PM
JavaScript

JavaScript is a type of HTML which can do some pretty decent things.

Entering Pop-Up

<script language=”JavaScript”>alert (“YOUR MESSAGE HERE”) </script>


Leaving Pop-Up

<body onUnload=”alert (‘YOUR MESSAGE HERE’) ;”>


Entering and leaving pop-up

<body onLoad=”alert(‘YOUR TEXT HERE’) ; “onUnload=”alert (‘YOUR TEXT HERE’) ; “>

As you can probably tell the first part in brackets and inverted commas’ is what comes up when you open the page and the same for the second one apart from that one appears when you close the page.


Blocking right clicking

<script LANGUAGE="JavaScript">

<!--
function click() {
if (event.button==2) {
alert(‘YOUR WANRING HERE');
}
}
document.onmousedown=click
// -->
//-->

</script>


Password protect pages

<script language=”JavaScript”><!—hidevar password;var pass1=”PASSWORD GOES HERE”;password=prompt (‘TEXT ON POP-UP’,’ ‘);if (password=pass1)alert(‘TEXT IF RIGHT’);else { window.location=”URL OF PAGE IT GOES TO IF PASSWORD IS WRONG”; }//--></script>

This goes after the <head> tag – not after the </head> tag.


That’s just some basic JavaScript scripts for you. If you want to find more search for JavaScript on Google (http://www.google.co.uk) or something like that.

-JT-
27-02-2005, 06:42 PM
another good attempt at a tutorial. Well done once again :) This one is a little empty so i might add some stuff to it if you dont mind...?

Sketti
27-02-2005, 07:32 PM
Sure. Go ahead. I just put those scripts in from what I know - i.e not a lot.

-JT-
27-02-2005, 08:06 PM
okay, i will add some stuff :)

Mined
27-02-2005, 08:07 PM
Great Tutorial.

Mentor
27-02-2005, 08:14 PM
I dont quite see why people write toutrials on things there not entirly familr with themslevs.

Also if you want a serios password javascript wont do. and disabling right click wont stop people from viewing your sorese or stealing your images.


Its oviosl your putting in alot of effort but i cant serily se how people can benifit form this .

BlueTails
27-02-2005, 08:15 PM
thanks, i needed that right click disabled

Homesrfan
28-02-2005, 10:06 PM
Hm.. thats not really a tutorial, just some scripts!
Make it more elaberate, maybe.. I dont know much about JavaScript, but maybe say how to code it or something!

But its still nice =D

-JT-
01-03-2005, 10:27 AM
I dont quite see why people write toutrials on things there not entirly familr with themslevs.

Also if you want a serios password javascript wont do. and disabling right click wont stop people from viewing your sorese or stealing your images.


Its oviosl your putting in alot of effort but i cant serily se how people can benifit form this .

we have had this argument before :D

iRoss
01-03-2005, 05:53 PM
we have had this argument before :D

yer just:

cpanel>password protect directories

sampson123
01-03-2005, 05:58 PM
Very good, a great tutorial for beginners e.g. me ;)

Mentor
05-03-2005, 12:01 PM
we have had this argument before :D
i just find it annyoying asd its 100% immpoible to stop someone steaing your images. and i do mean 100%. and so many people dont seem to get this, if i load an image, its in my cache, i can just open it up and grab it, or view sorse asnd get it fropm that, or take a screen shot and cut it out. and about a few 100 other ways.

Want to hide these adverts? Register an account for free!