Post by Reverse Blade on Jun 24, 2007 13:42:22 GMT -5
Adding Menu Buttons in Proboards
By Reverse Blade
rb.jayowns.com
--------------------------------------------------------------------
In This tutorial I will Teach you how to add menu buttons in Proboards. First, I will show you the code then I will split it up and tell what each part does.
Code:
<script type='text/javascript'>
<!--
var d=document.getElementsByTagName('td')[5];
function add(a,b) {
d.innerHTML+='<a href="'+a+'"><img src="'+b+'" border="0" /></a>'
}
add('www.test.com','Image Here');
//-->
</script>
You could make the code other ways but this is the easiest way to make it so you can add multiple buttons at a time and delete ones you don't want easily.
Now to break it up:
----------------------------------------------
<script type='text/javascript'>
^ You should know this. This starts the code.
<!--
^ Makes it work in old Browsers
var d=document.getElementsByTagName('td')[5];
Makes a variable named "d" that grabs the 6th Td Tag (Javascript starts counting at 0 insted of 1)
function add(a,b) {
Creates a function names add and creates two values to the function called "a" and "b". Then, you use the { to tell that anything after that is what will be in the function.
d.innerHTML+='<a href="'+a+'"><img src="'+b+'" border="0" /></a>'
This tells that in the html of d add <a href="'+a+'"><img src="'+b+'" border="0" /></a>, which if you know HTML you should know what that does except, you see a "a" in the herf and a "b" for the Image. The A and B you created in the last line are set as variables and you can use them only in the function you have open. Value "a" will be the url and value "b" will be the image url.
}
This Closes The Function
add('www.test.com','Image Here');
Here is where your function comes to use. Add is the name of the function you created. Then 'www.test.com' is the url you make, this will set as the variable of "a" and the same goes as the Image Here. It takes the Place of "b".
//-->
This is the ending of <!--
</script>
Ends the Code.
----------------------------------------------------------
What you should of Learned:
Using Functions and Function Values
How to Add Menu Buttons
Using Functions to Help You
-------------------------------------------------------------
If you have any questions just ask me or Email me at: reversecodes@gmail.com
By Reverse Blade
rb.jayowns.com
--------------------------------------------------------------------
In This tutorial I will Teach you how to add menu buttons in Proboards. First, I will show you the code then I will split it up and tell what each part does.
Code:
<script type='text/javascript'>
<!--
var d=document.getElementsByTagName('td')[5];
function add(a,b) {
d.innerHTML+='<a href="'+a+'"><img src="'+b+'" border="0" /></a>'
}
add('www.test.com','Image Here');
//-->
</script>
You could make the code other ways but this is the easiest way to make it so you can add multiple buttons at a time and delete ones you don't want easily.
Now to break it up:
----------------------------------------------
<script type='text/javascript'>
^ You should know this. This starts the code.
<!--
^ Makes it work in old Browsers
var d=document.getElementsByTagName('td')[5];
Makes a variable named "d" that grabs the 6th Td Tag (Javascript starts counting at 0 insted of 1)
function add(a,b) {
Creates a function names add and creates two values to the function called "a" and "b". Then, you use the { to tell that anything after that is what will be in the function.
d.innerHTML+='<a href="'+a+'"><img src="'+b+'" border="0" /></a>'
This tells that in the html of d add <a href="'+a+'"><img src="'+b+'" border="0" /></a>, which if you know HTML you should know what that does except, you see a "a" in the herf and a "b" for the Image. The A and B you created in the last line are set as variables and you can use them only in the function you have open. Value "a" will be the url and value "b" will be the image url.
}
This Closes The Function
add('www.test.com','Image Here');
Here is where your function comes to use. Add is the name of the function you created. Then 'www.test.com' is the url you make, this will set as the variable of "a" and the same goes as the Image Here. It takes the Place of "b".
//-->
This is the ending of <!--
</script>
Ends the Code.
----------------------------------------------------------
What you should of Learned:
Using Functions and Function Values
How to Add Menu Buttons
Using Functions to Help You
-------------------------------------------------------------
If you have any questions just ask me or Email me at: reversecodes@gmail.com