safari

Unclosed square bracket doesn't throw error in jquery

和自甴很熟 提交于 2020-04-16 02:44:45
问题 $('#parent_tab [href="#tab1"').click(); The above line works fine and the tab gets selected in other browsers but not safari. I had to close the square bracket of href as follows in order to make it work in Safari. $('#parent_tab [href="#tab1"]').click(); Why did jquery not throw an error when the square bracket is not closed? 回答1: This looks like it's a Safari issue. Another reason is because the closing bracket is inside the jQuery selector. Safari might be concerned only with JavaScript

How to detect iOS 13 on JavaScript?

谁都会走 提交于 2020-04-15 21:09:29
问题 I use this function to detect iOS export function isiOS() { return navigator.userAgent.match(/ipad|iphone/i); } is there any way to make it detected iOS13+? thanks Why do I need it? usually, iOS safari can't download files therefore to make image downloadable I should render it as <img src={qrImage} alt="creating qr-key..." /> however on Android/PC and pretty much everywhere else it's possible to do it directly via <a href={qrImage} download="filename.png"> <img src={qrImage} alt="qr code" />

How to detect iOS 13 on JavaScript?

我的未来我决定 提交于 2020-04-15 21:08:50
问题 I use this function to detect iOS export function isiOS() { return navigator.userAgent.match(/ipad|iphone/i); } is there any way to make it detected iOS13+? thanks Why do I need it? usually, iOS safari can't download files therefore to make image downloadable I should render it as <img src={qrImage} alt="creating qr-key..." /> however on Android/PC and pretty much everywhere else it's possible to do it directly via <a href={qrImage} download="filename.png"> <img src={qrImage} alt="qr code" />

NSPOSIXErrorDomain:100 错误

纵饮孤独 提交于 2020-04-14 16:20:35
【推荐阅读】微服务还能火多久?>>> Issue Description On iOS and MacOS Safari fails to load a site over HTTPS served by NGINX acting as a reverse proxy in front of Apache. Safari can’t open the page displaying the error: “The operation couldn’t be completed. Protocol error” (NSPOSIXErrorDomain:100) Explanation Here’s whats happening: Nginx when installed as a reverse proxy with Apache as a back-end fetches resources from Apache using HTTP/1.1, which the back-end server tries to upgrade to HTTP/2 by sending the “Upgrade: h2c” header: Upgrade: h2, h2c By default Apache allows the following HTTP protocol versions

Error-Javascript:Uncaught Error: Malformed UTF-8 data at Object.stringify (crypto-js.js:478) at W...

岁酱吖の 提交于 2020-04-14 13:37:04
【推荐阅读】微服务还能火多久?>>> ylbtech-Error-Javascript:Uncaught Error: Malformed UTF-8 data at Object.stringify (crypto-js.js:478) at WordArray.init.toString (crypto-js.js:215) 1. 返回顶部 1、 一般情况下,很少会在前端进行加解密的操作,因为没有太大的必要性,前端的代码是很容易看到的,即使这样,我觉得还是有比较处理一下的,至少不让别人一眼就看到信息 我使用localStorage存储了一些用户的用户名昵称等的信息,通过 crypto-js 进行加解密处理,这里我选用了AES加密算法对json对象数据进行处理 按照官方的例子,如下 var CryptoJS = require("crypto-js" ); var data = [{id: 1}, {id: 2 }] // Encrypt var ciphertext = CryptoJS.AES.encrypt(JSON.stringify(data), 'secret key 123' ); // Decrypt var bytes = CryptoJS.AES.decrypt(ciphertext.toString(), 'secret key 123' ); var

PWA介绍及快速上手搭建一个PWA应用

匆匆过客 提交于 2020-04-13 11:37:41
【今日推荐】:为什么一到面试就懵逼!>>> PWA初次体验 ​ 前言:本示例不用安装任何东西 部分资源来自网络资源及PWA官网,不要把PWA想象的太复杂,跟着示例走一下,你行的。 PWA介绍 一个新的前端技术,PWA( 全称:Progressive Web App )也就是说这是个渐进式的网页应用程序。 官网: https://developers.google.com/web/progressive-web-apps/ 是 Google 在 2015 年提出,2016年6月才推广的项目。是结合了一系列现代Web技术的组合,在网页应用中实现和原生应用相近的用户体验。 官网上给出 PWA 的宣传是 : Reliable ( 可靠的 )、 Fast ( 快速的 )、 Engaging ( 可参与的 ) Reliable :当用户从手机主屏幕启动时,不用考虑网络的状态是如何,都可以立刻加载出 PWA。 Fast :这一点应该都很熟悉了吧,站在用户的角度来考虑,如果一个网页加载速度有点长的话,那么我们会放弃浏览该网站,所以 PWA 在这一点上做的很好,他的加载速度是很快的。 Engaging : PWA 可以添加在用户的主屏幕上,不用从应用商店进行下载,他们通过网络应用程序 Manifest file 提供类似于 APP 的使用体验( 在 Android 上可以设置全屏显示哦,由于

Javascript Cookies not working in Safari

萝らか妹 提交于 2020-04-13 06:27:07
问题 I've been trying to implement a basic cookie storage function in Javascript, which works as intended in most browsers, but not Safari (8.0.3). I've stripped it down to the below example, where every other browser changes the text to the date that is stored in the cookie, but Safari doesn't store a cookie at all and gives out an empty string (no error messages in the console either). Safari is set to accept all cookies. If I enter the code in the testbed at W3Schools.com, it works in every

faker使用

为君一笑 提交于 2020-04-12 16:04:45
laravel中faker的方法总结 展开 laravel faker用法总结 安装 composer require fzaninotto/faker 一、基础方法: 随机数:randomDigit // 7 不为空随机数:randomDigitNotNull // 5 随机数:randomNumber($nbDigits = NULL, $strict = false) // 随机浮点数:randomFloat($nbMaxDecimals = NULL, $min = 0, $max = NULL) // 48.8932 区间内的随机数:numberBetween($min = 1000, $max = 9000) // 8567 随机字母:randomLetter // 'b' // returns randomly ordered subsequence of a provided array 随机选取数组中的几个,返回也为数组:randomElements($array = array ('a','b','c'), $count = 1) // array('c') 随机选取数组中的一个:randomElement($array = array ('a','b','c')) // 'b' 打乱字符串:shuffle('hello, world') // 'rlo,h

BOM属性对象方法

一笑奈何 提交于 2020-04-12 15:14:41
本文原链接: https://cloud.tencent.com/developer/article/1018747 BOM 1.window对象 2.location对象 3.history对象 BOM也叫浏览器对象模型,它提供了很多对象,用于访问浏览器的功能。BOM缺少规范,每个浏览器提供商又按照自己想法去扩展它,那么浏览器共有对象就成了事实的标准。所以,BOM本身是没有标准的或者还没有哪个组织去标准它。 一.window对象 BOM的核心对象是window,它表示浏览器的一个实例。window对象处于JavaScript结构的最顶层,对于每个打开的窗口,系统都会自动为其定义 window 对象。 1.对象的属性和方法 window对象有一系列的属性,这些属性本身也是对象。 window对象的属性 属性 含义 closed 当窗口关闭时为真 defaultStatus 窗口底部状态栏显示的默认状态消息 document 窗口中当前显示的文档对象 frames 窗口中的框架对象数组 history 保存有窗口最近加载的URL length 窗口中的框架数 location 当前窗口的URL name 窗口名 offscreenBuffering 用于绘制新窗口内容并在完成后复制已存在的内容,控制屏幕更新 opener 打开当前窗口的窗口 parent 指向包含另一个窗口的窗口

HammerJs: enable vertical scroll with horizontal swipe

会有一股神秘感。 提交于 2020-04-11 19:35:52
问题 I've got an angular 7 website, and I want to add horizontal swipe to one component, and vertical swipe to another (the components are in the same module). I'm using hammerjs for that. By default, hammerjs disables vertical swipe, so I enabled swipping in all directions with the code below. export class MyHammerConfig extends HammerGestureConfig { overrides = <any>{ swipe: {direction: Hammer.DIRECTION_ALL}, }; } //declare provider in AppModule providers: [ { provide: HAMMER_GESTURE_CONFIG,