0

I developed a webpage which takes the wifi network name & password and invokes a script. This script validates the n/w name & password and connect to that network on success. I'm using jquery to call the script. Here is the code.

var request = $.ajax({
    url: "/cgi-bin/wifi.sh?netwotk_name="+ssid+"&pswd="+pswd,
    type: POST
)};
request.done(function(msg) {
    alert(msg);
});
request.fail(function(jqXHR, textStatus) {
    alert("failed");
});

This code is working good. Network also changing but i'm not getting any thing back. I know IP changed. But how I can confirm that when networked is changed and what is the new IP?

gangadhars
  • 2,584
  • 7
  • 41
  • 68

1 Answers1

0

You can try the following code:

var request = $.ajax({
    url: "/cgi-bin/wifi.sh?netwotk_name="+ssid+"pswd="+pswd,
    type: POST,
    success:function(data){//begin success function

       //alert the data returned
       alert(data);
   }//end success function
)};
Larry Lane
  • 2,141
  • 1
  • 12
  • 18
  • what is the difference? – gangadhars Dec 24 '14 at 19:11
  • Here is a good post that explains the differences in both syntax and the differences between success and done functions: http://stackoverflow.com/questions/8840257/jquery-ajax-handling-continue-responses-success-vs-done. – Larry Lane Dec 25 '14 at 16:54