Skip to content

Commit ec99635

Browse files
author
shengyonggen
committed
修改onload
1 parent 167301d commit ec99635

File tree

5 files changed

+40
-36
lines changed

5 files changed

+40
-36
lines changed

sensorsdata.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sdk.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,23 +2987,25 @@ var heatmap = {
29872987
},
29882988
sendIframeData: function(){
29892989
var me = this;
2990-
window.onload = function(){
2991-
if (window && window.parent && window.parent.window && (window !== window.parent.window)) {
2992-
window.parent.window.postMessage({
2993-
method: 'setHeight',
2994-
params: {
2995-
height: me.getScrollHeight()
2996-
}
2997-
},sd.para.web_url);
2990+
_.bindReady(
2991+
function(){
2992+
if (window && window.parent && window.parent.window && (window !== window.parent.window)) {
2993+
window.parent.window.postMessage({
2994+
method: 'setHeight',
2995+
params: {
2996+
height: me.getScrollHeight()
2997+
}
2998+
},sd.para.web_url);
29982999

2999-
window.parent.window.postMessage({
3000-
method: 'setUrl',
3001-
params: {
3002-
url: location.href
3003-
}
3004-
},sd.para.web_url);
3000+
window.parent.window.postMessage({
3001+
method: 'setUrl',
3002+
params: {
3003+
url: location.href
3004+
}
3005+
},sd.para.web_url);
3006+
}
30053007
}
3006-
};
3008+
);
30073009
},
30083010
prepare: function(todo){
30093011
var match = location.search.match(/sa-request-id=([^&]+)/);

src/sensorsdata.full.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ if(typeof JSON!=='object'){JSON={}}(function(){'use strict';var rx_one=/^[\],:{}
8282
, slice = ArrayProto.slice
8383
, toString = ObjProto.toString
8484
, hasOwnProperty = ObjProto.hasOwnProperty
85-
, LIB_VERSION = '1.7.6';
85+
, LIB_VERSION = '1.7.7';
8686

8787
sd.lib_version = LIB_VERSION;
8888

@@ -3059,23 +3059,25 @@ var heatmap = {
30593059
},
30603060
sendIframeData: function(){
30613061
var me = this;
3062-
window.onload = function(){
3063-
if (window && window.parent && window.parent.window && (window !== window.parent.window)) {
3064-
window.parent.window.postMessage({
3065-
method: 'setHeight',
3066-
params: {
3067-
height: me.getScrollHeight()
3068-
}
3069-
},sd.para.web_url);
3062+
_.bindReady(
3063+
function(){
3064+
if (window && window.parent && window.parent.window && (window !== window.parent.window)) {
3065+
window.parent.window.postMessage({
3066+
method: 'setHeight',
3067+
params: {
3068+
height: me.getScrollHeight()
3069+
}
3070+
},sd.para.web_url);
30703071

3071-
window.parent.window.postMessage({
3072-
method: 'setUrl',
3073-
params: {
3074-
url: location.href
3075-
}
3076-
},sd.para.web_url);
3072+
window.parent.window.postMessage({
3073+
method: 'setUrl',
3074+
params: {
3075+
url: location.href
3076+
}
3077+
},sd.para.web_url);
3078+
}
30773079
}
3078-
};
3080+
);
30793081
},
30803082
prepare: function(todo){
30813083
var match = location.search.match(/sa-request-id=([^&]+)/);

version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var sensorsdata_js_sdk_latest_version = '1.7.6';
1+
var sensorsdata_js_sdk_latest_version = '1.7.7';

vtrack.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)