html代码:
<button onclick="ServerDetail()">codm-lobby-0001</button>
js函数:
function ServerDetail() {
var btn = $(this);
var button_val = btn.html();
alert(button_val);
var root_dir = "/monitor/servers/detail/";
var server_url = root_dir.concat(button_val);
$.get(server_url, function(data, status){
alert(data);
} );
}
这是我在网上百度的办法,但是button_val为什么弹出一个undefined。
请各位网友帮帮忙,谢谢了。