all groups > dotnet jscript > october 2005 >
You're in the

dotnet jscript

group:

getting document title and URL


getting document title and URL r_ahimsa_m NO[at]SPAM poczta.onet.pl
10/20/2005 12:00:00 AM
dotnet jscript:
Sorry for my English...

I am new to JavaScript. I have written short script to create a link
sending e-mail:

<script type="text/javascript">
document.getElementById("MailTo").href =
"mailto:r_ahimsa_m@poczta.onet.pl" +
"?subject=" + document.title + "&amp;" +
"body=" + location.href;
</script>
<a id="MailTo" href="">Send this page via e-mail...</a><br/>

I don't know why the script is not called (thus solution doesn't
work). I have tried to place the script in <head> section. Doesn't
work either.
Re: getting document title and URL Raul Macias
10/20/2005 2:04:48 PM
The problem is by the time you are trying to find the hyperlink element it
doesn't exist (it hasn't been rendered by the browser yet). Just move the
script anywhere after the <a> tag (for example at the end of your page) and
it will work.

-Raul

[quoted text, click to view]

Re: getting document title and URL Ma³y PiotruĊ“
11/12/2005 12:00:00 AM
On Thu, 20 Oct 2005 14:04:48 -0700, "Raul Macias"
[quoted text, click to view]

AddThis Social Bookmark Button