0

I am using jquery to find geographic location of the visitors of my website, i want it to run in .cs file as i want to store the output in database....

<!-- 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
Aristos
  • 66,005
  • 16
  • 114
  • 150
Zoya Mehta
  • 99
  • 1
  • 1
  • 4
  • You wont be able to execute the jQuery on a cs ... You could think about using a similar geolocation api on the server, or you could make a service / postback call to the server after getting it from easyjquery – Sachin Nayak May 17 '12 at 06:04
  • if i correctly understand your problem, i think that you need to make Ajax call, try like this, make Ajax call get latitude and longitude and save to database using Ajax. – Humayoo May 17 '12 at 08:29
  • yes,this code gives me what i want but how to i save this output into my database? – Zoya Mehta May 17 '12 at 10:16
  • http://stackoverflow.com/questions/6330384/net-simple-form-submit-via-ajax-and-jquery – smitchelluk May 22 '12 at 15:24

0 Answers0