This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#101 2012-08-25 18:39:59

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Javascript topic

mythbusteranimator wrote:

TorbyFork234 wrote:

mythbusteranimator wrote:


I still cant find it. I click Inspect Elemtent.  hmm

There's a place where you view all the files of a website, I don't know where it is in chrome though.

Would it be a right click?  hmm
On IE, you can see with F12, but you can't edit.

With safari, you can click a checkbox in it's preferences that allows you to have a bar called "develop". and with that you click "Show Web Inspector"(if you have the new mountain lion update, you can also right click and click "Inspect Element"). Although, as I said before, I don't know how to do it in google chrome.

Offline

 

#102 2012-08-25 18:56:52

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Javascript topic

Hmmm...will adding something like <script>[JSwhatever]</script> work?


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#103 2012-08-25 18:58:18

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Javascript topic

mythbusteranimator wrote:

Hmmm...will adding something like <script>[JSwhatever]</script> work?

Work for what? You also need to change the first script tag to: <script type="text/javascript>

Offline

 

#104 2012-08-25 19:14:41

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Javascript topic

TorbyFork234 wrote:

mythbusteranimator wrote:

Hmmm...will adding something like <script>[JSwhatever]</script> work?

Work for what? You also need to change the first script tag to: <script type="text/javascript>

Unless you're using HTML5.


Why

Offline

 

#105 2012-08-25 19:20:47

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Javascript topic

RedRocker227 wrote:

TorbyFork234 wrote:

mythbusteranimator wrote:

Hmmm...will adding something like <script>[JSwhatever]</script> work?

Work for what? You also need to change the first script tag to: <script type="text/javascript>

Unless you're using HTML5.

I have a Windows 7. What do I have.  tongue


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#106 2012-08-25 23:29:57

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Javascript topic

@mythbusteranimator: It matters by the browser.



I updated what I made before for more ease of use.

Code:

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var hgj;
var c;
function doIt(){
var reqLetters=new Array();
var maxLetters=61;
var inter=8;
var Letters=new Array();
var i=0;
var b=0;
var hello=document.getElementById("word");
var word=hello.value;
var checking=0;
var xyz=20;
for (i=0;i<word.length;i++){
reqLetters[i]=word.slice(i,(i+1));
}

var allLetters=new Array();
allLetters[0]='a';
allLetters[1]='b';
allLetters[2]='c';
allLetters[3]='d';
allLetters[4]='e';
allLetters[5]='f';
allLetters[6]='g';
allLetters[7]='h';
allLetters[8]='i';
allLetters[9]='j';
allLetters[10]='k';
allLetters[11]='l';
allLetters[12]='m';
allLetters[13]='n';
allLetters[14]='o';
allLetters[15]='p';
allLetters[16]='q';
allLetters[17]='r';
allLetters[18]='s';
allLetters[19]='t';
allLetters[20]='u';
allLetters[21]='v';
allLetters[22]='w';
allLetters[23]='x';
allLetters[24]='y';
allLetters[25]='z';


for (i=0;i<maxLetters;i++){
var random=Math.round(Math.random()*25);
var randomletter=allLetters[random];
Letters[i]=randomletter;
}


for (i=0;i<reqLetters.length;i++){
c=i;
b=(c*inter)%maxLetters;
Letters[b]=reqLetters[c]
}
c="";
i=0;
for (i=0;i<reqLetters.length;i++){
c=c+Letters[((i*inter)%maxLetters)];
if (c!="knowledgeispower"){
xyz=1;
}
}
hgj="";
i=0;
for (i=0;i<maxLetters;i++){
hgj=hgj+""+Letters[i];
}
load();
}
function load(){
document.getElementById("demo").innerHTML="Scrambled Part:   "+hgj;
document.getElementById("check").innerHTML="Check:   "+c;
}
</script>
<style type="text/css">
#demo{
font-family:"Cambria";
}
</style>
</head>
<body>
<input type="textarea" maxlength="61" name="Sentence" value="thiswillbecomeascrambledsentence" id="word"/>
<br/>
<input type="button" name="Submit" value="Submit" onclick="doIt()" />
<p id="demo"></p>
<p id="check"></p>
</body>
</html>

Offline

 

#107 2012-08-26 04:09:08

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Javascript topic

TorbyFork234 wrote:

@mythbusteranimator: It matters by the browser.



I updated what I made before for more ease of use.

Code:

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var hgj;
var c;
function doIt(){
var reqLetters=new Array();
var maxLetters=61;
var inter=8;
var Letters=new Array();
var i=0;
var b=0;
var hello=document.getElementById("word");
var word=hello.value;
var checking=0;
var xyz=20;
for (i=0;i<word.length;i++){
reqLetters[i]=word.slice(i,(i+1));
}

var allLetters=new Array();
allLetters[0]='a';
allLetters[1]='b';
allLetters[2]='c';
allLetters[3]='d';
allLetters[4]='e';
allLetters[5]='f';
allLetters[6]='g';
allLetters[7]='h';
allLetters[8]='i';
allLetters[9]='j';
allLetters[10]='k';
allLetters[11]='l';
allLetters[12]='m';
allLetters[13]='n';
allLetters[14]='o';
allLetters[15]='p';
allLetters[16]='q';
allLetters[17]='r';
allLetters[18]='s';
allLetters[19]='t';
allLetters[20]='u';
allLetters[21]='v';
allLetters[22]='w';
allLetters[23]='x';
allLetters[24]='y';
allLetters[25]='z';


for (i=0;i<maxLetters;i++){
var random=Math.round(Math.random()*25);
var randomletter=allLetters[random];
Letters[i]=randomletter;
}


for (i=0;i<reqLetters.length;i++){
c=i;
b=(c*inter)%maxLetters;
Letters[b]=reqLetters[c]
}
c="";
i=0;
for (i=0;i<reqLetters.length;i++){
c=c+Letters[((i*inter)%maxLetters)];
if (c!="knowledgeispower"){
xyz=1;
}
}
hgj="";
i=0;
for (i=0;i<maxLetters;i++){
hgj=hgj+""+Letters[i];
}
load();
}
function load(){
document.getElementById("demo").innerHTML="Scrambled Part:   "+hgj;
document.getElementById("check").innerHTML="Check:   "+c;
}
</script>
<style type="text/css">
#demo{
font-family:"Cambria";
}
</style>
</head>
<body>
<input type="textarea" maxlength="61" name="Sentence" value="thiswillbecomeascrambledsentence" id="word"/>
<br/>
<input type="button" name="Submit" value="Submit" onclick="doIt()" />
<p id="demo"></p>
<p id="check"></p>
</body>
</html>

Did you know String.charCodeAt( x ); and String.fromCharCode( [  12 , 65 , 78 ] ); exist ?

String.charCodeAt(x); will return the char code at the character at the parameter x in String.

String.fromCharCode(Array); will accept an array of Numbers and return an array with those .

// so basically you dont need that allLetters array :-)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#108 2012-08-26 05:17:47

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Javascript topic

mythbusteranimator wrote:

RedRocker227 wrote:

TorbyFork234 wrote:


Work for what? You also need to change the first script tag to: <script type="text/javascript>

Unless you're using HTML5.

I have a Windows 7. What do I have.  tongue

What you have doesn't make a difference, it's whether or not the website designers decided to use HTML5 or not.


Why

Offline

 

#109 2012-08-26 05:30:25

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Javascript topic

RedRocker227 wrote:

mythbusteranimator wrote:

RedRocker227 wrote:


Unless you're using HTML5.

I have a Windows 7. What do I have.  tongue

What you have doesn't make a difference, it's whether or not the website designers decided to use HTML5 or not.

It does makes a differene ... the web - browser must support it.


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#110 2012-08-26 05:34:35

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Javascript topic

fanofcena wrote:

RedRocker227 wrote:

mythbusteranimator wrote:


I have a Windows 7. What do I have.  tongue

What you have doesn't make a difference, it's whether or not the website designers decided to use HTML5 or not.

It does makes a differene ... the web - browser must support it.

Oh yeah. Most of the main browsers do support it already though, even if it's only partially


Why

Offline

 

#111 2012-08-26 05:40:41

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: Javascript topic

RedRocker227 wrote:

fanofcena wrote:

RedRocker227 wrote:


What you have doesn't make a difference, it's whether or not the website designers decided to use HTML5 or not.

It does makes a differene ... the web - browser must support it.

Oh yeah. Most of the main browsers do support it already though, even if it's only partially

Awkwardly, IE has better HTML5 support than Chrome.  hmm


http://i50.tinypic.com/312u714.jpg

Offline

 

#112 2012-08-26 05:42:28

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Javascript topic

BirdByte wrote:

RedRocker227 wrote:

fanofcena wrote:


It does makes a differene ... the web - browser must support it.

Oh yeah. Most of the main browsers do support it already though, even if it's only partially

Awkwardly, IE has better HTML5 support than Chrome.  hmm

You kidding me ?


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#113 2012-08-26 05:46:36

jukyter
Scratcher
Registered: 2009-12-06
Posts: 1000+

Re: Javascript topic

BirdByte wrote:

RedRocker227 wrote:

fanofcena wrote:


It does makes a differene ... the web - browser must support it.

Oh yeah. Most of the main browsers do support it already though, even if it's only partially

Awkwardly, IE has better HTML5 support than Chrome.  hmm

I swear IE can't even run a lot of HTML5?


cause a bird and a fish could fall in love/but where would they live?

Offline

 

#114 2012-08-26 09:33:46

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Javascript topic

jukyter wrote:

BirdByte wrote:

RedRocker227 wrote:


Oh yeah. Most of the main browsers do support it already though, even if it's only partially

Awkwardly, IE has better HTML5 support than Chrome.  hmm

I swear IE can't even run a lot of HTML5?

IE 10 plans to support a lot but not atm  tongue


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#115 2012-08-26 11:06:39

pipercubjl
Scratcher
Registered: 2010-05-20
Posts: 73

Re: Javascript topic

I use Javascript for programming in Unity3d.


http://scratch.mit.edu/static/projects/pipercubjl/2621398_med.png  http://scratch.mit.edu/static/projects/pipercubjl/2634368_med.png
        Crypt            Pixel Lands

Offline

 

#116 2012-08-27 19:55:20

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Javascript topic

bump

Offline

 

#117 2012-08-29 21:36:20

Laternenpfahl
Scratcher
Registered: 2011-06-24
Posts: 1000+

Re: Javascript topic

I started learming it.

FUN


http://i46.tinypic.com/6yd4c0.png

Offline

 

#118 2012-08-29 21:46:09

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Javascript topic

Laternenpfahl wrote:

I started learming it.

FUN

I've learned it through Khan Academy.  Simple program.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#119 2012-08-29 21:54:41

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Javascript topic

I'm learning from Codeacademy  big_smile


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#120 2012-08-30 20:36:55

Laternenpfahl
Scratcher
Registered: 2011-06-24
Posts: 1000+

Re: Javascript topic

Sine curve on canvas yay


http://i46.tinypic.com/6yd4c0.png

Offline

 

#121 2012-08-30 21:21:22

Laternenpfahl
Scratcher
Registered: 2011-06-24
Posts: 1000+

Re: Javascript topic

Also, this.


http://i46.tinypic.com/6yd4c0.png

Offline

 

#122 2012-09-01 13:36:43

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Javascript topic

*cough* *cough* i learnt it in the stackoverflow javascript chatroom and my own computer using mdn as refererence


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#123 2012-09-01 13:51:19

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Javascript topic

BirdByte wrote:

RedRocker227 wrote:

fanofcena wrote:


It does makes a differene ... the web - browser must support it.

Oh yeah. Most of the main browsers do support it already though, even if it's only partially

Awkwardly, IE has better HTML5 support than Chrome.  hmm

Um no? Chrome has the most HTML5 support, while IE has the least


Why

Offline

 

#124 2012-09-18 12:35:11

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Javascript topic

lol bumping for my love


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#125 2012-09-25 19:14:35

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Javascript topic

Yay! I am officially learning javascript. :3


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

Board footer