Tự động tạo alt và title cho Blogspot chuẩn SEO

5/5 - (2 bình chọn)
Thủ thuật sau đây nhằm giúp bạn tự động tạo ra các thuộc tính Alt và Title cải thiện SEOcho Website/Blogspot, Đây là 1 đoạn JavaScrip rất gọn nhẹ, khi bạn tích hợp vào Website của bạn
nó sẽ tự động thêm các thuộc tính Alt và Title bằng chính tên File ảnh nhé. Vậy nên, các bạn muốn theo ý mình thì tốt nhất nên Đặt tên File ảnh lại nhé.
Ví dụ: Mình có 1 File ảnh là anh_tac_gia_thaiaiti.jpg thì khi đó Alt và Title sẽ hiển thị làanh_tac_gia_thaiaiti
 
Cách thực hiện thủ thuật này khá đơn giản, bạn chỉ cần chèn đoạn Code sau trên </head>
<script src=’http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js?ver=1.6.4′ type=’text/javascript’/>
<script type=’text/javascript’>
//<![CDATA[
$(document).ready(function() {
$(‘img’).each(function(){
var $img = $(this);
var filename = $img.attr(‘src’)
$img.attr(‘title’, filename.substring((filename.lastIndexOf(‘/’))+1, filename.lastIndexOf(‘.’)));
});
});
//]]>
</script>
5/5 - (2 bình chọn)


  1. [url=https://lexaproescitalopram.shop/]generic for lexapro[/url] [url=https://buysingulair.life/]cost of singulair generic[/url] [url=https://stratteratab.com/]buy strattera 80 mg[/url] [url=https://pharmacies.monster/]canadian pharmacy coupon[/url] [url=https://cialis365.com/]online cialis prescription canada[/url] [url=https://lexaprotab.com/]lexapro 5mg cost[/url] [url=https://zofran.icu/]can you buy zofran over the counter[/url]

Comments are closed.