舍去http://localhost:8080前缀问题 我在JSP文件中写了一个链接,比如<a href="www.baidu.com">“显示百度页面”</a>。但是当我点击这个“显示百度页面”时,显示的链接地址是http://localhost:8080/[项目名臣]/www.baidu.com,而不是www.baidu.com。因此无法跳转到百度。请问怎么才能舍去http://localhost:8080/[项目名臣]这个前缀。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 改成 <a href="http://www.baidu.com"> 就可 <html><head><script language="javascript" src="script/TV20.js"></script><script language="javascript"> var req; var gKey; function init() { if(window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } } function myLabelDblClick(key, parentKey) { if(findNode(key).subitems.length > 0) return; init(); gKey = key; var url = "GetCategoryChilds2.jsp?id=" + escape(key); req.open("GET", url, true); req.onreadystatechange = callback; req.send(null); } function callback() { if(4 == req.readyState) { if(200 == req.status) { eval(req.responseText); var node = findNode(gKey); if(node.subitems.length > 0) { node.refresh(); node.open(); } } } } </script></head><body> <script language="javascript"> <!-- addListener("dblclick", "myLabelDblClick"); addNode(-1,0,"类别","images/top.gif"); <% for(int i=0; i<categories.size(); i++) { Category c = categories.get(i); %> addNode(<%=c.getPid()%>,<%=c.getId()%>,"<%=c.getName()%>"+"<a href='www.baidu.com'>"+"a"+"</a>","images/top.gif"); <% } %> showTV(); --> </script></body></html>我是写用Ajax了一棵树(上面的href就是),点击这个链接的时候老是显示http://localhost:8080/[项目名称]/www.baidu.com。 <a onclick="jump()">baidu</a> <script type="text/javascript">function jump(){window.location = "http://www.baidu.com";}</script> addNode(<%=c.getPid()%>,<%=c.getId()%>,"<%=c.getName()%>"+"<a href='www.baidu.com'>"+"a"+"</a>","images/top.gif"); 哎,这世道,连HTML都不懂的人都跑出来做网站了。 前面加上 地址前加 http:// 怎样实现BBS后台管理控制网站换肤? 有关openfire+spark+smack即时通讯开发问题 刚接触J2EE,请问J2EE的运行环境 Hibernate查询,急........ Cannot connect to Hessian 高分求解Spring配置问题,在线等解答! 运行java -jar lemon-0.9.0-standalone.war 报错 JDBC 读取MYSQL数据库时出现的问题,向各位高手求解。 在J2EE中连接数据库的问题 IndexOutOfBoundsException java 能调用IE吗? 关于CXF整合Spring
<head>
<script language="javascript" src="script/TV20.js"></script>
<script language="javascript">
var req;
var gKey;
function init() {
if(window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
}
function myLabelDblClick(key, parentKey) {
if(findNode(key).subitems.length > 0) return;
init();
gKey = key;
var url = "GetCategoryChilds2.jsp?id=" + escape(key);
req.open("GET", url, true);
req.onreadystatechange = callback;
req.send(null);
}
function callback() {
if(4 == req.readyState) {
if(200 == req.status) {
eval(req.responseText);
var node = findNode(gKey);
if(node.subitems.length > 0) {
node.refresh();
node.open();
}
}
}
}
</script>
</head><body>
<script language="javascript">
<!--
addListener("dblclick", "myLabelDblClick");
addNode(-1,0,"类别","images/top.gif");
<%
for(int i=0; i<categories.size(); i++) {
Category c = categories.get(i);
%>
addNode(<%=c.getPid()%>,<%=c.getId()%>,"<%=c.getName()%>"+"<a href='www.baidu.com'>"+"a"+"</a>","images/top.gif");
<%
}
%>
showTV();
-->
</script>
</body>
</html>
我是写用Ajax了一棵树(上面的href就是),点击这个链接的时候老是显示http://localhost:8080/[项目名称]/www.baidu.com。
<script type="text/javascript">
function jump()
{
window.location = "http://www.baidu.com";
}
</script>