javascript if 问题
function editusets() {var bb = 1;
var grey_dbbtn_date = document.getElementById("grey_dbbtn_date");
grey_dbbtn_dates = $('#grey_dbbtn_date').text();
if (bb == 1) {
var usernames_admin = document.getElementById("usernames_admin");
usernames_admins = $('#usernames_admin').text();
var project_staff = document.getElementById("project_staff");
project_staffs = $('#project_staff').text();
var company_name = document.getElementById("company_name");
company_names = $('#company_name').text();
var company_web = document.getElementById("company_web");
company_webs = $('#company_web').text();
var company_address = document.getElementById("company_address");
company_addresss = $('#company_address').text();
usernames_admin.innerHTML = "<input type='text' id='usernames_mod' value='"
+ usernames_admins + "'//>"
project_staff.innerHTML = "<input type='text' id='project_mod' value='"
+ project_staffs + "'/>"
company_name.innerHTML = "<input type='text' id='company_mod' value='"
+ company_names + "'/>"
company_web.innerHTML = "<input type='text' id='company_web_mod'value='"
+ company_webs + "'/>"
company_address.innerHTML = "<input type='text' id='address_mod' value='"
+ company_addresss + "'/>"
document.getElementById("project_staff");
html = '<a href="#" id="grey_dbbtn_date" onclick="editusets()">确认修改</a>';
grey_dbbtn_date.innerHTML = html;
bb=bb+1
}
if (bb != 1) {
alert(";;;");
usernames_mod = $('#usernames_mod').val();
Office = $('#project_mod').val();
company_mod = $('#company_mod').val();
company_web_mod = $('#company_web_mod').val();
address_mod = $('#address_mod').val();
lis = document.getElementById('project_mod');
lis.innerHTML = "<span class='fleft1' id='usernames_admin'>'"
+ usernames_mod + "'</span>";
var grey_dbbtn_date = document.getElementById("grey_dbbtn_date");
grey_dbbtn_dates = $('#grey_dbbtn_date').text();
html = '<a href="#" id="grey_dbbtn_date" onclick="editusets()">资料修改</a>';
grey_dbbtn_date.innerHTML = html;
alert(";;;");
}
}
为什么 我这代码执行了,但总会回到第一个判断里执行一次 好奇怪