<input type="text" value="" id="a"> <input type="button" value="提交" onclick="goto();"> <script type="text/javascript"> function goto () { var a=document.getElementById('a').value; var url="http://10.223.88.5/cms/DataCenter/wu/wuCnEdit.php?id="+a; window.open(url); } </script>
这样的话 我们开发平台和正式平台的url 是不一样的,应该如何弄呢?
试:<script type="text/javascript"> function goto() { var a = document.getElementById('a').value; var url = "/cms/DataCenter/wu/wuCnEdit.php?id=" + a; window.open(url); } </script>
然后弹出新页面的时候在url后面带参数
就可以在页面上GET到这个值
<input type="button" value="提交" onclick="goto();">
<script type="text/javascript">
function goto () {
var a=document.getElementById('a').value;
var url="index.php?a="+a;
alert(url);
window.open(url);
}
</script>然后在index.php就能GET到这个值了
我的目的就是 在这个url链接的上一个页面 通过输入id 点击按钮 得到http://10.223.88.5/cms/DataCenter/wu/wuCnEdit.php?id=xx这个页面
<input type="button" value="提交" onclick="goto();">
<script type="text/javascript">
function goto () {
var a=document.getElementById('a').value;
var url="http://10.223.88.5/cms/DataCenter/wu/wuCnEdit.php?id="+a;
window.open(url);
}
</script>
function goto() {
var a = document.getElementById('a').value;
var url = "/cms/DataCenter/wu/wuCnEdit.php?id=" + a;
window.open(url);
}
</script>