PDA

View Full Version : Links with space not working


Crimson
10-08-2002, 03:53 AM
I'm building an offline page that links to other folders in my HD. But all my folders have spaces rather than underscores. Links like this "M:/FULL ALBUMS target=_blank" doesn't work because it has space on the URL. Anyway to fix it?

whammy
10-08-2002, 04:37 AM
<a href="C:\My Documents">My Documents</a>

works fine for me... :confused:

Perhaps you aren't using quotes?

Crimson
10-08-2002, 04:39 AM
No, you're giving me HTML... I'm asking for JS. Here's part of the script:

addmenu(menu=["Drives",,,120,1,,style1,0,"left",effect,0,,,,,,,,,,,
,"Music","show-menu=Music",,,1
])
addmenu(menu=["Music",
,,150,1,"",style1,,"left",effect,,,,,,,,,,,,
,"Music","M:/ target=_blank",,,0
,"Full Albums","M:/FULL ALBUMS target=_blank",,,0
])

whammy
10-08-2002, 05:01 AM
Try the escape() function.

Crimson
10-08-2002, 05:02 AM
I'm new in JS, how do I use the escapse function?

Crimson
10-08-2002, 09:07 AM
The escape function didn't work, but it worked with %20. Thanks anways.

whammy
10-08-2002, 04:16 PM
That's what escape() does...

Crimson
10-08-2002, 11:24 PM
An escape() example is: (escape(M:/FULL ALBUMS))

Is the above right? If so, it didn't work with the script above.

adios
10-09-2002, 02:23 AM
<script type="text/javascript" language="javascript">

var x = 'M:/FULL ALBUMS';
alert('Original x: ' + x);
var x = escape(x);
alert('Escaped: ' + x);
x = unescape(x);
alert('Unescaped: ' + x);

</script>

escape()/unescape() operate on strings.

Crimson
10-09-2002, 02:39 AM
That's too much work, I rather stick with the friendly %20 technique.

whammy
10-09-2002, 02:41 AM
I really have no response to that except to recommend VERY seriously that you take a javascript tutorial, and don't be lazy about learning things.

adios posted an example for you to learn from, about how strings work with the escape() and unescape() functions... and you can't even copy and paste it into notepad and view it in your browser? That's not too much work... not to mention he wasted his time, since you don't even seem to care about learning what he showed you.

Believe me, learning this kind of thing now will benefit you in the long run, especially if you ARE lazy - wouldn't you rather be able to have a job sitting behind a computer making lots of money than flipping burgers or waiting on people hand and foot - and barely being able to survive?!?

P.S. adios has taught me a LOT of things...

adios
10-09-2002, 03:34 AM
gracias whammy:D
http://thumb-1.image.altavista.com/image/172691370 (http://www.cnn.com/TECH/computing/9907/15/silicon.teens/)

glenngv
10-09-2002, 04:01 AM
maybe he needs a more specific sample to see which entails too much work :D

path = "C:/My Documents/My Pictures/School Pictures/High School/Date with my crush/";
path = escape(path);
alert(path);

chrismiceli
10-09-2002, 04:05 AM
you could do it easy like this

file:///C:/My document/...

Crimson
10-09-2002, 07:11 PM
Originally posted by whammy

adios posted an example for you to learn from, about how strings work with the escape() and unescape() functions... and you can't even copy and paste it into notepad and view it in your browser? That's not too much work... not to mention he wasted his time, since you don't even seem to care about learning what he showed you.


That is what I did! Don't say anything if you don't know what I did. You were a bit upset above because I didn't find Adios' way more convinient. You got your opinion, and I got mine.

I came here for help, not to start an arguement, so why don't you calm down and put yourself to ease? And stop saying that I'm lazy. I'm not on the level of learning JS yet! I'm just done with HTML. I saw some fancy things in DHTML and wanted to try it out. DHTML has JS in it, and I didn't understand it all. And I'm currently building a page, so I don't want to put it aside and go learn JS and then come back and forget where I am or planned to do with the page. I'm the type of person who likes to finish what I have started.

If I knew JS, I wouldn't be here asking for help. Makes sense doesn't it? Once again, you should stop saying people are lazy this and that. I rather learn JS myself in a few weeks, than ask JS questions for life. But I have not gotten to that level yet. I'm still a beginner at webpage-buildding.

whammy
10-10-2002, 02:03 AM
I apologize... to me it looked like you tried it one way, it didn't work, and you gave up on it without searching on google or trying to figure it out yourself. My bad.

I really wasn't trying to be mean, but lately a lot of people have been posting question after question (after question) without trying anything themselves (and these are people who should already know HTML and JavaScript), and I guess it got to me. I shouldn't have taken it out on you.

I remember being a little frustrated with javascript myself when I was just new to HTML (And it's still frustrating at times, lol). :)

If you want to check out some excellent tutorials on javascript (once you're done with your page), check this out:

http://hotwired.lycos.com/webmonkey/programming/javascript/

And don't forget to check out the tutorials on http://www.javascriptkit.com

We cool now? :)

adios
10-10-2002, 02:34 AM
Just a correction:

It's not "Adios' way" - it's JavaScript. The escape() method is used to convert strings to network-safe characters. That's why it's there. Why not try to understand the language before you start making illiterate generalizations about it? You're right about one thing - what I posted was 'too much work' - for me. It was no work at all for you: don't you know what an example is?

If I knew JS, I wouldn't be here asking for help. Makes sense doesn't it?No. Many skilled programmers post here - to try and understand an unexpected result, explore an area they may be unfamiliar with, get other pairs of eyes working on an intractable problem. Somehow, they generally do it without assuming a demanding attitude. Hard to believe.

whammy doesn't need me to defend him - but he's been helping people on this board (and its predecessors) since - well, probably before you were born. Who have you helped? Try showing some respect.

whammy
10-10-2002, 04:33 AM
Well, adios, I may have gone overboard myself... you get to a point where you think everyone knows all of this stuff, and you tend to forget about the people who are new at programming, and in this case, I was probably taking my personal frustration out on him.

But I should mention... it does take a certain level of understanding to comprehend ANY code you post... since it all seems to be pretty elegant (except for that querystring thread... ) :D

Thanks though. :)