...

View Full Version : simple problem



angst
08-13-2004, 08:54 PM
my code:

<script type="text/javascript">
function insert_url() {
var url = window.prompt('Please enter the URL of your link:', 'http://');
var urlname = window.prompt('Please enter a name for your link:', '');

if(url) {
url = '' + url + '[a]' + urlname + '';
var tarea = document['post']['message'];
if(tarea.createTextRange && tarea.caretPos) {
var cpos = tarea.caretPos;
cpos.text = (cpos.text.charAt(cpos.text.length - 1) == ' ') ? url + ' ' : url;
}
else tarea.value += url;
tarea.focus();
}
}
</script>

Hello,
I tried adding this line to the above code:
var urlname = window.prompt('Please enter a name for your link:', '');

but for some reason, when i enter a value is does not show up in here:
url = '' + url + '[a]' + urlname + '';

the + url +
still just shows up twice?

what am i doing wrong here?

angst
08-13-2004, 08:59 PM
nevermind,,
i'm a dumb ***, it does work,
i forgot to refresh the page..

:rolleyes:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum