内容的栏目 * @param int $category 0列表 1频道 2单页 3外链 * @return array */ function category_list($forumlist, $model = 0, $display = 0, $category = 0) { if (empty($forumlist)) return NULL; static $cache = array(); $key = $model . '-' . $display . '-' . $category; if (isset($cache[$key])) return $cache[$key]; if ($display) { foreach ($forumlist as $k => $val) { if (1 == $val['display'] && 1 == $val['type'] && $val['category'] == $category) { $cache[$key][$k] = $val; } } } else { foreach ($forumlist as $k => $val) { if (1 == $val['type'] && $val['category'] == $category) { $cache[$key][$k] = $val; } } } return empty($cache[$key]) ? NULL : $cache[$key]; } /** * @param $forumlist 所有版块列表 不分模型 * @param int $display 0全部CMS栏目 1在首页和频道显示内容的栏目 * @param int $category 0列表 1频道 2单页 3外链 * @return array */ function category_list_show($forumlist, $display = 0, $category = 0) { if (empty($forumlist)) return NULL; static $cache = array(); $key = $display . '-' . $category; if (isset($cache[$key])) return $cache[$key]; if ($display) { foreach ($forumlist as $k => $val) { if (1 == $val['display'] && 1 == $val['type'] && $val['category'] == $category) { $cache[$key][$k] = $val; } } } else { foreach ($forumlist as $k => $val) { if (1 == $val['type'] && $val['category'] == $category) { $cache[$key][$k] = $val; } } } return empty($cache[$key]) ? NULL : $cache[$key]; } /** * @param $forumlist 所有版块列表 * @return mixed BBS栏目数据(仅列表) 尚未开放bbs频道功能 */ function forum_list($forumlist) { if (empty($forumlist)) return array(); static $cache = array(); if (isset($cache['bbs_forum_list'])) return $cache['bbs_forum_list']; $cache['bbs_forum_list'] = array(); foreach ($forumlist as $_fid => $_forum) { if ($_forum['type']) continue; $cache['bbs_forum_list'][$_fid] = $_forum; } return $cache['bbs_forum_list']; } // 导航显示的版块 function nav_list($forumlist) { if (empty($forumlist)) return NULL; static $cache = array(); if (isset($cache['nav_list'])) return $cache['nav_list']; foreach ($forumlist as $fid => $forum) { if (0 == $forum['nav_display']) { unset($forumlist[$fid]); } } return $cache['nav_list'] = $forumlist; } ?>javascript - 'jQuery is not defined' in Meteor app? - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - 'jQuery is not defined' in Meteor app? - Stack Overflow

programmeradmin0浏览0评论

Seem to be getting a strange error after downloading semantic-ui and I can't get it to run when I've chosen what I do, and do not want in my custom.semantic.json file. I've tried also downloading/installing the jQuery package to my directory with no joy. Error message below.

>/Users/Kyle/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
                        throw(ex);
                              ^

> ReferenceError: jQuery is not defined
>     at app/definitions/behaviors/api.js:1081:5
>     at app/definitions/behaviors/api.js:1083:3
>     at /Users/Kyle/Desktop/portfolio/.meteor/local/build/programs/server/boot.js:222:10
>     at Array.forEach (native)
>     at Function._.each._.forEach (/Users/Kyle/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
>     at /Users/Kyle/Desktop/portfolio/.meteor/local/build/programs/server/boot.js:117:5
> Exited with code: 8 Your application is crashing. Waiting for file
> change.

Seem to be getting a strange error after downloading semantic-ui and I can't get it to run when I've chosen what I do, and do not want in my custom.semantic.json file. I've tried also downloading/installing the jQuery package to my directory with no joy. Error message below.

>/Users/Kyle/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
                        throw(ex);
                              ^

> ReferenceError: jQuery is not defined
>     at app/definitions/behaviors/api.js:1081:5
>     at app/definitions/behaviors/api.js:1083:3
>     at /Users/Kyle/Desktop/portfolio/.meteor/local/build/programs/server/boot.js:222:10
>     at Array.forEach (native)
>     at Function._.each._.forEach (/Users/Kyle/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
>     at /Users/Kyle/Desktop/portfolio/.meteor/local/build/programs/server/boot.js:117:5
> Exited with code: 8 Your application is crashing. Waiting for file
> change.
Share Improve this question edited Jul 19, 2015 at 21:02 Christian Fritz 21.4k3 gold badges48 silver badges81 bronze badges asked Jul 19, 2015 at 18:58 Kyle BoltonKyle Bolton 231 silver badge5 bronze badges 11
  • Meteor es with jQuery. How did you install Semantic-UI? Did you use this package? atmospherejs./semantic/ui – fuzzybabybunny Commented Jul 20, 2015 at 5:38
  • Yep, I know it does, which is why I'm wondering why I'm getting this issue. I installed semantic-UI through mand line into my Meteor directory and then created the custom.semantic.json file, as soon as it scaffolds out the app and creates the folders I start getting jQuery issues. Weird one! And yep, right from Atmosphere JS. – Kyle Bolton Commented Jul 20, 2015 at 9:08
  • Well, looking at the docs under Usage: github./Semantic-Org/Semantic-UI-Meteor - it seems that you want to first create an empty custom.semantic.json, and only then do you start Meteor. After Meteor has started you can then edit custom.semantic.json. – fuzzybabybunny Commented Jul 20, 2015 at 9:14
  • I have done this, the file creates and then scaffolds out the rest of app, then I get that error. I have read the documentation umpteen times. – Kyle Bolton Commented Jul 20, 2015 at 10:25
  • What displays when you do meteor list? Are you doing something like accidentally loading jQuery twice, the second time maybe being from code in your HTML? I just installed the Semantic-UI package and it starts right up. – fuzzybabybunny Commented Jul 20, 2015 at 10:40
 |  Show 6 more ments

1 Answer 1

Reset to default 11

In Meteor, this happens when custom.semantic.json is inside the root's lib/ folder. Thus, Semantic-UI generates all its folders and files in lib/ which is loaded before any of its core dependencies, such as jQuery.

The solution is to place custom.semantic.json in an app folder, such as client/lib/semantic-ui/.

发布评论

评论列表(0)

  1. 暂无评论