//in HTML
<img id="image" src="http://1.bp.blogspot.com/-gopq8JTSuxg/UEloesUz1aI/AAAAAAAAEd4/rAwnC-C2AWE/s72/Cacing+Kepanasan.jpg" alt="">
<h2 id="title-container"></h2>
//Javascript code
function getTitle(str) {
var a = str.lastIndexOf('/') + 1,
b = str.lastIndexOf('.');
str = decodeURIComponent(str.substring(a, b));
str = str.replace(/[\+\-\_]/g, " ");
return str;
}
var title = document.getElementById('image').src;
document.getElementById('title-container').innerHTML = getTitle(title);
WHAT'S NEW?
Loading...
Mendapatkan Nama File dari URL
- Judul : Mendapatkan Nama File dari URL
- Penulis : PF studio
- Kategori : Archive
-
Rating : 100% based on 10 ratings. 5 user reviews.
Item Reviewed: Mendapatkan Nama File dari URL
9 out of 10 based on 10 ratings. 9 user reviews.
0 komentar:
Post a Comment