web项目实战(一)— —开发中问题收集
2016-04-25 18:56
453 查看
一、让百度地图支持https协议
当前页面是https协议, 但是百度异步加载API给的是http协议的链接,所以会出现如下:
Mixed Content: The page at ‘https://….’ was loaded over HTTPS, but requested an insecure script ‘http://api.map.baidu.com/api?v=1.4&callback=initializeBaidu’. This request has been blocked; the content must be served over HTTPS.
解决方案参考链接:
百度Javascript Api主页:http://lbsyun.baidu.com/index.php?title=jspopular/guide/introduction
1. 如果使用JavaScript API ,需要加一个特殊字段 (s=1):
https://api.map.baidu.com/api?v=2.0&ak=你的密钥& s=1;
【注意】仅JavaScript API V2.0 版本支持https,其他JavaScript API版本均不支持
==>https协议的异步加载的url改为https://api.map.baidu.com/api?v=2.0&ak=your_appkey&s=1&callback=initialize
2、如果是在浏览器端访问,可以设置浏览器加载’不安全的脚本’也可正常加载百度地图
二、webpack打包后打开服务器报 can’t find favicon.icon,找不到网页小图标
1、require my favicon in my main App.js entry file
require(‘../assets/images/favicon.ico’)
或者11、在img在require加载
2、Added a loader configuration that does not scramble the image file names in the build task (per this thread webpack/webpack#1336 (comment))
三、webpack构建后的output输出js为空
参考:https://github.com/coryhouse/react-slingshot/issues/128
当前页面是https协议, 但是百度异步加载API给的是http协议的链接,所以会出现如下:
Mixed Content: The page at ‘https://….’ was loaded over HTTPS, but requested an insecure script ‘http://api.map.baidu.com/api?v=1.4&callback=initializeBaidu’. This request has been blocked; the content must be served over HTTPS.
解决方案参考链接:
百度Javascript Api主页:http://lbsyun.baidu.com/index.php?title=jspopular/guide/introduction
1. 如果使用JavaScript API ,需要加一个特殊字段 (s=1):
https://api.map.baidu.com/api?v=2.0&ak=你的密钥& s=1;
【注意】仅JavaScript API V2.0 版本支持https,其他JavaScript API版本均不支持
==>https协议的异步加载的url改为https://api.map.baidu.com/api?v=2.0&ak=your_appkey&s=1&callback=initialize
2、如果是在浏览器端访问,可以设置浏览器加载’不安全的脚本’也可正常加载百度地图
二、webpack打包后打开服务器报 can’t find favicon.icon,找不到网页小图标
1、require my favicon in my main App.js entry file
require(‘../assets/images/favicon.ico’)
或者11、在img在require加载
<img src={require('../../images/pluralsight-logo.png')} />
2、Added a loader configuration that does not scramble the image file names in the build task (per this thread webpack/webpack#1336 (comment))
{ test: /\.jpe?g$|\.ico$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.wav$|\.mp3$/, loader: 'file-loader?name=[name].[ext]' // <-- retain original file name }
三、webpack构建后的output输出js为空
<script />//错误,script不能自闭合 <script type="text/javascript" src="./bundle.js"></script>
参考:https://github.com/coryhouse/react-slingshot/issues/128
相关文章推荐
- 转 column 'id' in field list is ambiguous的问题
- SpringMvc学习-环境搭建
- git commit --amend用法
- django redis操作
- LeeCode-Remove Duplicates from Sorted List
- 对自定义UITableViewCell的理解
- 线程的基本操作——Java线程的创建
- 关于在Fragment中使用ToolBar导致菜单错乱----惊现巨坑
- 一个数组实现两个栈
- 线程同步(条件变量、信号量)以及死锁
- specgram python
- mysql禁用autocommit
- LeeCode-Single Number II
- LCD驱动中pixclock的计算
- SparkSQL toDF() java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror(Ljava/la
- 两个队列实现一个栈
- 欢迎使用CSDN-markdown编辑器
- Java_语言基础
- java面对大数据 并发时候的分治思想及继承的高级运用
- 关于Message目录的设定