
网站 前端 SEO
haojiliang
这个作者很懒,什么都没留下…
展开
-
页面输出时用 js 转义替换字符串中的 script 标签,防止 XSS
function stringEncode(str){ var div=document.createElement('div'); if(div.innerText){ div.innerText=str; }else{ div.textContent=str; } return div.i...原创 2018-02-06 09:54:06 · 4432 阅读 · 2 评论 -
WebStorm打断点调试Angular4应用
我用的是WebStorm和Google浏览器调试的Angular4,配置步骤如下:https://blog.iaiot.com/WebStorm-debug-angular.html1.2.3.4.5.现在在Google浏览器或者WebStorm打断点调试都可以了,代码会自动同步到断点位置。在浏览器控制台也可以看到TypeScript代码了。官方文档...原创 2018-01-20 10:49:35 · 4971 阅读 · 3 评论 -
Angular4配置host后执行ng serve报Provided host a.api.***.com could NOT be bound...
问题:Angular4在schema.json中配置host后执行ng serve报Provided host aaa.com could NOT bebound. Please provide a different host address or hostname解决:修改系统host,加入127.0.0.1 aaa.comhttps://blog.iaiot.com/20171...原创 2017-12-06 15:31:10 · 2018 阅读 · 0 评论 -
npm install webpack -g 和 npm install --global vue-cli 失败报错 Unexpected end of JSON input while parsi
https://blog.iaiot.com/npm-install-webpack-g.htmlnpm install webpack -g 和npm install --global vue-cli 失败报错如下:Unexpected end of JSON input while parsing near '...s":"~1.0.0","string_d'npm ERR! A...原创 2018-08-18 11:07:25 · 5033 阅读 · 3 评论 -
点击自定义按钮弹出百度商桥对话框
https://blog.iaiot.com/shangqiao.html原文地址:https://blog.youkuaiyun.com/SeekerTime/article/details/66973659在原文基础上做了一些优化。在页面中已经成功安装了百度商桥的情况下,想通过点击自定义的按钮来弹出百度商桥的对话框,来达到及时沟通和不使页面跳转的目的。有以下解决方法:1、首先需要把你的按钮...转载 2018-08-20 22:29:15 · 4791 阅读 · 0 评论 -
业余 网站 SEO 实践总结
https://blog.iaiot.com/seo.html301 302 的选择:301:永久重定向,搜索引擎在抓取新的内容的同时也将旧的网址替换为了重定向之后的网址。302:临时跳转,蜘蛛会认为新的网址是暂时的,所以搜索引擎会抓取新的内容而保留旧的地址。实例:如果是设备跳转适配,https://www.vhxsl.com/ 转 https://m.vhxsl.com/ 用 30...原创 2018-09-07 13:14:49 · 533 阅读 · 0 评论 -
webstorm 下 angular 英雄指南 报 Tslint Error: Could not find custom rule directory: node_modules/codelyzer
新博客地址:https://blog.iaiot.com/node_modules-codelyzer.htmlpackage.json 中devDependencies 下添加"codelyzer": "~4.5.0"然后 npm install 即可原创 2018-11-22 14:11:36 · 1751 阅读 · 0 评论 -
npm install -g @angular/cli 报 Missing write access to... -4058 ENOENT: no such file or directory
新博客地址:https://blog.iaiot.com/npm-angular-4058.html删掉 C:\Users\adminstrator\AppData\Roaming\npm\node_modules\@angular\cli\node_modules 目录重新运行npm install -g @angular/cli 就可以了...原创 2018-11-22 14:43:36 · 885 阅读 · 0 评论 -
'ng' 不是内部或外部命令,也不是可运行的程序或批处理文件 或 bash: ng: command not found
新博客地址:https://blog.iaiot.com/bash-ng-command-not-found.html重新以管理员权限运行npm install -g @angular/cli如果报错,就先删掉 C:\Users\adminstrator\AppData\Roaming\npm\node_modules\@angular\cli\node_modules 目录,然后再运行...原创 2018-11-22 14:49:13 · 21515 阅读 · 4 评论