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 ...
随机推荐
- Codeforces 1194F. Crossword Expert
传送门 考虑每一个位置的期望贡献 $P[i]$ 对于第 $k$ 个位置,设 $sum=\sum_{i=1}^{k}t[k]$,那么 $T-sum$ 即为用最短时间完成完位置 $k$ 后多出来的空闲时间 ...
- 第一章 T-SQL查询和编程基础 T-SQL语言基础(1)
T-SQL查询和编程基础(1) 1.1 理论背景 SQL是为查询和管理关系型数据库管理系统(RDBMS)中的数据而专门设计的一种标准语言. RDBMS是一种基于关系模型的数据库管理系统,关系模型则是一 ...
- Nginx(高并发)
Nginx(engine x)高性能和反向代理的web服务器反向代理:保护客户资源,只要是http协议都可以Web服务器:IIS 阿帕奇 NginxNginx可以作为负载均衡(NLB只支持Http)我 ...
- 不基于比较的排序算法:Counting-sort和Radix-sort
- docker toolbox的redis 配置主从及哨兵模式保证高可用
redis 的缓存中间件安装方法,简单举例如下: 环境: docker toolbox 一 主从模式1 搜索redis镜像 docker search redis2 拉取镜像docker pul ...
- Javascript问题集锦
1.Date.parse()函数兼容性问题: IE Chrome Firefox Date.parse("07-17-2019") 1563292800000 15632928 ...
- weex animation模块 使用指南
本节学习目标 掌握内置组件animation的使用 我们在开发应用的时候,常常需要增加一些动画效果,来提高用户体验,经常用到的一些动画效果如下 平移 旋转 缩放 背景颜色改变 组件透明图 weex 提 ...
- symfony3 yml配置文件详解
AppBundle\Entity\BlogComment: //映射实体 type: entity //类型 repositoryClass: AppBundle\Repository ...
- SSD学习笔记
目标检测算法——SSD:Single Shot MultiBox Detector,是一篇非常经典的目标检测算法,十分值得阅读和进行代码复现,其论文地址是:https://arxiv.org/abs/ ...
- C# 文件操作的一些小点子
1. 判断指定文件是否存在: bool System.IO.File.Exits(string fliePath);