Asp.net+javascript

How do u get the file name from a particular path using Javascript?

Questions by shra1kalyani   answers by shra1kalyani

Showing Answers 1 - 2 of 2 Answers

dinesh

  • Apr 13th, 2013
 

use indexOf

indexOf(path)

rupinder

  • Apr 16th, 2013
 

Code
  1. span style="font-style: italic;">//this gets the full url

  2. //this removes the anchor at the end, if there is one

  3. "#""#"));

  4. //this removes the query after the file name, if there is one

  5. "?""?"));

  6. //this removes everything before the last slash in the path

  7. "/") + 1, url.length);

  8. //return

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions