一个很简单的js传值问题

liyj19870228 2009-12-28 04:29:24
我有一个text和一个button做一个搜索,要的效果是 按一下这个button onclick事件,跳转到XXX_text的值.html页面
我该怎么做?因为我完全不懂js。。。所以求助一下。。对了 不要弹出新页面。。。
...全文
131 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinank 2009-12-29
  • 打赏
  • 举报
回复
101179725程序员群,有问题可以去那里找我。
chinank 2009-12-29
  • 打赏
  • 举报
回复

<input type="text" name="aa"></input>
<input type="button" name="bb" onclick="window.location.href='xxx_' + document.all.aa.value+'.html'"></input>
good4750420 2009-12-28
  • 打赏
  • 举报
回复
写一个onclick()事件来调用你所需的代码.
东大坡居士 2009-12-28
  • 打赏
  • 举报
回复
若打开新窗口就用window.open(),否则就用window.location.href
Inpool 2009-12-28
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 avengercf 的回复:]
window.location.href="xxx_" + document.getElementById("TEXTID").value+".html"
[/Quote]
.
liyj19870228 2009-12-28
  • 打赏
  • 举报
回复
谢谢大家,我先试试
千游 2009-12-28
  • 打赏
  • 举报
回复
楼上2位的皆可
szaf31954 2009-12-28
  • 打赏
  • 举报
回复
function GoGoGo()
{
window.location.href=document.getElementById("textValue").value+".html";
}
jiayouxh 2009-12-28
  • 打赏
  • 举报
回复



function goUrl()
{

var url = document.getElementById("textValue").value+".html";
window.location.href= url ;
}
zhuxiaobo_net 2009-12-28
  • 打赏
  • 举报
回复

//button加如下事件
OnClientClick="GotoURL()"
//js函数如下
function GotoURL()
{

var=url+document.getElementById('tbURL').value;
window.open(url)
}

avengercf 2009-12-28
  • 打赏
  • 举报
回复
window.location.href="xxx_" + document.getElementById("TEXTID").value+".html"
jack_liu2 2009-12-28
  • 打赏
  • 举报
回复
在页面写一个IFRAME,提交到IFRAME里面就可以了
document.forms[0].target = "IFRAME_NAME";
document.forms[0].action = action;
document.forms[0].submit();

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧