12345678910111213141516171819202122232425262728293031323334353637 |
- export function getHashQuery (query) {
- if (location.hash.indexOf(query) > -1) {
- let cur = location.hash.slice(location.hash.indexOf(query) + query.length + 1, location.hash.length)
- if (cur.indexOf('&') > -1) {
- return cur.slice(0, cur.indexOf('&'))
- } else {
- return cur
- }
- } else {
- return false
- }
- }
- export function delURL (query) {
- if (query.charAt(query.length - 1) === '&') {
- return delURL(query.substring(0, query.length - 1))
- } else {
- return query
- }
- }
- export function inittitle (title) {
- document.title = title
- let userAgent = window.navigator.userAgent.toLowerCase()
- let isiOS = userAgent.indexOf('applewebkit') >= 0
- let isWechat = userAgent.indexOf('micromessenger') >= 0
- if (isiOS && isWechat) {
- let iframe = document.createElement('iframe')
- iframe.src = ''
- iframe.style.display = 'none'
- document.body.appendChild(iframe)
- iframe.onload = function () {
- setTimeout(function () {
- iframe.remove()
- }, 0)
- }
- }
- }
|