Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

求助:Uncaught TypeError: Object # has no method 'charCodeAt'

$
0
0

@elor 写道:

想把一个SpriteFrame的资源的url以Object的形式存到数组里面,但是报url错误。其他地方存ur没问题。。。这里不以{}存,只存url也没问题。。。新手不懂,求助。


代码如下:
this.parameter = [];
this.parameter.push({name: this.sceneName});
this.parameter.push({BGUrl: this.sceneSFUrl}); //'SceneBG/SceneBG01'


这是控制台的信息:
Uncaught TypeError: Object #<Object> has no method 'charCodeAt' url.js:54
cc.url.normalize url.js:54
cc.js.mixin.getUuid asset-table.js:53
JS.mixin._getResUuid CCLoader.js:252
JS.mixin.loadRes CCLoader.js:306
addScene CreatorUIController.js:319
cc.Component.EventHandler.cc.Class.emit CCComponentEventHandler.js:120
cc.Component.EventHandler.cc.Class.statics.emitEvents CCComponentEventHandler.js:92
cc.Class._onTouchEnded CCButton.js:436
EventListeners.invoke event-listeners.js:75
_doDispatchEvent event-target.js:66
JS.mixin.dispatchEvent event-target.js:303
_touchEndHandler CCNode.js:177
cc.eventManager._onTouchEventCallback CCEventManager.js:480
cc.eventManager._dispatchEventToListeners CCEventManager.js:605
cc.eventManager._dispatchTouchEvent CCEventManager.js:525
cc.eventManager.dispatchEvent CCEventManager.js:1013
inputManager.handleTouchesEnd CCInputManager.js:153
(匿名函数) CCInputManager.js:436


normalize: function (url) {
if (url.charCodeAt(0) === 46 && url.charCodeAt(1) === 47) {
// strip './'
url = url.slice(2);
就是这里↑
Uncaught TypeError: Object #<Object> has no method 'charCodeAt' url.js:54
}
else if (url.charCodeAt(0) === 47) {
// strip '/'
url = url.slice(1);
}
return url;
},

帖子: 2

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>