我有重定向链接,但不是base64,
var urlAlias = "example[dot]com"; //CHANGE THIS TO YOU WEBSITE
function go() {
x = document.theform.nick.value;
if(x.length < 11)
{
return 0;
}
var displayURL = x.replace("http://", "");
y = document.location.search.substring(1,11);
y = "";
document.theform.thelink1.value = "http://"+urlAlias+"/?" + x + "" + y;
document.theform.thelink2.value = "<a href=\"http://"+urlAlias+"/?" + x + "" + y + "\">" + displayURL + "</a>";
document.theform.thelink3.value = "[url=http://"+urlAlias+"/?" + x + "" + y + "]" + displayURL + "[/url]";
return false;
}
<form name=\"theform\" onSubmit=\"return go();\" action=\"#\">
<fieldset>
<h3>Your URL:</h3>
<input class=\"anonym_input\" type=\"text\" maxlength=\"255\" name=\"nick\" value=\"http://\" />
<input class=\"anonym_FormSubmit\" type=\"button\" onClick=javascript:go() value=\"Generate URL\"/><br /><br />
<h3>This is the anonymous URL:</h3>
<textarea class=\"anonym_textarea\" name=\"thelink1\" wrap=\"soft\" cols=\"66\" rows=\"1\" style=\"height: 30px; overflow: auto;\"></textarea><br />
<br /><h3>This is the anonymous URL as an HTML link:</h3>
<textarea class=\"anonym_textarea_big\" name=\"thelink2\" wrap=\"soft\" cols=\"66\" rows=\"1\" style=\"height: 30px; overflow: auto;\"></textarea><br />
<br /><h3>This is the anonymous URL as a board link (works with any board software):</h3>
<textarea class=\"anonym_textarea_big\" name=\"thelink3\" wrap=\"soft\" cols=\"66\" rows=\"1\" style=\"height: 30px; overflow: auto;\"></textarea><br />
</fieldset>
</form>
thelink1= example[dot]com/?stackoverflow[dot]com/
thelink2= <a href="example[dot]com/?stackoverflow[dot]com/">stackoverflow[dot]com/</a>
thelink3= [url=example[dot]com/?stackoverflow[dot]com/]stackoverflow[dot]com/[/url]
如何使x = document.theform.nick.value;
成为base64编码?
感谢先进:)