Opening .JS in Firefox

Learn the basics of how to exploit JavaScript.

Re: Opening .JS in Firefox

Post by keiferdeanbrown on Mon Jul 27, 2009 2:12 pm
([msg=27543]see Re: Opening .JS in Firefox[/msg])

Okay, so if i use the JavaScript version and link it to the website it will run what i programmed for that website?
CYBER HACKER
User avatar
keiferdeanbrown
New User
New User
 
Posts: 37
Joined: Mon Jul 20, 2009 5:38 pm
Blog: View Blog (0)


Re: Opening .JS in Firefox

Post by thedotmaster on Mon Jul 27, 2009 2:36 pm
([msg=27544]see Re: Opening .JS in Firefox[/msg])

keiferdeanbrown wrote:Okay, so if i use the JavaScript version and link it to the website it will run what i programmed for that website?

Sure will.
Image
User avatar
thedotmaster
Contributor
Contributor
 
Posts: 984
Joined: Sun May 04, 2008 4:39 pm
Location: North West UK
Blog: View Blog (1)


Re: Opening .JS in Firefox

Post by keiferdeanbrown on Mon Jul 27, 2009 9:44 pm
([msg=27565]see Re: Opening .JS in Firefox[/msg])

<html>
<head>
<script type='text/javascript' src='test.js'>
function solver(){
var a= document.getElementsByTagName(’INPUT’);
var text = a[0].value;
var prime=0;
var comp=0;
var line=”;
for(i=0;i<text.length;i++){
var c = text.charAt(i);
var comparison =IsNumeric(c);
if(comparison){
var n=Number(c);
if((n!=1)&&(n!=0)){
if(isprime(n)){
prime+=n;
}
if(!isprime(n)){
comp+=n;
}
}
}
else if((line.length<25)&&(comparison==false)){
c=c.charCodeAt(0);
c++;
c=c.toString();
temp=c;
c=String.fromCharCode(temp);
line+=c;
}
}
var sum = 1*prime*comp;
line+=sum;
document.submitform.solution.value=line;
}
function IsNumeric(sText){
var str =”+sText;
var ValidChars = “0123456789?;
var IsNumber=true;
if (ValidChars.indexOf(str.charAt(0)) == -1){
IsNumber = false;
}
return IsNumber;
}
function isprime(n) {
var primer = true;
var ValidChars = “2357?;
var str =n.toString();
if(ValidChars.indexOf(str.charAt(0)) == -1){
primer =false;
}
return primer;
}</script>
</head>
<body>
<!-- www.hackthissite.org/missions/prog/1/ -->
</body>
</html>

how is this wrong?
CYBER HACKER
User avatar
keiferdeanbrown
New User
New User
 
Posts: 37
Joined: Mon Jul 20, 2009 5:38 pm
Blog: View Blog (0)


Re: Opening .JS in Firefox

Post by thedotmaster on Tue Jul 28, 2009 12:24 pm
([msg=27593]see Re: Opening .JS in Firefox[/msg])

Don't know if you know but:
Code: Select all
<!-- this is a HTML comment -->


The way you've done it is not wrong, but the code itself may be. Try looking at your browsers error log (I know Firefox has one, maybe IE doesn't).
Image
User avatar
thedotmaster
Contributor
Contributor
 
Posts: 984
Joined: Sun May 04, 2008 4:39 pm
Location: North West UK
Blog: View Blog (1)


Re: Opening .JS in Firefox

Post by keiferdeanbrown on Tue Jul 28, 2009 1:40 pm
([msg=27597]see Re: Opening .JS in Firefox[/msg])

hmmm... there are too many errors to count :?

there is one more option. how easy is a c program to run?
CYBER HACKER
User avatar
keiferdeanbrown
New User
New User
 
Posts: 37
Joined: Mon Jul 20, 2009 5:38 pm
Blog: View Blog (0)


Re: Opening .JS in Firefox

Post by thedotmaster on Tue Jul 28, 2009 1:43 pm
([msg=27598]see Re: Opening .JS in Firefox[/msg])

keiferdeanbrown wrote:hmmm... there are too many errors to count :?

there is one more option. how easy is a c program to run?


Clear the error window then reload the script. Those errors will be from past websites.
You compile C source code into an executable file, I don't think you're ready for C yet. Learning C is hard and takes a lot of patience.
Image
User avatar
thedotmaster
Contributor
Contributor
 
Posts: 984
Joined: Sun May 04, 2008 4:39 pm
Location: North West UK
Blog: View Blog (1)


Re: Opening .JS in Firefox

Post by keiferdeanbrown on Wed Jul 29, 2009 1:43 am
([msg=27617]see Re: Opening .JS in Firefox[/msg])

yes i have heard c was harder :?

so i might as well stick with javascript, my next guess is that spacing is important in javascript? and my code has no proper spacing. i have yet to learn the spacing functions for javascript (if they're even important)

ps thank you the dot master for your helping me out! i shall now refer to you as "master" :ugeek: with your training i will be awesome!
CYBER HACKER
User avatar
keiferdeanbrown
New User
New User
 
Posts: 37
Joined: Mon Jul 20, 2009 5:38 pm
Blog: View Blog (0)


Re: Opening .JS in Firefox

Post by thedotmaster on Wed Jul 29, 2009 5:14 am
([msg=27622]see Re: Opening .JS in Firefox[/msg])

No worries, glad to be of assistance.
Image
User avatar
thedotmaster
Contributor
Contributor
 
Posts: 984
Joined: Sun May 04, 2008 4:39 pm
Location: North West UK
Blog: View Blog (1)


Previous

Return to Javascript

Who is online

Users browsing this forum: No registered users and 0 guests