The Funelephant Forums!

You are not logged in.

Announcement

The Forums are currently Read-Only except for Mods & admin. These forums are closing down, but don't worry! We created a new forum, with more features! They are almost ready. We know it's hard to transition, but it's for the best! :D New Forums are here!

Adverts

Adverts

#1 Monday, June 18, 2012 23:34:01

WingsGames
Member
Registered: Thursday, June 14, 2012
Posts: 42
FunCoinz: 11
Bank: 113
Reputation :   
Website

Javascript Use

I'm learning Javascript via Codeacademy, but I'm not really sure what it's used for. What is Javascript used for?


http://img842.imageshack.us/img842/1115/wingsgames.gif

Offline

 

Monday, June 18, 2012 23:34:01

AdBot
Advertisements

#2 Tuesday, June 19, 2012 00:40:22

mythbusteranimator
From: Hiding from the FBI.
Registered: Monday, June 11, 2012
Posts: 660
FunCoinz: 547
Bank: 28
Reputation :   
Website

Re: Javascript Use

I think it is websites and games.


http://i45.tinypic.com/2zspqas.png

Offline

 

#3 Tuesday, June 19, 2012 02:50:16

funelephant
Registered: Tuesday, April 10, 2012
Posts: 1114
FunCoinz: 468
Bank: 462
Reputation :   

Re: Javascript Use

You can use it for extensions on Google Chrome.


We found this tube of glue stuck to your... uh... anyways, you can only use glue sticks now.
http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/90000/3000/900/93946/93946.strip.zoom.gif

Offline

 

#4 Tuesday, June 19, 2012 03:05:40

GeonoTRON2000
Outstanding Member
Registered: Sunday, June 17, 2012
Posts: 121
FunCoinz: 49
Bank: 174
Reputation :   
Website

Offline

 

#5 Monday, July 23, 2012 10:43:17

RedRocker227
Outstanding Member
Registered: Monday, July 23, 2012
Posts: 70
FunCoinz: 128
Bank: 0
Reputation :   

Re: Javascript Use

Interactivity. Use PHP for dealing with forms and databases, and JS for making interactive stuff.

Offline

 

#6 Monday, July 23, 2012 12:23:51

funelephant
Registered: Tuesday, April 10, 2012
Posts: 1114
FunCoinz: 468
Bank: 462
Reputation :   

Re: Javascript Use

^^

I think you can change text and images in JavaScript too.


We found this tube of glue stuck to your... uh... anyways, you can only use glue sticks now.
http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/90000/3000/900/93946/93946.strip.zoom.gif

Offline

 

#7 Monday, July 23, 2012 12:45:02

RedRocker227
Outstanding Member
Registered: Monday, July 23, 2012
Posts: 70
FunCoinz: 128
Bank: 0
Reputation :   

Re: Javascript Use

funelephant wrote:

^^

I think you can change text and images in JavaScript too.

You can, using getElementById().

Offline

 

#8 Monday, July 23, 2012 12:47:55

funelephant
Registered: Tuesday, April 10, 2012
Posts: 1114
FunCoinz: 468
Bank: 462
Reputation :   

Re: Javascript Use

I wanted to create a word filter using JavaScript.


We found this tube of glue stuck to your... uh... anyways, you can only use glue sticks now.
http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/90000/3000/900/93946/93946.strip.zoom.gif

Offline

 

#9 Monday, July 23, 2012 13:15:24

daniel_j
From: Adelaide, Australia
Registered: Monday, July 2, 2012
Posts: 303
FunCoinz: 256
Bank: 50
Reputation :   
Website

Re: Javascript Use

funelephant wrote:

I wanted to create a word filter using JavaScript.

Here is a bad word filter using HTML...

Code:

html>
<head>
    <title>Bad Words Example</title>
    <script type="text/javascript">

            function filterText(sText) {
                var reBadWords = /badword|anotherbadword/gi;
                return sText.replace(reBadWords, "****");
            }

            function showText() {
                var oInput1 = document.getElementById("txt1");
                var oInput2 = document.getElementById("txt2");
                oInput2.value = filterText(oInput1.value);
            }
    </script>
</head>
<body>
    <P>
    <textarea rows="10" cols="50" id="txt1">badword anotherbadword</textarea><br />
    <input type="button" value="Filter Bad Words" onclick="showText()" /></p>
    <P>Filtered Text:<br />
    <textarea rows="10" cols="50" id="txt2"></textarea></p>

</body>
</html>

For all those wondering why, why?

Offline

 

#10 Monday, July 23, 2012 21:50:09

GeonoTRON2000
Outstanding Member
Registered: Sunday, June 17, 2012
Posts: 121
FunCoinz: 49
Bank: 174
Reputation :   
Website

Re: Javascript Use

daniel_j wrote:

funelephant wrote:

I wanted to create a word filter using JavaScript.

Here is a bad word filter using HTML...

Code:

html>
<head>
    <title>Bad Words Example</title>
    <script type="text/javascript">

            function filterText(sText) {
                var reBadWords = /badword|anotherbadword/gi;
                return sText.replace(reBadWords, "****");
            }

            function showText() {
                var oInput1 = document.getElementById("txt1");
                var oInput2 = document.getElementById("txt2");
                oInput2.value = filterText(oInput1.value);
            }
    </script>
</head>
<body>
    <P>
    <textarea rows="10" cols="50" id="txt1">badword anotherbadword</textarea><br />
    <input type="button" value="Filter Bad Words" onclick="showText()" /></p>
    <P>Filtered Text:<br />
    <textarea rows="10" cols="50" id="txt2"></textarea></p>

</body>
</html>

That works if you're censoring text inputs.  It just wrecks havock if you're trying to censor a page with HTML, though.


http://img440.imageshack.us/img440/1846/gtforumsusarmy.png

Offline

 

#11 Monday, July 23, 2012 23:37:16

daniel_j
From: Adelaide, Australia
Registered: Monday, July 2, 2012
Posts: 303
FunCoinz: 256
Bank: 50
Reputation :   
Website

Re: Javascript Use

Hhahah, yes, it would be very very hard to make it censor a page xD It might work however if you wanted to sensor the quick post dialog, you would just need to replace and edit some code, wouldn't be too hard :)


For all those wondering why, why?

Offline

 

Adverts

Board footer

Powered by FluxBB
Hosted by PunBB-Hosting