How to get content from my router with AJAX -


let me explain in details want... need content router via address http://user:password@192.168.1.1/dhcp_table.html line (class name):

<td class="data_table_data" align="center">  **pc name**  </td> 

i see result this:

pc name 

is looking for? if yes, how?

$.ajax({   url: url,   data: data,   success: success,   datatype: datatype }); 

you can pass username , password router ajax parameters. should specify datatype: 'html' well:

var url = "http://192.168.1.1/dhcp_table.html",     username = "<username here>",     password = "<password here>";  var auth = 'basic ' + base64.encode(username + ':' + password);  $.ajax ({   type: "get",   url: url,   datatype: 'html',   username: username,   password: password,   headers : { authorization : auth },   success: function (data) {     var dhcptable = $(data);     alert('text of table = '+dhcptable.filter('.data_table_data').text());    } }); 

edit: added base64 authentication.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -