日期:2014-05-17 浏览次数:20946 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script type="text/javascript"> function toUrl(result) { if (result=="baidu") { alert(result); location.href = "http://www.baidu.com"; } else if (result=="google"){ alert(result); location.href = "http://www.google.com"; } } </script> </head> <body> <a href="javascript:toUrl('google')" >google</a> <a href="javascript:toUrl('baidu')" >baidu</a> </body> <html>
------解决方案--------------------
3楼的应该比较好
------解决方案--------------------
也可以使用jsp标签,进行判断