Created
August 24, 2012 06:02
-
-
Save libo1106/3446260 to your computer and use it in GitHub Desktop.
javascript获取url中的GET参数,并且重新发一个新的xml请求
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clickpost(){ | |
var tracking = 'http://www.demo.com/tracking?type=click&'; | |
var adurl = window.location.href.split("?"); | |
var parameters = adurl[1]; | |
var xmlhttp; | |
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari | |
xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open('GET', tracking + parameters, true); | |
xmlhttp.send(); | |
} else { // code for IE6, IE5 | |
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); | |
xmlhttp.open('GET', tracking + parameters, true); | |
xmlhttp.send(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment