Solutions About Safari browser does not support location [window.location.href window.open ()] Jump problem

In a recent project to do, hit the safari browser does not support location Jump issue, for this problem can be solved by clicking js simulation time, the code is as follows:

 1 <!DOCTYPE HTML>
 2 <html lang="en-US">
 3 <head>
 4    <meta charset="UTF-8">
 5    <title></title>
 6 </head>
 7 <body>
 8    <a id='link' href="#"></a>
 9    <script type="text/javascript">
10       var obj = document.getElementById('link');
11       obj.href = "http://www.baidu.com";
12       obj.click();
13    </script>
14 </body>
15 </html>

 

Guess you like

Origin www.cnblogs.com/whx-blogs/p/11125699.html