3 javascript questions[URGENT]

Started by
4 comments, last by remi 19 years, 10 months ago
Hi all, i would like to know how to: 1.Get the current file name 2.Get The folder name where "actual" page has been opened from. 3.Retrieve the pressed key On a Key press event(CTRL key for example)? Thanks!
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"
Advertisement
Sounds like homework.
David Clifton
quote:Original post by Direct
Sounds like homework.

No it's not!
I'm used to program with c/c++(vc++ 6 environment), so i'm not really familiar with javascript. But anyway i have something i would to make in javascript(If you don't mind).

I found that window.location gives the path and the current file name all together, i was wondering if there wasn't something for paths and file names separetely(as in c++).

If you know how to do that why don't you just say it loudly?


[edited by - remi on June 6, 2004 9:16:50 AM]
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"
quote:Original post by remi
quote:Original post by Direct
Sounds like homework.

No it''s not!
I''m used to program with c/c++(vc++ 6 environment), so i''m not really familiar with javascript. But anyway i have something i would to make in javascript(If you don''t mind).

I found that window.location gives the path and the current file name all together, i was wondering if there wasn''t something for paths and file names separetely(as in c++).

If you know how to do that why don''t you just say it loudly?


[edited by - remi on June 6, 2004 9:16:50 AM]


"Sounds like homework" generally means "I''m too lazy to answer".

However, this question sounds like homework, so...


- CD


// Brought to you by Code_Dark
| DShaw Encryption | Righting a wrong- my contribution to the world.
check out www.webmonkey.com, im sure you can find a start there... and a little googling wouldn''t hurt eithor.

-DD
Some people in this forum are really making SICK!

Anyway this is what i did and it's working. I dedicate the following line of codes to people who always pretend they know when they don't!

var FullPath = location.pathname;
var i = FullPath.lastIndexOf("\\");
var Path = FullPath.substring(1,i+1);

[edited by - remi on June 7, 2004 3:15:09 AM]
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"

This topic is closed to new replies.

Advertisement