Simple Machine Codes
April 19, 2024, 06:35:58 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Uploading Javascript

Pages: [1]   Go Down
  Print  
Author Topic: Uploading Javascript  (Read 795 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: August 14, 2007, 10:56:25 pm »

So you ran out of room in your Headers/Footers, or you think you have to much in them.  Well, just follow this tutorial to see how to upload them so you can have more space and it look much neater!

Say you have these two codes:
Code:
<script type="text/javascript">
function board_stats_vone() {
//Created by Agent Moose at smcodes.smfforfree3.com
$(function() {
$("span.middletext").each(function() {
if(this.innerHTML.match(/[\d,]+ Posts in [\d,]+ Topics by [\d,]+ Members/i)) {
this.innerHTML = this.innerHTML.replace(/([\d,]+) Posts in ([\d,]+) Topics by [\d,]+ Members. Latest Member: <b>\s?(<a.+?\/a>)<\/b>/i, "Posts: <b>$1</b><br />Topics: <b>$2</b><br />Newest Member: <b>$3</b>");
}});});}
board_stats_vone();
</script>

and
Code:
<script>
function add_color_v2() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
$("a").each(function() {
if(this.innerHTML.match(/\[color=.*\]/i)) {
this.innerHTML = this.innerHTML.replace(/\[color=(.+?)\]/i,"<font color='$1'>");
};});});}
add_color_v2();
</script>

Step 1
What you would do is put both of those codes into notepad, so it will look like this:
Code:
<script type="text/javascript">
function board_stats_vone() {
//Created by Agent Moose at smcodes.smfforfree3.com
$(function() {
$("span.middletext").each(function() {
if(this.innerHTML.match(/[\d,]+ Posts in [\d,]+ Topics by [\d,]+ Members/i)) {
this.innerHTML = this.innerHTML.replace(/([\d,]+) Posts in ([\d,]+) Topics by [\d,]+ Members. Latest Member: <b>\s?(<a.+?\/a>)<\/b>/i, "Posts: <b>$1</b><br />Topics: <b>$2</b><br />Newest Member: <b>$3</b>");
}});});}
board_stats_vone();
</script>

<script>
function add_color_v2() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
$("a").each(function() {
if(this.innerHTML.match(/\[color=.*\]/i)) {
this.innerHTML = this.innerHTML.replace(/\[color=(.+?)\]/i,"<font color='$1'>");
};});});}
add_color_v2();
</script>

Step 2
Now, remove ALL the script tags(<script>,</script>).
Code:
function board_stats_vone() {
//Created by Agent Moose at smcodes.smfforfree3.com
$(function() {
$("span.middletext").each(function() {
if(this.innerHTML.match(/[\d,]+ Posts in [\d,]+ Topics by [\d,]+ Members/i)) {
this.innerHTML = this.innerHTML.replace(/([\d,]+) Posts in ([\d,]+) Topics by [\d,]+ Members. Latest Member: <b>\s?(<a.+?\/a>)<\/b>/i, "Posts: <b>$1</b><br />Topics: <b>$2</b><br />Newest Member: <b>$3</b>");
}});});}
board_stats_vone();

function add_color_v2() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
$("a").each(function() {
if(this.innerHTML.match(/\[color=.*\]/i)) {
this.innerHTML = this.innerHTML.replace(/\[color=(.+?)\]/i,"<font color='$1'>");
};});});}
add_color_v2();

Step 3
Go to File >> Save As, and change the box from Text Files (*.TXT) to All Files (*.*).

Save the file as anyname, just maksure you have .js at the end. (EX: codes.js)

Step 4
Go to www.ripway.com and register a account if you don't have one and upload the file there.

Step 5
Once you uploaded it you will want to get the URL of it.

The URL would be the text inside the black border.

Copy that text

Step 6
What you want to do now is go into your Headers/Footers. Add this to your headers or footers:
Code:
<script src="URL HERE"></script>

Just replace the URL HERE text with your URL that you copied.

That is all for the tutorial Smiley  If you have any questions, just ask.
« Last Edit: August 14, 2007, 11:54:44 pm by Agent Moose » Report Spam   Logged

Share on Facebook Share on Twitter

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #1 on: August 18, 2007, 08:28:03 am »

Just for the record, note that you can't put HTML or CSS in a js file. Only the codes ( or parts of codes) that are surrounded by the <script> tags will work.
Report Spam   Logged

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #2 on: August 18, 2007, 12:24:45 pm »

Yep Smiley
Report Spam   Logged

Agent Moose Jr.
Ultra Contagious
Global Moderator

Offline Offline

Gender: Male
Posts: 1,045



View Profile WWW
« Reply #3 on: January 04, 2008, 12:42:44 pm »

thats how you made IRPG didnt you! Afro
Report Spam   Logged

Newest:

Celebrus
Artificially Conscious
Administrator

Offline Offline

Gender: Male
Posts: 1,337


aka Omikron


View Profile WWW
« Reply #4 on: January 04, 2008, 08:40:06 pm »


yep. That's how it's set up atm.
Report Spam   Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy