Apicloud_(问题)P54提示错误:Uncaught SyntaxError: Unexpected token ) at main.html : 117
《30天App开发从0到1:APICloud移动开发实战》第54页
打开main.html,在apiready中添加一段代码
api.addEventListener({
name: 'citySelected'
}, function(ret, err){
$api.removeCls($api.byId("arrow"), 'active');
$api.html($api.byId("city"),ret.value.cityName);
api.closeFrame({
name:'citySelectorFrame'
});
});
'active'
);
$api.html (
$api.byId("city"),
ret.value.cityName
)
});
提示错误:Uncaught SyntaxError: Unexpected token ) at main.html : 117
博主发现
'active'
);
$api.html (
$api.byId("city"),
ret.value.cityName
)
});
这里和前边的
$api.removeCls($api.byId("arrow"),'active');
$api.html($api.byId("city"),ret.value.cityName);
重复了,删除掉下边的就好了
这里监听citySelected事件,当选择完城市后,会触发后面的回调函数,关闭城市选择Frame,之后修改箭头的指向并更新城市名称
如果发现更改完这,项目在APP Loader中运行时,选择完后城市选择Frame没有关闭
可以检查是否按课本P53页下方所写的
name: 'cityselectorFrame',
api.openFrame({
name: 'cityselectorFrame',
url: './cityselector_frame.html',
rect: {
x: 0,
y: headerH,
w: 'auto', // 自动填充所在Window的宽度
h: 'auto' // 自动填充所在Window的高度
},
另:第48页、49页的<section>那段是重复的
希望Apicloud平台越做越好把
附上一个自己做的高仿课本开发App网上书店项目 传送门
Apicloud_(问题)P54提示错误:Uncaught SyntaxError: Unexpected token ) at main.html : 117的更多相关文章
- 前端javascript 错误 Uncaught SyntaxError: Unexpected token ILLEGAL
前端控制台报Uncaught SyntaxError: Unexpected token ILLEGAL 错误时,就是非法字符错误,首先检查符号是否正确,不要出现中文标点! 然后检查参数之类的类型是否 ...
- JS缺失错误- Uncaught SyntaxError: Unexpected token <
这种情况,表明,缺少js文件 解决方式:在文件夹下将缺少js文件补足
- 【转】Vue项目报错:Uncaught SyntaxError: Unexpected token <
这篇文章主要介绍了Vue项目报错:Uncaught SyntaxError: Unexpected token <,在引入第三方依赖的 JS 文件时,遇到的一个问题,小编觉得挺不错的,现在分享给 ...
- JS错误:Uncaught SyntaxError: Unexpected token ILLEGAL
$('tbody', '#' + tableId).append('<tr onmouseover="this.style.backgroundColor=\'#eeeeee\'&qu ...
- jsp页面的html代码显示不出来,提示Uncaught SyntaxError: Unexpected token <
jsp页面的html代码显示不出来,提示Uncaught SyntaxError: Unexpected token < <input type="hidden" na ...
- 错误名称:Uncaught SyntaxError: Unexpected token <
在AngularJS框架下: 控制台输出: 1.谷歌:Uncaught SyntaxError: Unexpected token < 2.火狐:SyntaxError: expected ...
- "Uncaught SyntaxError: Unexpected token <"错误完美解决
今天写代码的时候发现了"Uncaught SyntaxError: Unexpected token <" <html>的js错误,而且还是html的第一行,我就 ...
- js报Uncaught SyntaxError: Unexpected token <错误 解决方法
js报Uncaught SyntaxError: Unexpected token <错误 解决方法 错因 js被shiro的拦截器拦下,访问不了 #shiro的配置 shiro: hash-a ...
- Vue-cli3.x在开发环境中(router采用 history模式)出现Failed to resolve async component default: Error: Loading chunk {/d} failed.或者Uncaught SyntaxError: Unexpected token <错误
使用Vue-cli3.x开发环境中(router采用 history模式)出现Failed to resolve async component default: Error: Loading chu ...
随机推荐
- C++实用模板 | 党办大活动计分
#include <iostream> #include <cmath> #include <cstring> #include <string> #i ...
- Laravel-admin 表单提交同时验证俩个以上的字段唯一值
$name = isset(request()->all()['name']) ? request()->all()['name'] : ''; $id = isset(request() ...
- Python 入门 之 面向对象的三大特性(封装 / 继承 / 多态)
Python 入门 之 面向对象的三大特性(封装 / 继承 / 多态) 1.面向对象的三大特性: (1)继承 继承是一种创建新类的方式,在Python中,新建的类可以继承一个或多个父类,父类又可以 ...
- python PEP8常用规范(看完你会感谢我的!)
完整的规范移步传送门 pep8规范 官方文档:[https://www.python.org/dev/peps/pep-0008/](https://www.python.org/dev/peps/p ...
- django-Auth模块(详细介绍)
转载自https://www.cnblogs.com/liuqingzheng/articles/9628105.html 1 Auth模块是什么 Auth模块是Django自带的用户认证模块: 我们 ...
- 11、Nginx反向代理服务
1Nginx代理服务基本概述 1.代理一词并不陌生, 该服务我们常常用到如(代理理财.代理租房.代理收货等等),如下图所示 2.在没有代理模式的情况下,客户端和Nginx服务端,都是客户端直接请求服务 ...
- Linux 日志分析
学会查看日志文件是一件很有意义的事,因为在Linux系统中运行的程序通常会把一些系统消息和错误消息写入对应的日志中,若是一旦出现问题,我们就可以通过查看日志来迅速定位,及时解决故障. 日志的三种类型 ...
- 在vs上开发linux c++
https://www.cnblogs.com/xylc/p/6533716.html?&from=androidqq https://www.jianshu.com/p/8b51a795cb ...
- idea使用问题总结
一.创建Spring 的配置文件需要加入一个pom.xml 的依赖 <dependency> <groupId>org.springframework</groupId& ...
- primer看完了
放假这将近十天吧,终于把C++ Primer中文版第五版大致看完了,然而第四部分(高级主题)还是没有看,感觉那是需要有足够的项目经验再看. 另外,看一遍肯定不够,忘得也会很快,我十分确认今后还会很多次 ...