How can I refer to a filename with a # in it (e.g. A#.png)? Note: "./A#.png" doesn't work.
Is there a way to get Firefox to load a file when the file name includes the character "#".
I use #'s in filename's to represent musical key signatures, and want to continue to do so.
I've tried using "& # 35 ;" (without the intervening spaces) in place of the #'s but this doesn't work.
Neither of the following file references work with FireFox (both work with IE) ...
... src="./A& # 35 ;.png" ... <= (without the intervening spaces) ... src="./A#.png" ...
Bewerkt door JimBayne op
Gekozen oplossing
The hash (#) is used to specify an anchor name or id in the file.
You need to escape such characters if they are part of the name: A%23.png
javascript:var p='%s';do;while(p=prompt(escape(p),p));Dit antwoord in context lezen 👍 1
Alle antwoorden (3)
Gekozen oplossing
The hash (#) is used to specify an anchor name or id in the file.
You need to escape such characters if they are part of the name: A%23.png
javascript:var p='%s';do;while(p=prompt(escape(p),p));
Many thanks cor-el! That works perfectly.
You're welcome.
You may also need to use encodeURIComponent in some cases:
javascript:var p='%s';do;while(p=prompt(encodeURIComponent(p),p));
Bewerkt door cor-el op