window.open() & iframe & tab
window.open() & iframe & tab
window.open() open pages in the same window / tab
https://stackoverflow.com/questions/8454510/open-url-in-same-window-and-in-same-tab
https://developer.mozilla.org/zh-CN/docs/Web/API/Window/open
https://developer.mozilla.org/zh-CN/docs/Web/API/Window/open#Syntax
autoOpenAlink(e) {
e.preventDefault();
let url = this.url;
window.open(url, "iframe 测试页面");
// window.open(url, "_self");
},
https://medium.com/the-metric/links-should-open-in-the-same-window-447da3ae59ba
https://www.runoob.com/jsref/met-win-open.html
bug
vue & qrcode
https://www.cnblogs.com/xgqfrms/p/10715627.html
https://github.com/soldair/node-qrcode#es6es7
https://www.npmjs.com/package/qrcode#es6es7
const QRCode = require("qrcode");
setTimeout(() => {
// const QRCode = require("qrcode");
let canvas = document.getElementById("qrcode_canvas");
let url = this.url;
QRCode.toCanvas(
canvas,
url,
function (error) {
if (error) {
console.error(error);
} else {
console.log("success!");
}
}
);
}, 0);
import QRCode from 'qrcode'
// With promises
QRCode.toDataURL('I am a pony!')
.then(url => {
console.log(url)
})
.catch(err => {
console.error(err)
})
// With async/await
const generateQR = async text => {
try {
console.log(await QRCode.toDataURL(text))
} catch (err) {
console.error(err)
}
}
canvas
canvas width height
https://developer.mozilla.org/zh-CN/docs/Web/API/Canvas_API
setTimeout(() => {
// const QRCode = require("qrcode");
let canvas = document.getElementById("qrcode_canvas");
canvas.width = 100;
canvas.height = 100;
let url = this.url;
QRCode.toCanvas(
canvas,
url,
function (error) {
if (error) {
console.error(error);
} else {
console.log("success!");
}
}
);
}, 0);
https://stackoverflow.com/questions/4938346/canvas-width-and-height-in-html5
solution
https://github.com/soldair/node-qrcode#width
https://github.com/soldair/node-qrcode#options
setTimeout(() => {
// const QRCode = require("qrcode");
let canvas = document.getElementById("qrcode_canvas");
// canvas.width = 100;
// canvas.height = 100;
// canvas.style.width = "100px";
// canvas.style.height = "100px";
let url = this.url;
QRCode.toCanvas(
canvas,
url,
{
width: 120,
},
function (error) {
if (error) {
console.error(error);
} else {
console.log("success!");
}
}
);
}, 0);
ok

window.open() & iframe & tab的更多相关文章
- 利用window.name+iframe跨域获取数据详解
详解 前文提到用jsonp的方式来跨域获取数据,本文为大家介绍下如何利用window.name+iframe跨域获取数据. 首先我们要简单了解下window.name和iframe的相关知识.ifra ...
- window.open() & iframe
window.open() & iframe https://www.w3schools.com/jsref/met_win_open.asp window.open(URL, name, s ...
- iframe 跨域问题解决方案 利用window.name+iframe跨域获取数据详解
详解 前文提到用jsonp的方式来跨域获取数据,本文为大家介绍下如何利用window.name+iframe跨域获取数据. 首先我们要简单了解下window.name和iframe的相关知识.ifra ...
- window.frames && iframe 跨页面通信
1.定义 frames[]是窗口中所有命名的框架组成的数组.这个数组的每个元素都是一个Window对象,对应于窗口中的一个框架. 2.用法 假设iframe 是一个以存在的 iframe 的 ID 和 ...
- js实现跨域(jsonp, iframe+window.name, iframe+window.domain, iframe+window.postMessage)
一.浏览器同源策略 首先我们需要了解一下浏览器的同源策略,关于同源策略可以仔细看看知乎上的一个解释.传送门 总之:同协议,domain(或ip),同端口视为同一个域,一个域内的脚本仅仅具有本域内的权限 ...
- js 跨域复习 window.name | window.domain | iframe | Jsonp
引起跨域的原因: 浏览器的同源策略,但是当你要发送请求的时候,出于安全性问题,浏览器有严格的要求,必须协议,域名,端口都相同,这个就是同源策略. 影响:a通过js脚本向b发送ajax请求,不同源就会报 ...
- window.frames[iframe].document 在ie可以用,在360、火狐中都不兼容?
<iframe id="myf" scrolling="auto" frameborder="0" src="" ...
- 利用window.name+iframe跨域获取接口数据
最近做了一个表单广告,需要从接口读取数据,做完发现谷歌火狐下正常,360兼容和IE浏览器无法获取数据,以下是鲜明的对比: 调试发现报错了: 然后开发把接口改成支持windowname,一开始 ...
- js控制父子页面传值(iframe和window.open)
在html中,window对象代表浏览器中一个打开的窗口,就像我们C/S中做窗体一样,在该页的window对象就是new了一个新的窗体对象. 就像做C/S开发一样,浏览器是一个软件,每一个网页都是它n ...
随机推荐
- 深度学习之卷积神经网络(CNN)详解与代码实现(一)
卷积神经网络(CNN)详解与代码实现 本文系作者原创,转载请注明出处:https://www.cnblogs.com/further-further-further/p/10430073.html 目 ...
- Vue全家桶(Vue-cli、Vue-route、vuex)
摘要 学习本篇之前要具备一定的vue基础知识,可以先看一下Vue基础(环境配置.内部指令.全局API.选项.内置组件) 1.Vue-cli Vue-cli是vue官方出品的快速构建单页应用的脚手架,这 ...
- 1.3创建项目「深入浅出ASP.NET Core系列」
控制台创建项目 dotnet new --help 使用控制台采集项目,务必要熟练使用命令,--help是命令帮助的指明灯,在你无法google的时候,可以离线状态最快的帮助到你. 根据模板名称,我们 ...
- git使用教程指南
前言 Git是一个开源的分布式版本控制系统.其核心就在于版本控制. 在实际编码过程中,我们往往会忘记上次对文件的修改内容.若是刚刚修改的还好说,撤销操作即可.但若这是你昨天做的修改并关闭了IDE呢 ...
- video.js 一个页面同时播放多个视频
$(data).each(function(i, item) { // innerHTML += '<li type-id="'+item.id+'">'+ // '& ...
- Android为TV端助力:adb查找包名位置
logcat | grep START 查找启动launcher adb shell "pm list packages -f | grep +包名" 查找包的路径
- java或Jmeter实现两个日期相加减(2003-06-01-2003-05-01)
在beanshell中写入如下代码, import java.io.FileInputStream; SimpleDateFormat myFormatter = new SimpleDateForm ...
- windows已激活,但提示:windows 7 内部版本7601 此windows副本不是正版
把三个服务改为自动:
- Windows -- 使用批处理文件.bat删除旧文件
Windows -- 写一个批处理文件.bat删除旧文件 1. 批处理文件 del_old_file.bat rem 删除D:\temp目录下7天前的文件 Forfiles /p D:\temp ...
- HashMap源码分析(一)
前言:相信不管在生产过程中还是面试过程中,HashMap出现的几率都非常的大,因此有必要对其源码进行分析,但要注意的是jdk1.8对HashMap进行了大量的优化,因此笔者会根据不同版本对HashMa ...