Opening .JS in Firefox

Learn the basics of how to exploit JavaScript.

Opening .JS in Firefox

Post by keiferdeanbrown on Sun Jul 26, 2009 8:16 am
([msg=27460]see Opening .JS in Firefox[/msg])

i write programs in notepad++ usually in Javascript language but can only run the programs in IE and IE sucks!
so i was wondering if there was a way i could run the programs in firefox.
surely there is, sorry im new.


anyway i don't know how to use the programs i write in the missions :cry:

do i run them in cmd? i took alot of time figuring out how to write a program for mission p2 only to find that i have no idea how to use it after i write it in notepad++
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 Sun Jul 26, 2009 9:47 am
([msg=27465]see Re: Opening .JS in Firefox[/msg])

If you have an external javascript file, you can link it into a HTML file like this:
Code: Select all
<script type='text/javascript' src='script.js'></script>


(You may also be able to do that with the "link" tag, I haven't looked into it but what I posted above will work)
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 Sun Jul 26, 2009 1:00 pm
([msg=27479]see Re: Opening .JS in Firefox[/msg])

i think after researching that it has something to do with the way i made .dct file

what is supposed to be in the .dct file exactly and how exactly are you supposed to make a .dct file for a program

since apparently i am doing it wrong

where am i supposed to put the (chmod 755 name here) command?
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 Sun Jul 26, 2009 1:19 pm
([msg=27481]see Re: Opening .JS in Firefox[/msg])

You seem really confused.
Which operating system are you on, and which language are you trying to code in?
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 Sun Jul 26, 2009 5:17 pm
([msg=27497]see Re: Opening .JS in Firefox[/msg])

yes i am

i am reffering to perl



#!/usr/local/bin/perl
my $filename = “c:/wordlist.txt”;(NOT PART OF CODE i think it has to do with this, since i just opened a blank notepad and saved as wordlist.txt :? )
my %wordlist;
my @curlist;
my $strid;
my $wrd;
my @inlist;
open( LIST, “) {
@curlist = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
chop;
s/\r//;
$word = $_;
foreach (split(//)) {
$curlist[ord]++;
}
$strid = join(”, @curlist);
$wordlist{$strid} = $word;
# print $word . “\t” . $strid . “\n”;
}
close(LIST);
print “word:”;
while () {
chop;
@inlist = ();
foreach (split(/,/)) {
@curlist = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
$wrd = $_;
foreach (split(//)) {
$curlist[ord]++;}
}
$strid = join(”, @curlist);
if (exists($wordlist{$strid})) {
print $wordlist{$strid} . “\n”;
push @inlist, $wordlist{$strid};
} else {
print “*** ” . $wrd . “: not found\n”;
push @inlist, ‘-’;
}
}
print join(’,', @inlist);

i open it in cmd
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 Sun Jul 26, 2009 7:12 pm
([msg=27504]see Re: Opening .JS in Firefox[/msg])

Yep, a perl script should be run on the command line or as CGI (Common Gateway Interface) on a server.
What were you saying about javascript?
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 Sun Jul 26, 2009 8:15 pm
([msg=27510]see Re: Opening .JS in Firefox[/msg])

i tried a program i made in javascript but i couldnt get it to work either
i changed to pearl cause the programming for this instance looked better to me
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 Sun Jul 26, 2009 9:05 pm
([msg=27511]see Re: Opening .JS in Firefox[/msg])

keiferdeanbrown wrote:i tried a program i made in javascript but i couldnt get it to work either
i changed to pearl cause the programming for this instance looked better to me


Well you can't run a perl script in a webbrowser, they're run on the server and the output is displayed to the user. So you'd need to set a server up to be able to run it like that.
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 Sun Jul 26, 2009 10:00 pm
([msg=27513]see Re: Opening .JS in Firefox[/msg])

so the javascript program is easier 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 Mon Jul 27, 2009 5:13 am
([msg=27523]see Re: Opening .JS in Firefox[/msg])

keiferdeanbrown wrote:so the javascript program is easier to run?


Yep, you can either put the Javascript in a html document like:
Code: Select all
<html>
<head>
  <script type='text/javascript'>
   // do something
  </script>
</head>
<body>
  <!-- some html -->
</body>
</html


Or you can have the Javascript in an external .JS file, and link to it like:
Code: Select all
<html>
<head>
  <script type='text/javascript' src='script.js'></script>
</head>
<body>
  <!-- some html -->
</body>
</html


You save both of those bits of code as a .html file, and can open them in your web-browser.
Image
User avatar
thedotmaster
Contributor
Contributor
 
Posts: 984
Joined: Sun May 04, 2008 4:39 pm
Location: North West UK
Blog: View Blog (1)


Next

Return to Javascript

Who is online

Users browsing this forum: No registered users and 0 guests

cron