Zoeken in Support

Vermijd ondersteuningsscams. We zullen u nooit vragen een telefoonnummer te bellen, er een sms naar te sturen of persoonlijke gegevens te delen. Meld verdachte activiteit met de optie ‘Misbruik melden’.

Learn More

Deze conversatie is gearchiveerd. Stel een nieuwe vraag als u hulp nodig hebt.

How can I refer to a filename with a # in it (e.g. A#.png)? Note: "./A#.png" doesn't work.

  • 3 antwoorden
  • 3 hebben dit probleem
  • 19 weergaven
  • Laatste antwoord van cor-el

more options

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" ...
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)

more options

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));
more options

Many thanks cor-el! That works perfectly.

more options

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