我使用 jQtouch 的自动标题扩展,当我更新到 Zepto 1 时它停止工作。扩展帮助将点击的内容复制到顶部的 H1 工具栏。
错误消息:Uncaught TypeError: Object [object Array] has no method 'text'
这里的代码
(function($) {
if ($.jQTouch)
{
$.jQTouch.addExtension(function AutoTitles(jQT){
var titleSelector='.toolbar h1';
$(function(){
$('#jqt').bind('pageAnimationStart', function(e, data){
if (data.direction === 'in'){
var $title = $(titleSelector, $(e.target));
var $ref = $(e.target).data('referrer');
if ($title.length && $ref && $title.text() === ''){
$title.html($ref.text());
未捕获的类型错误:对象 [对象数组] 没有方法“文本”
function setTitleSelector(ts){
titleSelector=ts;
}
return {
setTitleSelector: setTitleSelector
};
});
}
})($);
知道为什么它不再起作用了吗?