sg

Perşembe, Aralık 15, 2005

Re: google's email() link function


The Google email link uses encodeURIComponent() to encode magic
characters, such as "?" and "&".

The <a> tag calls a Javascript function.

The function obtains the subject in the current language, and the full
URL that it's going to send, encodes them and href's the result.

A bit like this

<a href="javascript:myemail()">Email Link</a>

function myemail() {
var a = "mailto:?subject="
+ encodeURIComponent('The Subject')
+"&body="
+ encodeURIComponent('http://pathtomap.php?address=17+East+79th+St');
window.location.href=a;
}

--
The Blackpool Community Church Javascript Team
http://www.econym.demon.co.uk/googlemaps/

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık