Javascript doesn't load

Hi,

i have two folder "javascript" and "admin"
a index.php file is placed in "admin" folder and "editor.js" file is placed in "javascript" folder

now i am calling javascript in index.php file with

<script type='text/javascript' src='../javascript/editors.js'></script>

it doesn't load javascript "editor.js" in IE 8  but if i place editor.js file in admin folder then it works fine.





savsoftAsked:
Who is Participating?
 
Hugh McCurdyConnect With a Mentor Commented:
Sounds like the server is running a *nix.  Try making a symbolic link from the actual javascript folder the same folder as index.php or a subfolder to that folder and see what happens.  I have a vague recollection of having a similar problem last spring sometime and moving the files seemed to solve it.  Might work for you too.
0
 
Gurvinder Pal SinghCommented:
are these folders 'admin' and 'javascript' at the same level (siblings to each other)?
is this PHP file being used in an ajax call or it will render the page by itself?
0
 
savsoftAuthor Commented:
yes, these are at same folder. everything is working fine in firefox
no ajax call
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Gurvinder Pal SinghCommented:
please check in the IE8 debugger, if the file is getting loaded or not
0
 
savsoftAuthor Commented:
javascript folder permission is 0775
is this have to change into 777
0
 
Gurvinder Pal SinghCommented:
dont think if this is the problem, since you said that it is working fine in ff
0
 
savsoftAuthor Commented:
debugger gives error "Object expected"
line in index.php is
<a href="#" onmouseover="mopen('m4')" onmouseout="mclosetime()">Test/Quiz <img src="../images/arrow.png"></a>
       
highlighted word is mopen('m4')
which is defined in javascript file

0
 
savsoftAuthor Commented:
yes its work if i placed javascript file in same folder where index.php is placed and also if i placed javascript file in subfolder
0
 
Hugh McCurdyCommented:
That's good.  Is this a solution for you or do you need more help?  If you need more help --

What is the operating system on the server?
Do you understand how to make a symbolic link?
0
 
Gurvinder Pal SinghCommented:
but if you put javascript file folder at the same level as admin folder, then it doesn't work?

even if you do this

<script type='text/javascript' src='../../javascript/editors.js'></script>
0
 
savsoftAuthor Commented:
it doesn't work with
<script type='text/javascript' src='../javascript/editors.js'></script>
<script type='text/javascript' src='../../javascript/editors.js'></script>

but work with

<script type='text/javascript' src='javascript/editors.js'></script>
<script type='text/javascript' src='editors.js'></script>
0
 
savsoftAuthor Commented:
IE is always create problem for developers :(
0
 
Gurvinder Pal SinghCommented:
hmm....so does it work with all the browsers now?
0
 
savsoftAuthor Commented:
yes work with firefox and chrome..
thanks for answering..
0
 
savsoftAuthor Commented:
can you please explain symbolic link
0
 
Gurvinder Pal SinghConnect With a Mentor Commented:
how is <<symbolic link>> link relevant here?

check this anyways
http://kb.iu.edu/data/abbe.html
0
 
EyalCommented:
next time try to use some kind of network monitoring tool (for example fiddler) to see what is the browser requesting from the server.
in firefox you can use firebug and the net tab
0
 
Hugh McCurdyCommented:
gurvinder372, symbolic link can be used to solve the problem or at least a problem similar to the one described (if I add to the problem a bit).

Let's say I have a lot of legacy software that uses a folder right where it is but I have new software that won't but insists that the folder be in the current folder or in a descendant subfolder of the current directory.  A symbolic link allows us to have a folder in "two places at once" and that's just what we need to solve the problem I described.  If we don't or won't have other software that needs the folder where it is now, then we can just move the folder.  But if the folder needs to be 2 or more places at once, symbolic links solve it.

OK, let's say you have these folders
images
javascript
pages

Inside pages you have index.php or index.html and IE won't let you access ../javascript/foo.js but will let you access javascript/foo.js if it exists. You can create a symbolic link from ../javascript to the current folder so that accessing javascript/foo.js will work

This works in a *nix operating system such as Linux, FreeBSD, etc.  It might work in some Microsoft O/S's too but that's outside my experience.  Assuming Linux, if we are currently in the "home" folder the command would be

$ ln -s javascript  pages/javascript

(You don't really need the second javascript but I like it.)

Then you check to make sure it worked

$ ls -l pages
and look for javascript.  It should say something like   javascript -> ../javascript

Sometimes this doesn't work out as well as it seems it would.  In that case, I use the full paths, ie

$ ln -s  /var/htdocs/javascript  /var/htdocs/pages/javascript
That almost never fails to get the job done.
0
 
savsoftAuthor Commented:
Reason didn't find
0
 
Hugh McCurdyCommented:
Didn't find what?  Do you still need help?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.