这可能吗?
我有输入框和提交按钮.
分配的网址是:www.mywebsite.com/点击提交按钮后,通过javascript打开的网址是:www.mywebsite.com/print/hello123/
查看演示:http://jsfiddle.net/Gv5bq/
HTML:
<input type="text" id="text" />
<input type="button" id="btn" value="Submit" />
Run Code Online (Sandbox Code Playgroud)
jQuery的:
$("#btn").click( function() {
var url = "http://www.mywebsite.com/print/" + $("#text").val();
window.open(url);
});
Run Code Online (Sandbox Code Playgroud)
更新:(简单JS版) http://jsfiddle.net/Gv5bq/1/
<input type="text" id="text" />
<input type="button" id="btn" value="Submit" onClick="javascript: window.open('http://www.mywebsite.com/print/' + document.getElementById('text').value);" />
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11937 次 |
最近记录: |