# [SOLVED] js is not found/executed

## jody

Hi

After a complete reinstall of my laptop i wanted to get my web application running again.

I successfully installed apache and php and then went on to copy my webapplication onto my laptop.

my web application is located at /home/jody/progs/magnus2/journal.xhtml:

```
jody@enki ~/progs/magnus2 $ ls -l /home/jody/progs/magnus2/journal.xhtml

-rwxr-xr-x 1 jody jody 1768 Sep  1 20:39 /home/jody/progs/magnus2/journal.xhtml
```

and i made a symbolic link in /var/www/localhost/htdocs:

```
jody@enki ~/progs/magnus2 $ ls -l /var/www/localhost/htdocs/m*

lrwxrwxrwx 1 root root 24 Sep  1 20:38 /var/www/localhost/htdocs/magnus2 -> /home/jody/progs/magnus2
```

When i enter http://127.0.0.1/magnus2/journal.xhtml,

the page appears, but the javascript to be called in the 'body onload' cannot be found. The error console of firefox reports:

```
doInit is not defined

http://127.0.0.1/magnus2/journal.xhtml     Line 1
```

 (firebug says the same thing)

Heres the beginning of journal.xhtml:

```
?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"

     "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

  <script type="text/javascript" src="js/globals.js"/>

  <script type="text/javascript" src="js/stringutils.js"/>

  <script type="text/javascript" src="js/xmlutils.js"/>

  <script type="text/javascript" src="js/htmlelements.js"/>

  <script type="text/javascript" src="js/journal.js"/>

  <link rel="stylesheet" type="text/css" href="css/general.css" />

  <link rel="stylesheet" type="text/css" href="css/zebratable.css" />

  <link rel="stylesheet" type="text/css" href="css/scrolltable.css" />

  <link rel="SHORTCUT ICON" href="images/mag.ico" />

  <title>magnus - payments</title>

</head>

<body onload="doInit();">

```

the function doInit() resides in journal.js, which is exactly where it is supposed to be:

```
jody@enki ~/progs/magnus2 $ ls -l /home/jody/progs/magnus2/js/journal.js

-rwxr-xr-x 1 jody jody 32189 May 10 23:59 /home/jody/progs/magnus2/js/journal.js

```

I don't understand it, because my scripts used to be found and get executed on my old installation.

Can anybody help me?

Thank You

  JodyLast edited by jody on Thu Sep 02, 2010 8:00 pm; edited 1 time in total

----------

## Hu

What is the output of curl -D - http://localhost/magnus2/js/journal.js?  Is there anything relevant in the Apache logs?

----------

## jody

(* very ashamed *)  :Embarassed:   it turned out that a directory above the javascript file had no read permissions for group and others.

After setting that correctly , everxything works again.

Sorry for the panic...

  Jody

----------

## Hu

I suspected something along those lines, which is why I requested the curl output.  :Wink: 

----------

