PageSourceSearch

https://www.ourchinastory.com/common/js/common_function.js?v=20211105

js ourchinastory.com collected 2026-10-02 07:10:07 UTC 1,056 bytes, 41 lines download raw bytes

1function setCookie(cname, cvalue, exdays, _secure) {
2  var d = new Date();
3  d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
4  var expires = "expires="+d.toUTCString();
5  var secure_str = (_secure)? ';secure' : '';
6  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"  + secure_str;
7}
8
9function getCookie(cname) {
10  var name = cname + "=";
11  var ca = document.cookie.split(';');
12  for(var i = 0; i < ca.length; i++) {
13    var c = ca[i];
14    while (c.charAt(0) == ' ') {
15      c = c.substring(1);
16    }
17    if (c.indexOf(name) == 0) {
18      return c.substring(name.length, c.length);
19    }
20  }
21  return "";
22}
23
24function checkCookie(cname) {
25	var cookieStatus = getCookie(cname);
26	if (cookieStatus != "") {
27		return true;
28	} else {
29		return false;
30	}
31}
32
33function getWidgetId(elementId) {
34  const recaptchaBoxes = document.querySelectorAll('.g-recaptcha');
35  const targetBox = document.querySelector('#'+elementId);
36  for (let i = 0; i < recaptchaBoxes.length; i++) {
37	if (recaptchaBoxes[i].id === targetBox.id) {
38	  return i;
39	}
40  }
41}

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.