Click to See Complete Forum and Search --> : Is this Javascript?.........


_beetlebug_
02-09-2003, 12:27 AM
:confused:
When you see in the url the ? symbol.

eg.
page.html?name=Fred

Who can I write on the page the word 'Fred'?

document.write(fred)

??????

pyro
02-09-2003, 12:39 AM
It can be anything really. JavaScript, PHP, etc...

Anyway, to write fred (the value of name= in the URL after the ?) on your page with javascript...

<script type="text/javascript">
pageURL = document.location.href;
temp = pageURL.split ("?");
value = temp[1].split ("=");
document.write (value[1]);
</script>

Charles
02-09-2003, 08:35 AM
<script type="text/javascript">
<!--
if (/name=(.*)/.test(window.location.search)) document.write('<p>', RegExp.$1, '</p>');
// -->
</script>