1/** 2 * This is commercial software, only users who have purchased a valid license 3 * and accept to the terms of the License Agreement can install and use this 4 * program. 5 * 6 * Do not edit or add to this file if you wish to upgrade Godomall5 to newer 7 * versions in the future. 8 * 9 * ê³µì© ì¤í¬ë¦½í¸ ë° íë¡í íì ì ì 10 * 11 * @copyright â 2016, NHN godo: Corp. 12 * @link http://www.godo.co.kr 13 */ 14 15 16/** 17 * ìë°ì¤í¬ë¦½í¸ Trimí¨ì 18 * 19 * @deprecated ìë°ì¤í¬ë¦½í¸ 기본 í¨ì í¹ì $.trim() ì¬ì© 20 * @return string ì¢ì° 공백 ì ê±°í 문ìì´ 21 */ 22//String.prototype.trim = function () { 23// return this.replace(/^\s+|\s+$/, ''); 24//}; 25 26/** 27 * ìë°ì¤í¬ë¦½í¸ number_format í¨ì 28 * 29 * @deprecated numeralë¡ ëì²´ 30 * @return string 문ìì´ì ì¸ì리 ë¨ìë¡ ì¼í ì°ê¸° 31 */ 32//String.prototype.number_format = function() 33//{ 34// return this.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,'); 35//}; 36 37// ë©í°ìì ë³ì 기본ì²ë¦¬ 38if (typeof gdCurrencyDecimalFormat === 'undefined') { 39 gdCurrencyDecimal = 0; 40 gdCurrencyDecimalFormat = 0; 41} 42 43// IE9ìì console ê°ì²´ê° ìì´ console ê°ì²´ê° ìë ê²½ì° logë¡ ì¬ì©íëë¡ ì²ë¦¬ 44if (!window.console) console = { 45 log: function () { 46 } 47}; 48 49// IE8 ì´íìì Array.indexOf ì§ìíì§ ìë ê²½ì°ì ëí ëì 50if (typeof Array.prototype.indexOf !== 'function') { 51 Array.prototype.indexOf = function (ele) { 52 return $.inArray(ele, this); 53 }; 54} 55 56// IE8 ì´íìì String.trim ì§ìíì§ ìë ê²½ì°ì ëí ëì 57if (typeof String.prototype.trim !== 'function') { 58 String.prototype.trim = function(){ 59 return $.trim(this); 60 }; 61} 62 63// @qnibus bugfix. toFixed ì¬ì©ì 무조건 ë°ì¬ë¦¼ ì²ë¦¬íë ë¶ë¶ì¼ë¡ ì¸í´ ê³ ë몰5ì ì ì± ê³¼ ë§ì§ ììì toFixed ëì ì¬ì©í´ì¼ í¨ 64if (typeof Number.prototype.toRealFixed !== 'function') { 65 Number.prototype.toRealFixed = function (digits, format) { 66 if (typeof digits === 'undefined') { 67 digits = gdCurrencyDecimal; 68 } 69 if (typeof format === 'undefined') { 70 format = gdCurrencyDecimalFormat; 71 } 72 73 return numeral(Math.floor(this.valueOf() * Math.pow(10, digits)) / Math.pow(10, digits)).format('0,' + format); 74 }; 75} 76 77/** 78 * ì¤í¸ë§ ì¹í ë©ìë 79 * @returns {String} 80 */ 81String.prototype.format = function () { 82 var formatted = this; 83 for (var i = 0; i < arguments.length; i++) { 84 formatted = formatted.replace("{" + i + "}", arguments[i]); 85 } 86 return formatted; 87}; 88 89/** 90 * DOM ë¡ë 91 */ 92$(document).ready(function () { 93 94 // IE 9 ì´í placeholder ì²ë¦¬ 95 if (gd_is_ie() < 10) { 96 $("input, textarea").placeholder(); 97 98 $('form').submit(function(e){ 99 $(this).find("input, textarea").each(function(){ 100 var _name = this.name; 101 var _placeholder = this.getAttribute('placeholder'); 102 103 if (_name && _placeholder) { 104 var _target = document.getElementsByName(_name)[0]; 105 if (_target.value == _placeholder) { 106 _target.value = ''; 107 } 108 } 109 }); 110 }); 111 } 112 113 // jQuery Validator ê¸°ë³¸ê° ì¤ì 114 $.validator.setDefaults({ 115 onfocusout: false, 116 onclick: false, 117 onkeyup: false, 118 errorPlacement: function (error, element) { 119 // do nothing 120 }, 121 invalidHandler: function (form, validator) { 122 var errors = validator.numberOfInvalids(); 123 if (errors) { 124 alert(validator.errorList[0].message); 125 validator.errorList[0].element.focus(); 126 } 127 }, 128 submitHandler: function (form) { 129 form.submit(); 130 } 131 }); 132 133 // jQuery Validator 기본 ë©ìì§ ì¤ì 134 jQuery.extend(jQuery.validator.messages, { 135 required: __("íìí목 ì ëë¤."), 136 remote: __("ì´ íë를 ìì í´ì£¼ì¸ì."), 137 email: __("ì´ë©ì¼ì ì ííê² ì ë ¥í´ì£¼ì¸ì."), 138 url: __("ì í¨íì§ ìì URLì´ ì ë ¥ëììµëë¤."), 139 date: __("ë ì§íìì´ ë§ì§ ììµëë¤."), 140 dateISO: __("ì í¨í ISO íì ì ë ì§ë¡ ë¤ì ì ë ¥í´ì£¼ì¸ì."), 141 number: __("ì«ìë§ ì ë ¥íì¤ ì ììµëë¤."), 142 digits: __("ì«ìë§ ì ë ¥íì¤ ì ììµëë¤."), 143 creditcard: __("ì í¨í ì ì©ì¹´ë ë²í¸ë¡ ë¤ì ì ë ¥í´ì£¼ì¸ì."), 144 equalTo: __("ëì¼í ê°ì ì ë ¥í´ì£¼ì¸ì."), 145 accept: "Please enter a value with a valid extension.", 146 maxlength: jQuery.validator.format(__("ìµë %i ì´í ì ë ¥í´ ì£¼ì¸ì.", "{0}")), 147 minlength: jQuery.validator.format(__("ìµì %i ì´ì ì ë ¥í´ ì£¼ì¸ì.", "{0}")), 148 rangelength: jQuery.validator.format(__("%1$iììì %2$iê¹
148ì§ ì ë ¥ê°ë¥í©ëë¤.", ["{0}", "{1}"])), 149 range: jQuery.validator.format(__("%1$iì %2$iì¬ì´ì ì«ì를 ì ë ¥í´ì£¼ì¸ì.", ["{0}", "{1}"])), 150 max: jQuery.validator.format(__("ìµë %i ì´ì ì ë ¥íì¤ ì ììµëë¤.", "{0}")), 151 min: jQuery.validator.format(__("ìµì %i ì´í ì ë ¥íì¤ ì ììµëë¤.", "{0}")) 152 }); 153 154 //ê²ìì´ 155 $("#frmSearchTop").validate({ 156 submitHandler: function (form) { 157 if ($("#frmSearchTop input[name='adUrl']").val() && $("#frmSearchTop input[name='keyword']").val() == '') document.location.href = $("#frmSearchTop input[name='adUrl']").val(); 158 else form.submit(); 159 }, 160 rules: { 161 keyword: { 162 required: function () { 163 164 if ($("#frmSearchTop input[name='adUrl']").val()) { 165 return false;o 166 } 167 else { 168 return true; 169 } 170 } 171 } 172 }, 173 messages: { 174 keyword: { 175 required: __('ê²ìì´ë¥¼ ì ë ¥íì¸ì.') 176 } 177 } 178 }); 179 180 // ìµê·¼ ê²ìì´ ìì 181 $('.btn_top_search_del').click(function(e){ 182 e.stopPropagation(); 183 $self = $(this); 184 $.post('../goods/goods_ps.php', { 185 'mode': 'delete_recent_keyword', 186 'keyword': $(this).data('recent-keyword') 187 }, function (data, status) { 188 // ê°ì´ ìë ê²½ì° ì±ê³µ 189 if (status == 'success' && data == '') { 190 if ($self.closest('ul').find('li').length == 1) { 191 $self.closest('li').remove(); 192 $('.btn_top_search_all_del').remove(); 193 $('.js_recent_area').append('<dd>' + __('ìµê·¼ ê²ìì´ê° ììµëë¤.') + '</dd>'); 194 } else { 195 $self.closest('li').remove(); 196 } 197 } else { 198 console.log('request fail. ajax status (' + status + ')'); 199 } 200 }); 201 }); 202 203 // ìµê·¼ ê²ìì´ ì ì²´ ìì 204 $('.btn_top_search_all_del').click(function(e){ 205 $.post('../goods/goods_ps.php', { 206 'mode': 'delete_recent_all_keyword' 207 }, function (data, status) { 208 // ê°ì´ ìë ê²½ì° ì±ê³µ 209 if (status == 'success' && data == '') { 210 $('.js_recent_list').find('li').remove() 211 $('.btn_top_search_all_del').remove(); 212 $('.js_recent_area').append('<dd>' + __('ìµê·¼ ê²ìì´ê° ììµëë¤.') + '</dd>'); 213 } else { 214 console.log('request fail. ajax status (' + status + ')'); 215 } 216 }); 217 }); 218 219 // Ajax ìë¬ ë° ì²ë¦¬ ê¸°ë³¸ê° ì¤ì 220 $.ajaxSetup({ 221 beforeSend: function (xhr, settings) { 222 xhr.url = settings.url; 223 xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')); 224 }, 225 complete: function () { 226 gd_trigger_checkbox_ui(); 227 gd_select_remodeling(); 228 gd_checkbox_all(); 229 230 //ì´ë¯¸ì§ ë¡ë© í¥ì ì¬ì© ì í¸ì¶. 231 if ($.isFunction($.fn.lazyload) === true) { 232 setTimeout(function() { 233 $("img.gd_image_lazy").lazyload({threshold:200}); 234 }, 1); 235 } 236 }, 237 error: function (xhr, textStatus, error) { 238 if (xhr.status == '404' && error == 'Not Found') { 239 console.log('[404 Not Found]\nThe requested URL was not found.'); 240 } 241 else if (xhr.status == '500' && error == 'Internal Server Error' && xhr.responseText != '') { 242 console.log(xhr.responseText); 243 } 244 gd_close_layer(); 245 console.log('Ajax Error URL: ' + xhr.url, xhr.responseText); 246 } 247 }); 248 249 $(document).on('click', '.btn_alert_login', function (e) { 250 var target = $(this).attr('id'); 251 e.preventDefault(); 252 alert(__('ë¡ê·¸ì¸íì ì¼ ë³¸ ìë¹ì¤ë¥¼ ì´ì©íì¤ ì ììµëë¤.')); 253 document.location.href = target == undefined ? "../member/login.php" : "../member/login.php?id=" + target; 254 return false;
255 }); 256 257 // 미íì¸ ì ê¸ì íì 258 $('#ghostDepositorBanner').click(function () { 259 var url = '/service/popup_ghost_depositor.php'; 260 var win = gd_popup({ 261 url: url 262 , target: 'ghostDepositorPopup' 263 , width: 630 264 , height: 560 265 , resizable: 'no' 266 , scrollbars: 'no' 267 }); 268 win.focus(); 269 return win; 270 }); 271 272 if ($('.btn_prev').length > 0) { 273 $('.btn_prev').click(function (e) { 274 e.preventDefault(); 275 history.go(-1); 276 }); 277 } 278 279 // ë³µì¬ ê¸°ë¥ 280 // https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/api/ZeroClipboard.md 281 if ($('.gd_clipboard').length) { 282 if (navigator.userAgent.match(/MSIE 8/) !== null) { 283 $('.gd_clipboard').each(function () { 284 $(this).click(function () { 285 alert(__("주ì를 ëëê·¸ í´ì ë³µì¬í´ì£¼ì¸ì")); 286 return false; 287 }); 288 }); 289 } else { 290 var clipboard = new Clipboard('.gd_clipboard'); 291 clipboard.on('success', function (e) { 292 var title = $(e.trigger).attr('title') == undefined ? '' : $(e.trigger).attr('title'); 293 alert('[' + title + '] '+__('ì 보를 í´ë¦½ë³´ëì ë³µì¬íìµëë¤.\nCtrl+V를 ì´ì©í´ì ì¬ì©íì¸ì.')); 294 e.clearSelection(); 295 }); 296 clipboard.on('error', function (e) { 297 console.error('Action:', e.action); 298 console.error('Trigger:', e.trigger); 299 }); 300 } 301 } 302}); 303 304// @qnibus bugfix. toFixed ì¬ì©ì 무조건 ë°ì¬ë¦¼ ì²ë¦¬íë ë¶ë¶ì¼ë¡ ì¸í´ ê³ ë몰5ì ì ì± ê³¼ ë§ì§ ììì toFixed ëì ì¬ì©í´ì¼ í¨ 305if (typeof Number.prototype.toRealFixed !== 'function') { 306 Number.prototype.toRealFixed = function (digits, format) { 307 if (typeof digits === 'undefined') { 308 digits = gdCurrencyDecimal; 309 } 310 if (typeof format === 'undefined') { 311 format = gdCurrencyDecimalFormat; 312 } 313 314 return numeral(Math.floor(this.valueOf() * Math.pow(10, digits)) / Math.pow(10, digits)).format('0,' + format); 315 }; 316} 317 318/** 319 * 기ì¤íí íì¨ë³í 320 * 321 * @param price ê¸ì¡ 322 * @param isFormat í¬ë§·ì¬ë¶ 323 * @returns {*} 324 */ 325function gd_money_format(price, isFormat) { 326 var convertPrice = fx.convert(price).toRealFixed(); 327 if (typeof isFormat !== 'undefined') { 328 if (isFormat) { 329 return numeral().unformat(convertPrice); 330 } 331 } 332 333 return convertPrice; 334} 335 336/** 337 * ì¶ê°íí íì¨ë³í 338 * 339 * @param price ê¸ì¡ 340 * @param isFormat í¬ë§·ì¬ë¶ 341 * @returns {*} 342 */ 343function gd_add_money_format(price, isFormat) { 344 var convertPrice = fx.convert(price, {to: gdCurrencyAddCode}).toRealFixed(gdCurrencyAddDecimal, gdCurrencyAddDecimalFormat); 345 if (typeof isFormat !== 'undefined') { 346 if (isFormat) { 347 return numeral().unformat(convertPrice); 348 } 349 } 350 351 return convertPrice; 352} 353 354/** 355 * ìëì°íì í¸ì¶ 356 * @param array options ì°½ì ë³´ 357 * @return object Window ê°ì²´ 358 */ 359function gd_popup(options) { 360 if (!options.width) options.width = 500; 361 if (!options.height) options.height = 415; 362 var status = new Array(); 363 $.each(options, function (i, v) { 364 if ($.inArray(i, ['url', 'target']) == '-1') { 365 status.push(i + '=' + v); 366 } 367 }); 368 var status = status.join(','); 369 var win = window.open(options.url, options.target, status); 370 return win; 371} 372 373/** 374 * íµì í매ì¬ì ì ìì¸ì¡°íì°½ 375 * @param string businessNo ì¬ì ì ë²í¸ 376 * @return 377 */ 378function gd_popup_bizInfo(businessNo) { 379 var url = 'http://www.ftc.go.kr/info/bizinfo/communicationViewPopup.jsp?wrkr_no=' + businessNo; 380 var win = gd_popup({ 381 url: url 382 , target: 'communicationViewPopup' 383 , width: 750 384 , height: 700 385 , resizable: 'no' 386 , scrollbars: 'yes' 387 }); 388 win.focus(); 389 return win; 390} 391/** 392 * ì¿ í¤ ìì± 393 */ 394function createCookie(name, value, days) { 395 var expires; 396 if (days) { 397 var date = new Date(); 398 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 399 expires = "; expires=" + date.toGMTString(); 400 } else { 401 expires = ""; 402 } 403 document.cookie = name + "=" + value + "; path=/; expires=" + expires + ";"; 404} 405/** 406 * íì ì°½ Cookie 컨í¸ë¡¤ 407 * @param string name íì ì°½ ì´ë¦ (ì½ë_ì°½ì¢ ë¥) 408 * @param object elemnt elemnt 409 * @return 410 */ 411function gd_popup_cookie(name, elemnt) { 412 if (elemnt.checked === true) { 413 createCookie(name,'true',1); 414 var popupKind = name.split('_'); 415 if (popupKind[1] == 'window') { 416 setTimeout('self.close()'); 417 } else { 418 setTimeout("$('#" + name + "').hide()"); 419 } 420 } else { 421 createCookie(name, null); 422 } 423 return; 424} 425 426/** 427 * ë©ì¼ ëë©ì¸ ì í 428 */ 429function gd_select_email_domain(name,select) { 430 if (typeof select === 'undefined') { 431 select = 'emailDomain'; 432 } 433 var $email = $(':text[name=' + name + ']'); 434 var $emailDomain = $('select[id='+select+']'); 435 $emailDomain.on('change', function (e) { 436 var emailValue = $email.val(); 437 var indexOf = emailValue.indexOf('@'); 438 if (indexOf == -1) { 439 if ($emailDomain.val() === 'self') { 440 $email.val(emailValue + '@'); 441 } else { 442 $email.val(emailValue + '@' + $emailDomain.val()); 443 } 444 $email.trigger('focusout'); 445 } else { 446 if ($emailDomain.val() === 'self') { 447 $email.val(emailValue.substring(0, indexOf + 1)); 448 $email.focus(); 449 } else { 450 $email.val(emailValue.substring(0, indexOf + 1) + $emailDomain.val()); 451 $email.trigger('focusout'); 452 } 453 } 454 }); 455} 456 457/** 458 * ëë¡ëª 주ì 찾기 (íì ) 459 * 460 * @author artherot 461 * @param string zoneCodeID zonecode input ID 462 * @param string addrID address input ID 463 * @param string zipCodeID zipcode input ID 464 */ 465function gd_postcode_search(zoneCodeID, addrID, zipCodeID) { 466 var win = gd_popup({ 467 url: '../share/postcode_search.php?zoneCodeID=' + zoneCodeID + '&addrID=' + addrID + '&zipCodeID=' + zipCodeID, 468 target: 'postcode', 469 width: 540, 470 height: 700, 471 resizable: 'yes', 472 scrollbars: 'yes' 473 }); 474 win.focus(); 475 return win; 476} 477 478/** 479 * ë¹íì ê°ì¸ì ë³´ ìì§í목 ëì ë§í¬ 480 */ 481function gd_redirect_collection_agree() { 482 window.open('/service/private.php'); 483} 484 485/** 486 * íì¼ ì ë¡ë ê°ì²´ 487 */ 488var gdAjaxUpload = { 489 upload : function(data) { 490 var formData = new FormData(); 491 for (var k in data.params){ 492 if (data.params.hasOwnProperty(k)) { 493 formData.append(k, data.params[k]); 494 } 495 } 496 if(data.onbeforeunload){ 497 window.onbeforeunload = data.onbeforeunload; 498 data.formObj.on("submit", function () { 499 window.onbeforeunload = null; 500 }); 501 } 502 503 if(data.formObj.find('[name=uploadType][value=ajax]').length < 1) { 504 data.formObj.append('<input type="hidden" name="uploadType" value="ajax" >'); 505 }
506 var index = data.thisObj.closest('form').find('input:file').index(data.thisObj); 507 formData.append('uploadFile', data.thisObj[0].files[0]); 508 509 $.ajax({ 510 url: data.actionUrl, 511 type: 'POST', 512 data: formData, 513 async: false, 514 cache: false, 515 contentType: false, 516 processData: false, 517 dataType: 'json', 518 success: function (returnData) { 519 returnData['index'] = index; 520 if(returnData.result == 'ok') { 521 if ($('input[name="uploadFileNm[' + index + ']"]').length == 0) { 522 data.formObj.append("<input type='hidden' name='uploadFileNm[" + index + "]' value='" + returnData.uploadFileNm + "'>"); 523 data.formObj.append("<input type='hidden' name='saveFileNm[" + index + "]' value='" + returnData.saveFileNm + "'>"); 524 } 525 else { 526 $("input[name='uploadFileNm[" + index + "]']").val(returnData.uploadFileNm); 527 $("input[name='saveFileNm[" + index + "]']").val(returnData.saveFileNm); 528 } 529 if(typeof data.successAfter == 'function') { 530 data.successAfter(returnData); 531 } 532 } 533 else if(returnData.result == 'cancel'){ 534 if ($("input[name='uploadFileNm[" + index + "]']").length > 0) { 535 $("input[name='uploadFileNm[" + index + "]']").remove(); 536 $("input[name='saveFileNm[" + index + "]']").remove(); 537 } 538 } 539 else { 540 gdAjaxUpload.isSuccess = false; 541 $('label[for=attach' + (index + 1) + '] .text').val(''); //íì¼ìì¤í í ì¤í¸ ë¹ê° ì²ë¦¬ 542 alert(returnData.errorMsg); 543 if(typeof data.failAfter == 'function') { 544 data.failAfter(returnData); 545 } 546 } 547 } 548 }); 549 } 550}; 551 552/** 553 * íë ì 리ì¬ì´ì¦ 554 */ 555function gd_resize_frame(obj) { 556 var iframeHeight = (obj).contentWindow.document.body.clientHeight; 557 (obj).height = iframeHeight + 80; 558} 559 560/** 561 * íìë¤ì´ë¡ë ì¿ í° ë§í¬ ë¤ì´ ë°ê¸° 562 * 563 * @param couponNo 564 */ 565function couponLinkDown(couponNo) { 566 var params = { 567 mode: "couponDownLink", 568 couponCode: couponNo 569 }; 570 $.ajax({ 571 method: "POST", 572 cache: false, 573 url: "/mypage/coupon_link_down.php", 574 data: params, 575 success: function (data) { 576 result = JSON.parse(data); 577 alert(result['msg']); 578 }, 579 error: function (data) { 580 alert(result['msg']); 581 } 582 }); 583} 584 585/** 586 * PG ê´ë ¨ ììì¦ ë³´ê¸° 587 * 588 * @author artherot 589 * @param string modeStr ì¹´ë, íê¸ììì¦ ì¢ ë¥ (card, cash) 590 * @param string orderNo 주문 ë²í¸ 591 */ 592function gd_pg_receipt_view(modeStr, orderNo) { 593 // ì¬ì´ì¦ë¥¼ 미리 ì¤ì - ìëì¼ë¡ ì°½ì´ ì»¤ì§ì§ ìì 미리 ì¤ì í¨ 594 var preWidth = 430; 595 var preHeight = 700; 596 597 // 미리 íì ì°½ì ëì°ê¸° 598 var prePopupData = { 599 'url': 'about:blank', 600 'target': 'show_receipt', 601 'width': preWidth, 602 'height': preHeight 603 }; 604 var show_receipt = gd_popup(prePopupData); 605 606 // ê° PGë³ ììì¦ íì ì°½ 607 $.post('../share/show_receipt.php', { 608 mode: modeStr, 609 orderNo: orderNo 610 }, function (data) { 611 var infoData = data; 612 if (typeof infoData['error'] == 'undefined') { 613 gd_popup(infoData); 614 } 615 else { 616 alert(infoData['error']); 617 show_receipt.close(); 618 } 619 }, 'json'); 620} 621 622/*** IE ë²ì ì²´í¬ ***/ 623function gd_is_ie () { 624 var nav = navigator.userAgent.toLowerCase(); 625 if (nav.indexOf('msie') != -1) { 626 return parseInt(nav.split('msie')[1]); 627 } else { 628 return false; 629 } 630} 631 632/** 633 * 쿼리ì¤í¸ë§ê° 찾기 634 * @param query 635 * @param variable 636 * @returns {string} 637 */ 638function gd_get_query_variable(query, variable) { 639 var vars = query.split('&'); 640 for (var i = 0; i < vars.length; i++) { 641 var pair = vars[i].split('='); 642 if (decodeURIComponent(pair[0]) == variable) { 643 return decodeURIComponent(pair[1]); 644 } 645 }
646 console.log('Query variable %s not found', variable); 647} 648 649/** 650 * ëì ì¤í¬ë¦½í¸ ë°ì¸ë© (ì¤í¬ë¦½í¸ ë¡ë© í ë©ìë ì¤íëëë¡ ì²ë¦¬) 651 * 652 * @author Jong-tae Ahn 653 * @param number 654 * @param places 655 * @param symbol 656 * @param thousand 657 * @param decimal 658 * @returns {string} 659 */ 660function add_script(url, callback) { 661 var done = false; // ì¤í¬ë¦½í¸ ë¡ë© ì¬ë¶ 662 var head = document.getElementsByTagName("head")[0] || document.documentElement; 663 var script = document.createElement("script"); 664 665 //script.charset = 'UTF-8'; 666 script.src = url; 667 script.onload = script.onreadystatechange = function () { 668 if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) { 669 done = true; 670 callback(); 671 672 // IEìì ë©ëª¨ë¦¬ ëì ë°©ì§ë¥¼ ìí ì²ë¦¬ 673 script.onload = script.onreadystatechange = null; 674 if (head && script.parentNode) { 675 head.removeChild(script); 676 } 677 } 678 }; 679 680 // Use insertBefore instead of appendChild to circumvent an IE6 bug. 681 // This arises when a base node is used (#2709 and #4378). 682 head.insertBefore(script, head.firstChild); 683} 684 685 686 687 688/*** ì¤í ë¦¬ì§ ì§ì ì¬ë¶ ***/ 689function supports_html5_storage() { 690 try { 691 return 'localStorage' in window && window['localStorage'] !== null; 692 } catch (e) { 693 return false; 694 } 695} 696 697/*** ì¸ì ì¤í ë¦¬ì§ ì ì¥ ***/ 698function saveSession(control_key, control_value) { 699 if (!supports_html5_storage()) { 700 createCookie(control_key, control_value, 7); 701 } else { 702 sessionStorage[control_key] = control_value; 703 } 704}; 705 706/*** ì¸ì ì¤í ë¦¬ì§ ë¡ë ***/ 707function loadSession(control_key) { 708 var control_value; 709 if (!supports_html5_storage()) { 710 control_value = readCookie(control_key); 711 } else { 712 control_value = sessionStorage[control_key]; 713 } 714 return control_value; 715}; 716 717/*** ë¡ì»¬ ì¤í ë¦¬ì§ ì ì¥ ***/ 718function saveVal(control_key, control_value) { 719 if (!supports_html5_storage()) { 720 createCookie(control_key, control_value, 7); 721 } else { 722 localStorage.setItem(control_key, control_value); 723 } 724}; 725 726/*** ë¡ì»¬ ì¤í ë¦¬ì§ ë¡ë ***/ 727function loadVal(control_key) { 728 var control_value; 729 if (!supports_html5_storage()) { 730 control_value = readCookie(control_key); 731 } else { 732 control_value = localStorage.getItem(control_key); 733 } 734 return control_value; 735};
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.