js gets the url link string: location.href
It can be intercepted to obtain the transmitted parameters. Commonly used are as follows:
location.href.indexOf("?")------Get? index value.
Note: The location.href here does not refer to the current address in the address bar, but the actual address of the page.
Also, some digressions:
In C#, IndexOf is also used to obtain the index of the character's location.
Obtaining the index in sqlserver is different:
The first type:
select * from dbo.users where CharIndex('2',mainsubjects)>0
Second type:
select * from dbo.users where patIndex('%2%',mainsubjects)>0
I use a pass judgment column to determine if the ad should be displayed:
Only the contents of the //www.VeVB.COm/codes/ directory will display ads:
Copy the code code as follows:
if(location.href.indexOf("//www.VeVB.COm/codes/")>-1){
alert('ok');
}