[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Javascript doesn't load

Posted on 2011-09-20
20
Medium Priority
?
259 Views
Last Modified: 2012-05-12
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.





0
Comment
Question by:savsoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 4
  • +1
20 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36571361
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
 

Author Comment

by:savsoft
ID: 36571376
yes, these are at same folder. everything is working fine in firefox
no ajax call
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36571386
please check in the IE8 debugger, if the file is getting loaded or not
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:savsoft
ID: 36571388
javascript folder permission is 0775
is this have to change into 777
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36571390
dont think if this is the problem, since you said that it is working fine in ff
0
 

Author Comment

by:savsoft
ID: 36571406
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
 
LVL 13

Accepted Solution

by:
Hugh McCurdy earned 300 total points
ID: 36571422
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
 

Author Comment

by:savsoft
ID: 36571456
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
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 36571474
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
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36571543
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
 

Author Comment

by:savsoft
ID: 36571653
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
 

Author Comment

by:savsoft
ID: 36571655
IE is always create problem for developers :(
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36571659
hmm....so does it work with all the browsers now?
0
 

Author Comment

by:savsoft
ID: 36571713
yes work with firefox and chrome..
thanks for answering..
0
 

Author Comment

by:savsoft
ID: 36571716
can you please explain symbolic link
0
 
LVL 40

Assisted Solution

by:Gurvinder Pal Singh
Gurvinder Pal Singh earned 200 total points
ID: 36571722
how is <<symbolic link>> link relevant here?

check this anyways
http://kb.iu.edu/data/abbe.html
0
 
LVL 15

Expert Comment

by:Eyal
ID: 36572621
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
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 36572712
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
 

Author Closing Comment

by:savsoft
ID: 36585472
Reason didn't find
0
 
LVL 13

Expert Comment

by:Hugh McCurdy
ID: 36587128
Didn't find what?  Do you still need help?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question