Mozilla Support में खोजें

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

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

  • 3 प्रत्युत्तर
  • 3
  • 2 views
  • के द्वारा अंतिम प्रतियुतर 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" ...

JimBayne द्वारा सम्पादित

चुने गए समाधान

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));
संदर्भ में यह जवाब पढ़ें 👍 1

All Replies (3)

more options

चयनित समाधान

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

cor-el द्वारा सम्पादित