日期:2014-05-17  浏览次数:20606 次

框架中输入电话号码后按确定跳到一个网页。
怎样写HTML?
比如(这里填入手机号码)点击确认
会出现在下面这个链接里。http://www.xxxx.com/sds/sdfsd?fsd手机号码sdfr.eft.com

------解决方案--------------------
HTML code
<html>
<body>
<input id="phone_num" />
<input type="button" id="btn_submit" value="提交"/>
<div id="result"></div>
<script>
    var $ = function(id){return document.getElementById(id);}
    $('btn_submit').onclick = function(){
        var src = "http://www.xxxx.com/sds/sdfsd?fsdsdfr.eft.com";
        $('result').innerHTML = src.replace(/sdsd/, "sd"+$('phone_num').value+"sd");
    }
</script>
</body>
</html>

------解决方案--------------------
HTML code

<!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" />
<title>无标题文档</title>
</head>

<body>
<script>
    function test(){
        var tel = document.form.phone.value;
        alert("phone-->>"+tel);
        var url = "http://www.xxxx.com/sds/sdfsd?fsd"+tel+"sdfr.eft.com";
        alert("url-->>"+url);
    }
</script>
<form name="form" action="" method="post">
    <input type="text" name="phone" />
    <input type="button" name="submit" value="submit" onclick="test()" />
</form>
</body>
</html>