<script type="text/javascript" language="javascript">
function urlencode(s) {
if (s == null || s.value == null || s.value == '') {
alert("Url to encode is null or empty!");
return ;
}
var uri = encodeURIComponent(s.value)
document.getElementById('output').value = uri;
}
function urldecode(s) {
if (s == null || s.value == null || s.value == '') {
alert("Url to decode is null or empty!");
return ;
}
var uri = decodeURIComponent(s.value)
document.getElementById('output').value = uri;
}
</script>
<form action="" id="urlform">
<table cellspacing="1" cellpadding="1">
<tr>
<td>
<input type="text" id="url" name="url" size="64" maxlength="256"
value="http%3A%2F%2Fblog.area23.at%2F" />
</td><td>
<input type="button" id="deocde" name="deocde" value="deocde"
onclick="urldecode(document.getElementById('url'))" />
</td><td align="right">
<input type="button" id="encode" name="encode" value="encode"
onclick="urlencode(document.getElementById('url'))" />
</td><td align="right">
a simple url encoder/decoder
</td>
</tr><tr>
<td colspan="3">
<input type="text" id="output" name="output" size="90" maxlength="256" readonly="readonly" />
</td><td align="right">
<a href="http://blog.area23.at">http://blog.area23.at</a>
</td>
</tr>
</table>
</form>
function urlencode(s) {
if (s == null || s.value == null || s.value == '') {
alert("Url to encode is null or empty!");
return ;
}
var uri = encodeURIComponent(s.value)
document.getElementById('output').value = uri;
}
function urldecode(s) {
if (s == null || s.value == null || s.value == '') {
alert("Url to decode is null or empty!");
return ;
}
var uri = decodeURIComponent(s.value)
document.getElementById('output').value = uri;
}
</script>
<form action="" id="urlform">
<table cellspacing="1" cellpadding="1">
<tr>
<td>
<input type="text" id="url" name="url" size="64" maxlength="256"
value="http%3A%2F%2Fblog.area23.at%2F" />
</td><td>
<input type="button" id="deocde" name="deocde" value="deocde"
onclick="urldecode(document.getElementById('url'))" />
</td><td align="right">
<input type="button" id="encode" name="encode" value="encode"
onclick="urlencode(document.getElementById('url'))" />
</td><td align="right">
a simple url encoder/decoder
</td>
</tr><tr>
<td colspan="3">
<input type="text" id="output" name="output" size="90" maxlength="256" readonly="readonly" />
</td><td align="right">
<a href="http://blog.area23.at">http://blog.area23.at</a>
</td>
</tr>
</table>
</form>
Keine Kommentare:
Kommentar veröffentlichen