我正在使用jquery查找我网站访问者的地理位置,我希望它在.cs文件中运行,因为我想将输出存储在数据库中....
<!-- Require jQuery / Anyversion --><script type="text/javascript" language="Javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- Require EasyJQuery After JQuery --><script type="text/javascript" language="Javascript" src="http://api.easyjquery.com/easyjquery.js"></script>
<script type="text/javascript" language="Javascript">
// 1. Your Data Here
function my_callback(json) {
alert("IP :" + json.IP + " nCOUNTRY: " + json.COUNTRY);
}
function my_callback2(json) {
// more information at http://api.easyjquery.com/test/demo-ip.php
alert("IP :" + json.IP + " nCOUNTRY: " + json.COUNTRY + " City: " + json.cityName + " regionName: " + json.regionName);
}
// 2. Setup Callback Function
// EasyjQuery_Get_IP("my_callback"); // fastest version
EasyjQuery_Get_IP("my_callback2","full"); // full version