Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / November 2005

Tip: Looking for answers? Try searching our database.

getting document title and URL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
r_ahimsa_m@poczta.onet.pl - 20 Oct 2005 11:50 GMT
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.
Please help me.
Raul Macias - 20 Oct 2005 22:04 GMT
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

> Sorry for my English...
>
[quoted text clipped - 13 lines]
> work either.
> Please help me.
Ma³y Piotruœ - 12 Nov 2005 17:21 GMT
>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

Thank you very much.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.