Javascript Problems

tyksweb

New Member
Hey everyone,

I'm new to WedDesignForum, so please bear with me.

I'm trying to create a website for my work while teaching myself how to do this. I have gotten almost everything done, but I'm having troubles with my JavaScript. I am using a JavaScript function as a way to validate a password received from a form. I've been told this isn't the best way to do it, because it can be viewed by everyone, but we are just tryin to divert people who don't need to go to that part of the site as opposed to keeping it completely secure. There isn't any "important" information, its just internal use.

Anyways, I tried setting the javascript to a .js file, and it only works in IE. Then I tried setting it up within the <head> section of the document, and it still only works in IE. A lot of the people that would use it use primarily FireFox.

Does anyone know how to fix this? Any help would be great.

Thanks
 

horearadu

New Member
Hi,

It makes no difference if the code is in a .js file or in the page (that's why you did not notice any change) but is is cleaner to keep the code separated in a .js file.

Browsers don't always run javascript the exact same way so a piece of code that works on a browser is not guaranteed to work on the others too.

I can't help you with the code unless you post it but Firefox has an error console (Tools menu -> Error console) that shows you what errors have occurred in your javascript code. Maybe that can help you fix the code.

Horea Radu

http://www.extendstudio.com
 
Last edited by a moderator:

Healthy

New Member
Another simple way to control access to a certain portion of a website is to use htaccess files. This is of course if you have access to your webserver and its running apache.

This tutorial has some information about it:

httpd.apache.org/docs/1.3/howto/htaccess.html

Look at the "Authentication example" section. Basically it will pop up a dialog box asking for a name and password.
 
Top