Meteor 流星,流星
当我测试?\u转义\u片段时,我得到Meteor 流星,流星,meteor,Meteor,当我测试?\u转义\u片段时,我得到 TypeError: 'undefined' is not a function (evaluating 'document.querySelectorAll.bind(document)') http://localhost:3000/packages/material-design.js?e252ae03c7066a6ce33a348a22662a73cee8811e:75 http://localhost:3000/packages/material
TypeError: 'undefined' is not a function (evaluating 'document.querySelectorAll.bind(document)')
http://localhost:3000/packages/material-design.js?e252ae03c7066a6ce33a348a22662a73cee8811e:75
http://localhost:3000/packages/material-design.js?e252ae03c7066a6ce33a348a22662a73cee8811e:315
http://localhost:3000/packages/material-design.js?e252ae03c7066a6ce33a348a22662a73cee8811e:318
http://localhost:3000/packages/material-design.js?e252ae03c7066a6ce33a348a22662a73cee8811e:778
正文中的html确实出现了,但我没有得到任何元标记,标题前的头部有一个巨大的空白
我跟踪并运行了phantomjs phantomtest.js
❯ phantomjs phantomtest.js[17:50:01]
正在加载页面。。。
页面加载状态:成功
未准备好,流星未定义
我知道了
知道怎么了吗?谢谢 在
spiderable
使用的phantomjs
中,不支持bind
方法。如果您是材料设计
的所有者,我建议将绑定
替换为绑定
。否则,您可以添加到项目中,以确保正确定义了Function.prototype.bind
编辑
要确保浏览器支持bind
将此代码放在代码库中的某个位置:
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
上述实现是从复制/粘贴而来。感谢您的回复。我对网络开发很陌生,你能详细介绍一下如何做polyfill吗?谢谢你的回复。我添加了代码,但它仍然给我相同的错误。Material design是我下载的meteor软件包,有可能在调用该代码之前加载它吗?我有什么办法可以修复它吗?非常感谢您的时间事实上,material design是我的项目中的一个包,所以我不明白为什么polyfill不能解决这个问题…您的“polyfill”应该解决它,但是如果包中的这段特定代码在您的项目之前执行,那么您对此无能为力。我建议在软件包维护者的页面上报告一个问题。终于让它工作了,你的方法工作了。我只需要在软件包之前运行polyfill。非常感谢你。非常感谢。