PageSourceSearch

https://www.yotsuyagakuin.com/common/js/jquery.yclid.js

js yotsuyagakuin.com collected 2026-09-24 09:10:34 UTC 2,157 bytes, 58 lines download raw bytes

1//必ず先にjqueryとjs.cookie.jsを読み込ませてください。
2if(typeof jQuery != "undefined"){
3	jQuery(function(){
4		//▼▼▼ ページ表示時URLにyclidパラメーターがあればcookieに値をyotsuya_yclidという名前で一時保存する。
5		var url = location.href;
6		//クエリ取得
7		if(url.indexOf("?")>=0){
8			params = url.split("?");
9			//クエリ部分にyclidがあればcookie保存
10			if(params[1].indexOf("yclid")>=0){
11				spparams = params[1].split("&");
12				for ( i = 0; i < spparams.length; i++ ) {
13					if(spparams[i].indexOf("yclid")>=0){
14						Cookies.set('yotsuya_yclid', spparams[i], { expires: 7, path: '/'});
15					}
16				}
17			}
18		}
19		
20		//▼▼▼ ページ内の違うドメイン(428255.jp)に飛ぶリンクURLにyclidをクエリで付与する。
21		var yotsuya_yclid = Cookies.get('yotsuya_yclid');
22		//console.log(yotsuya_yclid);
23		if(yotsuya_yclid){
24		
25			//ページ上でクリックまたはタップされた時にリンクURLにパラメーター付与する
26			jQuery("body").on('mousedown',function(){
27				jQuery("a[href*='www.428255.jp']").each(function(){
28				//jQuery("a[href*='428255.jp']").on('click',function(){
29					var now_href = jQuery(this).attr("href");
30					var target_href=yotsuyaYclidLink(now_href);
31					jQuery(this).attr("href",target_href);
32				});
33			});
34		}
35	});
36}
37
38//引数のURLにyclid付与して返す関数
39//aタグ以外(フォーム等)でURLを自動変更できない箇所に手動で対応するための関数としても使える
40function yotsuyaYclidLink(org_url){
41	var return_url = org_url;
42	if(org_url.indexOf("?yclid")<0 && org_url.indexOf("&yclid")<0){
43		var connectStr = "?";
44		var yotsuya_yclid = Cookies.get('yotsuya_yclid');
45		if(yotsuya_yclid){
46			if(org_url.indexOf("?")>-1){
47				connectStr = "&";
48			}
49			if(org_url.indexOf("#")>-1){
50				var connectInd = org_url.indexOf("#");
51				return_url=org_url.slice(0, connectInd)+connectStr+yotsuya_yclid+org_url.slice(connectInd, org_url.length);
52			}else{
53				return_url=org_url+connectStr+yotsuya_yclid;
54			}
55		}
56	}
57	return return_url;
58}

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.