问题是这样的:
我想在pda的网页上面生成10个按钮,且这些按钮被点击后不刷新页面,并且根据需求要点击第一次变色,点击第二次变另种色,我用的是Microsoft的Mobile ie,以为可以用asp.net编辑好桌机版,然后用pda连接测试就能实现,可是当我在桌机上实现要求后,在pda上浏览时却不能像桌机一样的实现效果。
例如代码:
Response.Write("<table width=/"220px/">");
try
{
for (int trs = 0; trs < 10 / 5; trs++)
{
Response.Write("<tr>");
for (int tds = 0; tds < 5; tds++)
{
Response.Write("<td> <button id='" + StBn[trs * 5 + tds].SeatNo1 + "' style=/"height:30px;width: 40px;font-size:20px ;font-family:Arial /" οnclick=/"document.getElementById('nowActivity').innerText='" + StBn[trs * 5 + tds].SeatNo1 + "'; this.style.backgroundColor=(this.style.backgroundColor=='red')?'black':'red';return false; return false; /" href=/"#/"> " + StBn[trs * 5 + tds].SeatNo1 + "</button></td>");
}
Response.Write("</tr>");
}
}
catch (Exception E)
{
Response.Write(E.Message);
}
Response.Write("</table>");
主要代码:this.style.backgroundColor=(this.style.backgroundColor=='red')?'black':'red';
代码在桌机上可以实现:点击按钮变红,再点击则变黑,但用pda浏览时只能变红,却不能变黑。请教高手:难道mobile ie 不支持这样的脚本?或者有什么开发语言或工具实现我的想法。