You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

You can get filename and its path easily by the string operation function included in JavaScript.

	var url = "https://google.com/chunkang/kurapa.jpg";
	var filename = url.substring(url.lastIndexOf('/')+1); // filename = "kurapa.jpg"
	var path = url.replace(filename,""); // path = "https://google.com/chunkang/"
  • No labels