且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将字符串添加到提交的URL的末尾?

更新时间:2023-02-23 09:38:06

可能我误解了这个问题,

 < a href =http://
onclick =this.href =( document.getElementById('prog_site')。value +
'/web/guest/en/websys/webArch/authForm.cgi')
target =_ blank>让我们开始吧!< /一个&GT;


I am putting together a simple tool for work where a user can add in some data to a form field which allows them to remotely access a device, but I need it to take them to the the login page.

<input type="text" name="prog_site" id="prog_site" value="http://" />
<a href="http://" onclick="this.href=document.getElementById('prog_site').value" target="_blank">Let's go!</a>

the above takes them to the said device, but I am having problems with adding a script that then adds on the following after the submitted info (which is an IP address)

/web/guest/en/websys/webArch/authForm.cgi

I have been looking at ways but need it to be as simple as possible?

Here is the full script:

    <script>
function open_win() 
{
window.open("");
}
</script>

<style>
body {
background-color: #fff;
}
</style>

<p><img src="logo.gif" /></p>

<p>Hello customer</p>

<p>Welcome to the Activation</p>

<p><a target="_new" href="">Instructions</a></p>


<input type="text" name="prog_site" id="prog_site" value="http://" />
<a href="http://" onclick="this.href=document.getElementById('prog_site').value" target="_blank">Let's go!</a>

Possibly I'm misreading the question, but what is wrong with:

<a href="http://"
    onclick="this.href=(document.getElementById('prog_site').value +
                       '/web/guest/en/websys/webArch/authForm.cgi')"
    target="_blank">Let's go!</a>

?