[楽天] 送料分かりづらい
by
tacamy
2013-09-25 [2013/09/25 06:44:49]
楽天市場の商品ページでこれを使うと、そのショップの送料を画面下部に読み込める。
@@ -12,7 +12,34 @@
var shopname = location.pathname.split('/')[1];
var url = 'http://www.rakuten.co.jp/' + shopname + '/info2.html';
- $.get(url, function(data){
- console.log("Data Loaded: " + data);
- });
+ document.domain = 'rakuten.co.jp';
+
+ $('<iframe></iframe>')
+ .attr({
+ 'src': url
+ })
+ .css({
+ 'height': '300px',
+ 'width': '100%'
+ })
+ .prependTo('body')
+ .bind('load', function() {
+ $(this)
+ .contents()
+ .find('body')
+ .css({
+ 'zoom': '70%'
+ })
+ .find('font:contains("配送について")')
+ .attr({
+ 'id': 'shipping'
+ })
+ .end()
+ .end()
+ .end()
+ .attr({
+ 'src': url + '#shipping'
+ });
+ });
+
})(jQuery);
/*
* @title R送料
* @description 楽天の商品ページでこれを使うと、そのショップの送料を画面上部にiframeで読み込める。
* @include http://*
* @license MIT License
* @require jquery
* @require https://dl.dropboxusercontent.com/u/368057/share/jquery.xdomainajax.js
* @private
*/
(function($) {
var shopname = location.pathname.split('/')[1];
var url = 'http://www.rakuten.co.jp/' + shopname + '/info2.html';
document.domain = 'rakuten.co.jp';
$('<iframe></iframe>')
.attr({
'src': url
})
.css({
'height': '300px',
'width': '100%'
})
.prependTo('body')
.bind('load', function() {
$(this)
.contents()
.find('body')
.css({
'zoom': '70%'
})
.find('font:contains("配送について")')
.attr({
'id': 'shipping'
})
.end()
.end()
.end()
.attr({
'src': url + '#shipping'
});
});
})(jQuery);
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。