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的更多相关文章

  1. 利用window.name+iframe跨域获取数据详解

    详解 前文提到用jsonp的方式来跨域获取数据,本文为大家介绍下如何利用window.name+iframe跨域获取数据. 首先我们要简单了解下window.name和iframe的相关知识.ifra ...

  2. window.open() & iframe

    window.open() & iframe https://www.w3schools.com/jsref/met_win_open.asp window.open(URL, name, s ...

  3. iframe 跨域问题解决方案 利用window.name+iframe跨域获取数据详解

    详解 前文提到用jsonp的方式来跨域获取数据,本文为大家介绍下如何利用window.name+iframe跨域获取数据. 首先我们要简单了解下window.name和iframe的相关知识.ifra ...

  4. window.frames && iframe 跨页面通信

    1.定义 frames[]是窗口中所有命名的框架组成的数组.这个数组的每个元素都是一个Window对象,对应于窗口中的一个框架. 2.用法 假设iframe 是一个以存在的 iframe 的 ID 和 ...

  5. js实现跨域(jsonp, iframe+window.name, iframe+window.domain, iframe+window.postMessage)

    一.浏览器同源策略 首先我们需要了解一下浏览器的同源策略,关于同源策略可以仔细看看知乎上的一个解释.传送门 总之:同协议,domain(或ip),同端口视为同一个域,一个域内的脚本仅仅具有本域内的权限 ...

  6. js 跨域复习 window.name | window.domain | iframe | Jsonp

    引起跨域的原因: 浏览器的同源策略,但是当你要发送请求的时候,出于安全性问题,浏览器有严格的要求,必须协议,域名,端口都相同,这个就是同源策略. 影响:a通过js脚本向b发送ajax请求,不同源就会报 ...

  7. window.frames[iframe].document 在ie可以用,在360、火狐中都不兼容?

    <iframe id="myf" scrolling="auto" frameborder="0" src="" ...

  8. 利用window.name+iframe跨域获取接口数据

    最近做了一个表单广告,需要从接口读取数据,做完发现谷歌火狐下正常,360兼容和IE浏览器无法获取数据,以下是鲜明的对比:      调试发现报错了: 然后开发把接口改成支持windowname,一开始 ...

  9. js控制父子页面传值(iframe和window.open)

    在html中,window对象代表浏览器中一个打开的窗口,就像我们C/S中做窗体一样,在该页的window对象就是new了一个新的窗体对象. 就像做C/S开发一样,浏览器是一个软件,每一个网页都是它n ...

随机推荐

  1. 使用 ASP.NET Core MVC 创建 Web API(一)

    从今天开始来学习如何在 ASP.NET Core 中构建 Web API 以及每项功能的最佳适用场景.关于此次示例的数据库创建请参考<学习ASP.NET Core Razor 编程系列一> ...

  2. Asp.NetCore依赖注入和管道方式的异常处理及日志记录

    前言     在业务系统,异常处理是所有开发人员必须面对的问题,在一定程度上,异常处理的能力反映出开发者对业务的驾驭水平:本章将着重介绍如何在 WebApi 程序中对异常进行捕获,然后利用 Nlog ...

  3. 推荐一款好用的任务定时器:Quartz

    前言 官网:https://www.quartz-scheduler.net/ 一款开源的任务定时器. 日常有很多地方需要定时刷新的,比如微信开发中的微信API token,或者定时清理一下缓存数据等 ...

  4. 从零开始学安全(四十三)●Wireshark分析ICMP(IP)协议

    存活时间与IP分片 这里我们首先来研究一下关于IP协议的两个非常重要的概念:存活时间与IP分片.存活时间(TTL,Time to Live)用于定义数据包的生存周期,也就是在该数据包被丢弃之前,所能够 ...

  5. 数据结构——Java实现链栈

    一.分析 栈是限定仅在表的一端进行插入或删除操作的线性表,对于栈来说,操作端称为栈顶,另一端则称为栈底,栈的修改是按照后进先出的原则进行的,因此又称为后进先出的线性表. 链栈是指采用链式存储结构实现的 ...

  6. js之制作简易红绿灯

    HTML代码: 在一个div容器内,设置3个span <body> <div id="i1"> <span class="light red ...

  7. 原生jQuery代码

    function myJquery(selector){ if(typeof selector=="string") { if (selector.charAt(0) == &qu ...

  8. Nginx日志常用统计分析命令

    IP相关统计 统计IP访问量(独立ip访问数量) awk '{print $1}' access.log | sort -n | uniq | wc -l 查看某一时间段的IP访问量(4-5点) gr ...

  9. Golang学习笔记(一)

    这个系列学习文章是对ASTAXIE大神的GoWeb编程的读书笔记. 1. 关于GOPATH $GOPATH 是系统中重要的环境变量,他不是Go的安装目录. 假如我们将GOPATH设置在这里: /hom ...

  10. SharpMap和NetTopologySuite叠加分析问题

    先附上实现的相交叠加分析的部分代码,然后请教个问题,希望能够得到解答. /// <summary> 执行相交叠加分析 </summary> private void Execu ...