Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

计算器demo跑不起来 #180

Closed
jonnywang opened this Issue · 2 comments

2 participants

@jonnywang

修改了init.js

seajs.config({
alias: {
'jquery': 'http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js'
},
debug:true
});

打开页面是提示 $ is not a function

显然是jquery没有成功引入,查看firebug是有请求到http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js,
调试使用sea-debug.js

发现走到
else if (util.isString(id)) {
uri = RP.resolve(id, context);
mod = data.memoizedMods[uri];
}

mod为null,

请教如何解决

@lifesinger
Owner

Hi, Jonny Wang:

使用 SeaJS 加载 JS 文件时,需要 JS 文件是符合 SeaJS 支持的模块规范的文件。对于 jQuery,封装好的文件可以在这里下载:

https://github.com/seajs/modules/tree/gh-pages/jquery

或者直接引用:

seajs.config({
  alias: {
    'jquery': 'http://modules.seajs.org/jquery/1.7.2/jquery.js'
  }
});
@lifesinger lifesinger closed this
@jonnywang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.