/    Sign up×
Community /Pin to ProfileBookmark

& signs in document.href (mailto:)

A “send this page to a friend reads”

{
function friendlist()
document.location.href = “mailto:?subject=You’ll like this page on HandicappedPets.com&body=It’s at: “+ window.document.location.href
}

The problem is that the doc I’m trying to send is:

http://www.handicappedpets.com/gallery/index.php?category_id=&parent_id=0&photo_id=5&countdisplay=&start=0

The & signs in the URL mess up the &body section so that all I get in the body of the email is:

http://www.handicappedpets.com/gallery/index.php?category_id=

Can I parse the document.location.href somehow to change tha & sign to “%38” ? Any other ideas?

Thanks,
[email][email protected][/email]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 26.2006 — escape(window.document.location.href)
Copy linkTweet thisAlerts:
@markcrobinsonauthorMar 26.2006 — I appreciate the help.
Copy linkTweet thisAlerts:
@felgallMar 26.2006 — Will not work for a lot of people because 10% have Javascript turned off and a significant portion of others don't have an email program available on their computer that is linked to the browser (eg. internet cafes, computer clubs, those who only have email access via webmail, etc.).
Copy linkTweet thisAlerts:
@FangMar 27.2006 — Will not work for a lot of people because 10% have Javascript turned off and a significant portion of others don't have an email program available on their computer that is linked to the browser (eg. internet cafes, computer clubs, those who only have email access via webmail, etc.).[/QUOTE]True of the majority of Q&A post in the JavaScript forum; they will also require a server-side solution.
×

Success!

Help @markcrobinson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...