Problem with virtual path

Evyatar
Evyatar used Ask the Experts™
on
this is the line in my htm file

<script language="javascript" src='../adby.js'></script>

in my server ist's work perfect.

in my clien server it doesn't.

we both using Window 2k server and ie6
 
please help

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try replacing with forward slash. Check for the location of the path in the server!

OR

Try,

<!--#include file="../adby.js" -->

Works in both..

Author

Commented:
Believe me. I had checked it hundred times.
the path is all right. the file is fine.
the problem is (i think) on the server.
the same code work properly in other server.

the #include isn't working as well.

thank you.
 
what is the error it is showing,

File not found or Permission denied?
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Commented:
can you locate the file with an absaloute path?

<script src="http://www.experts.com/scripts/file.js">

if you locate the file continue to trancuate the string until you get to the file

<script src="/scripts/file.js"> ... etc.

also you mifgt want to use the html <base href=""> tag
to state the current page position

hope this helps

Author

Commented:
son_robin - I receive no error
It's just the action (Dynamic menu) doesn't occur.

axnon - none of this working
I think that there is some problem in the IIS configuration...

Commented:
do all virtual paths in other applications on the server don't work or just the new added one??

if the absaloute path doeesn't work also it is surley iis or problems with the created directory (try to recreate).
 
make a simple demo, start by trying to put the html and js file in the same directory, call a function the calls the alert function with a message, see if it works.

if so try in a sub-directory and fix the virtual path accordingly.

also check that you upload to the server in an ascii format and not binary.

there are to many ways to go on, need more data.

Commented:
And a link to the page that doesn't work would be good... remember to check the case of the filenames as well. Some servers are very picky about that. Myfile.js isn't the same as myfile.js which isn't the same as Myfile.JS... ;-)

You're using a relative path -- so make sure that you have the .js file in the directory one level up from the page. If it's anywhere else, it's not going to work.

Check it in Netscape, it's got a much better javascript debugger than IE does.
Security Problem with IIS.

Author

Commented:
for Axnon - in that specific file #includes are also not working. I have the same problem with the *.js file in other files. but in other directories it's work properly.
How to upload the server in ascii format?

Webwoman - there nothing wrong with the case of the file name.
if I copy the file to the same directory it's working, otherwise it doesn't.


Thanks
Commented:
you surely are having a specific problem:
1. current directory iis permissions
2. or the file encoding

solutions:
a. first compare in the IIS snap-in, on the project of the virtual folder that all properties are set the same as a project that works.

b. be aware that when saving a file it recevies a file encoding (not the meta display encoding) perhaps because of use of hebrew and saving file as unicode while encoding meta is set to iso-8859-8 - these two clash
!! save all files in ANSI format, if it doesn't help save only JS file as unicode

c. when uploading ftp it depends which ftp client u are using uploading an html file in a binary format scrumbles the code even though it looks correct

good luck
Top Expert 2013

Commented:
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial