javascript - How do I get this "Share" button to grab the current URL's HTML title in addition to URL? -


I am trying to create the original share button in the form of a learning project. I'm stumped about a little bit of an aspect, while I can catch the URL of the current page and pass it in the URL which prepares the share form, I'm not sure how the HTML title can be increased.

What do I have to do here:

  & lt; A href = "http://www.domain.com/submit" onclick = "window.location = 'http://www.domain.com/submit?url=' + encoder component (window location); return false ; "& Gt; It & lt; / A & gt; Share  

To get the title of the current page, what do I add to the optical section? Whatever will be passed in the URL as "title =".

Bonus: Is there something that I can send some highlighted text from the current page? This URL will be known as "body ="

So I want to fill in these empty spots:

   

I think You want to receive the selected text is a bit more complicated, especially if you want to support IE is the standard DOM, but for IE you can find it The problem is a mess - I have not checked if things have improved in IE8.

Besides, I had to say that where the share button will be? If it is in the page, clicking on the button The selection of the text that is selected is selected.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -