# The javascript on my website is not working!!!



## danielstoops (Sep 27, 2008)

Hi,

I have made a website with javascript, yet it is not working for some odd reason. It is not the server because when I display it on my computer (as in I type into Firefox 'C:/file...') the javascript does not work when it should.

An example of the problem is located at mybagshop.co.uk/Products/18181.htm (it is not a virus or anything like that). Near the bottom of the page you will find two sections splitted by an

with paypal stuff inbetween them. They should both be hidden. The top one is named id="one", and the one below is named id='two'. Now, if you look to my javascript file, located at mybagshop.co.uk/websitejavascript.js, you will soon find that they should be hidden, but they are not.

I was wondering if someone could help me out here. Thanks for your help!!!

If I am not allowed to display the links above, please say and I will remove them immediately. This is not a way to obtain visitors by the way, my javascript is seriously not working!


----------



## JimmySeal (Sep 25, 2007)

You've defined functions Hideone() and Hidetwo() but you're not calling them from anywhere. You have to call the functions in order for them to do anything.


----------



## danielstoops (Sep 27, 2008)

I have called the functions. I will double check later today, but I'm pretty sure I have


----------



## JimmySeal (Sep 25, 2007)

Sorry, you're right. Somehow I missed that. But you have unmatched parentheses in the alerts in IRN() and PC(). That might be stopping browsers from processing your JavaScript file.


----------



## danielstoops (Sep 27, 2008)

What do you mean unmatched?


----------



## JimmySeal (Sep 25, 2007)

I mean that they they have an opening parenthesis

```
(
```
, but no closing parenthesis

```
)
```
. You have to have both, not just the opening one.


----------



## danielstoops (Sep 27, 2008)

Thank you very much. I will change it as soon as possible.


----------



## briealeida (Jun 3, 2007)

In the future, JSLint may help. JSLint is one of many JavaScript validators/checkers. I'm not sure if it would have caught this particular problem but it has saved me from pulling my hair out a few times.

http://www.jslint.com


----------

