View Full Version : saving js files and javascript?

07-05-2007, 05:30 AM
I'm new, this is my first post! I just found out about html editing etc about 1-3 months ago, after seeing youtube embed codes.

I want to use this site as I LOVE it! but I need some help! Most of the scripts here you need to download a .js file or at least a file of some sort, and it says you need to save it to your computer and UPLOAD IT TO A WEBSITE SERVER(???) I AM SOOOO CONFUSED!

I use tripod (tripod.com) web hosting, and yes, the free edition, if you know about how this works, you'll know how to help me, it is NOT all html, which makes it confusing but easy.

my website is http://ligar250.tripod.com

talk to me like I'm a baby! I know nothing! don't use big words or anything and the word "server" REALLY confuses me! THANK-YOU!

07-05-2007, 07:17 AM
Hi, and welcome to the site.

Well, since server confuses you, makes sense to explain it.

A server is just a computer, but usually a powerful one. A server hosts a website. That means that it has the files on it that make up your website, that are then sent out when a user requests them.
Users' computers and servers talk, something like using an instant messenger. The request is sent to the server; the data is sent back to the user; the page is displayed.

To make your website work, there are two main things that need to happen:
1. You need to have your files on the server.
2. You need to have these files linked together correctly.

The first is fairly basic. That is done through uploading. You can use FTP (File Transfer Protocol, which is like HTTP, but instead of viewing websites, you see the files as files and folders), which would basically let you drag and drop. Or, as I think is the case with tripod, some hosts (mostly only the free ones) give you a webpage to upload files. Choose the files, hit upload, etc.

After everything is up (or, actually before, since you can't edit files directly from the server), you'll need to make sure that it all works together.

For example, with an external .js file, for the script to work, you need to tell a .html page to use it, with something like this tag, near the top of the page in the <head> section:
<script type="text/javascript" src="yourfile.js">
(SRC means source, by the way.)

Now, you are using a free page editor (called WYSIWYG-- what you see is what you get, rather than editing the code itself), so you'll need to find a way to edit the code, so you can add that script tag in, unless the editor has an option to do this. I wouldn't really expect the tripod editor to have this.

I hope this helps you get started.

07-05-2007, 08:57 PM
wow! thanks, I can add a html editor to the site, which I do use, as I said earlier, I started HTML when I saw Youtube embed things, and I was amazed.

Sorry I didn't go into great detail but it was late and my mom wanted to get on so I was in a rush to get this posted.

This is what I have done:
I downloaded the file
I put in the code very similar to the one you posted as an example, but of course with the name of the file and everything.

theo only problem is: it didn't work! What I first noticed is it doesn't have a full name like when you upload a picture, only the name of the file its self, so I made it so it had the full name but it didn't work! I then tried to make it so it would have the full name of an EXTRCTED file, nope, maybe the (simple) name of one of the extracted files? but which one?

here's the code I want to use (one of the many, but I need to let you all know what I'm talking about exactly).

thank-you SO MUCH!

07-05-2007, 09:37 PM
It would help to see a link to your page.

On the page, it lists the contents of the zip:
There are two .js files; you'll need to upload both of those, and have a script tag for each (and the copyright notice).
Here's that code:
<script src="mmenu.js" type="text/javascript"></script>
<script src="menuItems.js" type="text/javascript">

* Omni Slide Menu script - � John Davenport Scheuer: http://home.comcast.net/~jscheuer1/
* very freely adapted from Dynamic-FX Slide-In Menu (v 6.5) script- by maXimus
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full original source code

That goes at the top of your page.

The other two files are just for your reference, but you might want to take a look.
the code above is from demo.htm, which has the menus setup. You'll need to copy the formatting there to get the menus to work on your page.
properties.htm is an explanation of how parts of the .js files work. You might want to change some of these, but it could be a bit complex.

07-07-2007, 11:13 PM
could you just write exactly what I need to put in the html area?

I put the "script" at the end of the stuff that was on the page you linked me to. still doesn't work

if I saved it on my computer, and just put the short names of th files, will it just find them or should I put the full name there?

07-08-2007, 06:37 PM
If you aren't that familiar with javascript, editors, files and paths - this is not the script that you should begin with.

Also, a Tripod free host isn't the best environment for javascript. Many free hosts automatically add their own scripts to the pages you put on them. This often interferes with any script you might be trying to use.

I'd suggest starting with something simpler and getting it to work locally (just on your own computer) first. A similar but slightly easier script is:

Dynamic-FX Slide-In Menu (v 6.5) (http://www.dynamicdrive.com/dynamicindex1/davidmenu.htm)

But, if you truly are just starting with javascript, I'd start with something even easier like:

AnyLink Drop Down Menu (http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm)

07-08-2007, 09:43 PM
I agree with John. (Especially since he actually wrote the script you're wanting to use.) This script is one of the more advanced scripts in the DD library, and it's very customizable, but also a bit hard to use if you're not familiar with the process.
The best advice is looking at the source code on the demo page and copying that, but if that's too difficult, I'm not sure what else to suggest.

07-09-2007, 10:34 PM
how do i upload something to my "webpage directory" on tripod?

07-10-2007, 03:55 AM
how do i upload something to my "webpage directory" on tripod?

That is something you should already know. The most common method I know of is via FTP, but hosts like Tripod often have a web interface in addition to that or in place of it. There are other methods that may or may not be available with Tripod.

Your "webpage directory" is the directory on the server where your page is, and is shown in the address bar of the browser (usually ending with the page name itself) while your page is loaded in the browser.

Still, you shouldn't be worrying about that in connection with any script that you haven't gotten to work locally yet.