IE to obtain the value of the referer
Recently, the company's website needs to count the data from which pages users enter the registration page. Start by simply getting it on the server side $_SERVER['HTTP_REFERER'] (php). However, I found that many registered users do not have a referer value. Later, I checked that if the method is used to jump in IE, the referer value is empty. And if the referer jumps in the tag <a></a>, the referer will not be empty. So, you can solve this IE problem by just one code:
function gotoUrl(url){ if(){ var gotoLink = ('a'); gotoLink .href = url; (gotoLink); gotoLink .click(); } else = url; }
The principle is to create a tag <a>, then set the URL address that needs to be redirected, and finally trigger the click event.
Related Articles
60 seconds countdown function for obtaining verification codes for WeChat applets
This article mainly introduces the 60-second countdown template for obtaining verification codes by WeChat applets. This article introduces you very detailed through the example code, which has certain reference value for your study or work. Friends who need it can refer to it.2023-04-04Detailed explanation of the use of esm examples in ESLint and Jest
This article mainly introduces detailed explanations of the use of esm in ESLint and Jest. Friends in need can refer to it for reference. I hope it will be helpful. I wish you more progress and get promoted as soon as possible to get a salary increase as soon as possible.2023-03-03Manual decoding skills
There are often JS encryption code decoding methods on web pages, but due to the existence of escape characters in the code, it cannot be decoded correctly.2010-07-07Continuous and uninterrupted picture scroll
The pictures are continuously scrolling the album...2007-01-01JavaScript serialization object implementation code
JavaScript serialization object implementation code, friends who need it can refer to it.2009-12-12IE8 introduces cross-site data acquisition function description
Today I looked at the msdn document and found that IE8 intends to add XDomainRequest (/en-us/library/cc288060(VS.85).aspx) interface for cross-site data acquisition2008-07-07A brief discussion on webpack automatic refresh and analysis
This article mainly introduces a brief discussion on webpack automatic refresh and analysis. The editor thinks it is quite good. I will share it with you now and give you a reference. Let's take a look with the editor2018-04-04JS realizes date cascade effect
This article mainly introduces examples of JS to achieve date cascading effects. Friends who need it can come and refer to it. I hope it will be helpful to you.2014-01-01Example code for implementing static pages of bookstore based on JS
This article will share with you a static bookstore page based on js. The code is simple and easy to understand, very good, with reference value. If you need it, please refer to it.2017-02-02Complete example of dynamic operations of JS tables
This article mainly introduces the dynamic operations of JS tables, and analyzes the simple operation techniques of JavaScript for dynamic modification and deletion of table elements in detail based on the complete example form. Friends who need it can refer to it2020-01-01