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 ...
随机推荐
- springboot~ObjectMapper~dto到entity的自动赋值
实体与Dto自动赋值 在开发的过程中,实体之间相互赋值是很正常的事,但是我们一般的方法都通过set和get方法来进行的,如果要赋值的字段少那还行,但是需要赋值的字段超过10个,那就是个灾难,你会看到整 ...
- base64字符串转文件,以及ngImgCrop裁剪图片并上传保存到服务器示例
base64字符串是包含文件格式的文件字符串,例如:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAgAElE ...
- SpringBoot2 java配置方式 Configuration和PropertySource结合读取配置文件
JdbcConfig.java Configuration是配置文件 PropertySource 引入配置文件 value读取配置文件内容 package cn.itcast.config; imp ...
- 前后端分离密码登陆加密RSA方案(java后端)
前言:密码加密有很多种方案,这里不做过多讨论,本篇文章是基于RSA加密实现. 首先在前端工程中需要引入加密js: "jsencrypt": "2.3.1",(注 ...
- React create-react-app Build fails after eject: Cannot find module '@babel/plugin-transform-react-jsx'
运行 npm run eject 出现报错 Build fails after eject: Cannot find module '@babel/plugin-transform-react-jsx ...
- C#中文件下载的几种方法演示源码
内容过程,把内容过程比较重要的内容做个珍藏,如下的内容是关于C#中文件下载的几种方法演示的内容,应该是对各朋友有较大好处. using System;using System.Data;using S ...
- RecycleView的notifyItemRemoved使用注意
转载请标明出处,维权必究:https://www.cnblogs.com/tangZH/p/10116095.html 我们为了移除RecycleView的某一项,会用RecycleView的noti ...
- 章节十、6-CSS---用CSS 定位子节点
以该网址为例(https://learn.letskodeit.com/p/practice) 一.通过子节点定位元素 1.例如我们需要定位这个table表格 2.当我们通过table标签直接定位时, ...
- 章节十、4-CSS Classes---用多个CSS Classes定位元素
以下演示操作以该网址中的输入框为例:https://learn.letskodeit.com/p/practice 一.使用input[class=inputs]验证元素是否唯一 注意:使用“clas ...
- Nginx设置Https反向代理,指向Docker Gitlab11.3.9 Https服务
目录 目录 1.GitLab11.3.9的安装 2.域名在阿里云托管,申请免费的1年证书 3.Gitlab 的 https 配置 4.Nginx 配置 https,反向代理指向 Gitlab 配置 目 ...