javascript code that get the included script path

I have html file like this:

<HTML>
    <HEAD>
        <script Language="JavaScript" Src="xxxx/yyyy/zzz.js"></script>
    </HEAD>
    .
    .
    .
</HTML>

I also have the included JavaScript file "zzz.js" in xxxx/yyyy folder.

My question:
is there any javascript code that will be inside the included file "zzz.js" that gets the path name ("xxxx/yyyy") ?
location.href will not work, because it's related to the whole document url and not to the included script url

it should support JavaScript 1.2 and IE browsers.

Thanks
Ugi_FletzetAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chapattiCommented:
Hi Ugi_Fletzet,

What are you trying to do?
Maybe I can come up with a work-around.

TTFN,

chapatti
0
Ugi_FletzetAuthor Commented:
Hi chapatti,
i need a piece of javascript code (that will be inside the included .js file) that will return the path of this .js file.
"var path=location.href" will not work, because this will return the path of the parent html file and not the path of the included js file.
I'm sure there is an easy way to find it.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Ugi_FletzetAuthor Commented:
I found the answer by myself...

the answer is: document.scripts(x).src
where x is the id of the script or the index of the script.

for example, I need to change the html file to:
<HTML>
 <HEAD>
   <script Language="JavaScript" Src="xxxx/yyyy/zzz.js" id="qqq"></script>
   </HEAD>
   .
   .
   .
</HTML>

and later in the .js file I can do like that:
var path=document.scripts('qqq').src

Now, I need to give that points back to myself, but unfortunately, I think that I can't do that. if anyone know how can I do that, please tell me.
0
lil_puffballCommented:
Just go to 'Community Support' (2nd last topic on the left menu) and post a question requesting this question be deleted and points refunded.
0
Ugi_FletzetAuthor Commented:
thanks
0
SpideyModCommented:
PAQ'd and points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

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.