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
Post a Comment