当前位置:网站首页>Several ways to trigger link jump
Several ways to trigger link jump
2022-06-21 09:15:00 【Tie Hanhan plus】
There are several ways to jump links
One 、window.location.href Way to jump
var openUrl = 'http://www.baidu.com';
window.location.href = openUrl;
Two 、window.open Way to jump
var openUrl = 'http://www.baidu.com';
window.open(openUrl, '_blank');
// window.open(openUrl, '_self');
3、 ... and 、a Label mode jump
The code is as follows ( Example ):
// IOS and Android Trigger link mode
var openUrl = 'http://www.baidu.com';
if (tempA) {
document.body.removeChild(tempA);
}
var tempA= document.createElement('a');
tempA.href = openUrl;
tempA.style.display = 'none';
console.log(' establish a label ', tempA);
tempA.click();
Four 、iframe Label mode jump
The code is as follows ( Example ):
// web Browser pass iframe Tag trigger link
openUrl ='http://www.baidu.com';
if (ifr) {
document.body.removeChild(ifr);
}
var ifr = document.createElement('iframe');
ifr.src= openUrl;
ifr.style.display = 'none';
document.body.appendChild(ifr);
边栏推荐
- Waiting in webdriver
- Qsort sort string
- Application configuration management, basic principle analysis
- Audio immersive experience
- High precision calculation
- Retrofit擴展閱讀
- C # implement callback
- finally block can not complete normally
- Leetcode: print the common part of two ordered linked lists
- 【C】【时间操作】C语言中关于时间的操作
猜你喜欢

stm32mp1 Cortex M4开发篇9:扩展板空气温湿度传感器控制

【实战】STM32 FreeRTOS移植系列教程2:FreeRTOS 互斥信号量

adb使用技巧和usb通信原理

Summary of problems and errors encountered in tidb4.0.0 (tiup deployment)

Qsort sort string

Stm32mp1 cortex M4 development part 12: expansion board vibration motor control

ADO. Net - invalid size for size property, 0 - ado NET - The Size property has an invalid size of 0

Unity write multithreading considerations

Application configuration management, basic principle analysis

It is said that this year gold three silver four has become gold one silver two.
随机推荐
tidb4.0.0遇见的问题、报错总结(tiup部署)
R language obtains help information of global, package and function: use the rsitesearch function to search the information of the specified package or function in the R community help manual and arch
应用配置管理,基础原理分析
stm32mp1 Cortex M4开发篇9:扩展板空气温湿度传感器控制
The spring recruitment is also terrible. Ali asked at the beginning of the interview: how to design a high concurrency system? I just split
Figure out how MySQL works
Android database upgrade
【VS】【使用问题】【解决方案】VS2010打开一直停留在启动界面
Verification code ----- SVG captcha
Unity Detailed explanation of meta file function
Style penetration of vant UI components -- that is, some styles in vant UI components cannot be modified
Unity . Net framework
R language factor variable type: use factor function to convert string vector to factor vector, and use as The factor function converts a factor vector into a string vector and uses as The numeric fun
Qsort sort string
Character function and string function
The R language uses the sink function to export the string to the txt file in the specified directory. If no directory is specified, it will be output to the current working dir
【实战】STM32 FreeRTOS移植系列教程2:FreeRTOS 互斥信号量
Stm32mp1 cortex M4 Development Part 9: expansion board air temperature and humidity sensor control
Junit5 unit test
Topic34——31. Next spread