Last active
August 29, 2015 14:05
-
-
Save ramybenaroya/7acdfa8a7526f56032e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
$(function () { | |
$('#main_table .main_table tbody > tr[id]').each(getModifier('http://www.yad2.co.il/Nadlan/rent_info.php?NadlanID=')); | |
$('#tiv_main_table .main_table tbody > tr[id]').each(getModifier('http://www.yad2.co.il/Nadlan/tivrent_info.php?NadlanID=')); | |
function getModifier(urlPrefix) { | |
return function () { | |
var $this = $(this), | |
id = $this.attr('id'), | |
index = id.lastIndexOf('_') + 1, | |
adId = id.substring(index, id.length), | |
$a = $('<a></a>'); | |
$a.html('link'); | |
$a.attr('href', urlPrefix + adId); | |
$a.attr('target', '_blank'); | |
$this.find('[id^="ad_note"]').append($a); | |
}; | |
} | |
}); | |
})(); | |
/* | |
Add this as bookmark: | |
javascript:!function(){$(function(){function a(a){return function(){var b=$(this),c=b.attr("id"),d=c.lastIndexOf("_")+1,e=c.substring(d,c.length),f=$("<a></a>");f.html("link"),f.attr("href",a+e),f.attr("target","_blank"),b.find('[id^="ad_note"]').append(f)}}$("#main_table .main_table tbody > tr[id]").each(a("http://www.yad2.co.il/Nadlan/rent_info.php?NadlanID=")),$("#tiv_main_table .main_table tbody > tr[id]").each(a("http://www.yad2.co.il/Nadlan/tivrent_info.php?NadlanID="))})}(); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment