PageSourceSearch

https://ifc.com.hk/assets/www/js/like-action.js

js ifc.com.hk collected 2026-10-02 03:04:57 UTC 1,169 bytes, 45 lines download raw bytes

1$(document).ready(function() {
2	$('.section-signature .item a').click(function(event) {
3		event.preventDefault();
4		
5		var dishes_id = $(this).attr('like-id');
6		/*
7		var apiURL = '';
8		if(rootURL.split("/en/").length == 2 ){
9			var temp = rootURL.split("/en/");
10			apiURL = temp[0];
11		}else if(rootURL.split("/tc/").length == 2){
12			var temp = rootURL.split("/tc/");
13			apiURL = temp[0];
14		}else if(rootURL.split("/sc/").length == 2){
15			var temp = rootURL.split("/sc/");
16			apiURL = temp[0];
17		}
18		console.log(apiURL);
19		console.log(dishes_id);
20		*/
21		$.ajax({
22			method: "POST",
23			url:rootURL+"/like_api/",
24			data: {cmd:'like',likeID:dishes_id,slug:post_slug},
25			success:function(data) {
26				var result = $.parseJSON(data);
27				//console.log(result);
28				if(result.code==200){
29					var item = $('.section-signature .item a[like-id='+result.ID+']') ;
30					
31					if(result.status=='on'){
32						item.html('<span class="icon-heart"></span>'+result.num);
33					}else{
34						if(result.num>0){
35							item.html('<span class="icon-heart-o"></span>'+result.num);
36						}else{
37							item.html('<span class="icon-heart-o"></span>');
38						}
39					}
40				}
41			}
42		});
43	});
44
45});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.