40 lines
1.4 KiB
JavaScript
40 lines
1.4 KiB
JavaScript
console.log("hub_to_top.js 를 호출함. Target 을 top 에 넣기 위함.");
|
|
|
|
|
|
//동적으로 jquery 로드. 스크립트로 넣거나 manifest 선언하면 작동 안함
|
|
function includeJs(jsFilePath) {
|
|
var js = document.createElement("script");
|
|
js.type = "text/javascript";
|
|
js.src = jsFilePath;
|
|
document.body.appendChild(js);
|
|
}
|
|
includeJs("https://code.jquery.com/jquery-1.12.4.min.js");
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
var link = document.location.href;
|
|
|
|
//전체 페이지 - 일반함수
|
|
//서버에다 JS 파일 만들고 불러오게해서 작업하면 관리하기 편리함
|
|
// request protocol has to be https (SSL Encrypted) since amazon website use secured http
|
|
$("body").append('<script src="https://crossmap.co.kr/chrome.ext.js" language="javascript"></script>');
|
|
|
|
});
|
|
|
|
// Goging to be appended to ....
|
|
// console.log('Extension js file loaded successfully!');
|
|
// (function ($){
|
|
// var detail = {
|
|
// title : $('#productTitle').text().trim(),
|
|
// price : $('#priceblock_ourprice').text().trim(),
|
|
// colors: $.map($('li[id^=color_name_]'), function(n){
|
|
// return {
|
|
// img: $(n).find('img').attr('src'),
|
|
// color: $(n).find('img').attr('alt'),
|
|
// }
|
|
// }),
|
|
// colorsASIN: $.map($('li[id^=color_name_]'), function(n){ return $(n).attr('data-defaultasin') })
|
|
// }
|
|
// console.dir(detail, { depth: null })
|
|
// })(jQuery)
|