We help IT Professionals succeed at work.
Get Started

How do I use jQuery to convert a url in these three formats?

badwolfff asked
Last Modified: 2015-07-26
The url I need to process is: http://demo.missionfamily.org/index.php?route=product/allevent

and it should become:






I don't know how to formulate this one at all, but here are the details:
mailto: email address has to be empty as it will need to be filled in
subject: whatever I can get from: var thisTitle (whose spaces will need to be converted into %20)
body: whatever I can get from: var thisLink (this will be a url link which will need to be converted to the format compatible with the maito syntax.

So in the third case basically the result should look something like: mailto:?subject=Congrats%20Obama&body=http%3A%2F%2Fdemo.missionfamily.org%2Findex.php%3Froute%3Dproduct%2Fallevent&t=All+Events+Listing

Please help, as I am completely clueless. The rest of the code for the structure where these links have to go I have already managed but I haven't a clue as to how to generate these links

thanks in advance
Watch Question
Owner (Aidellio)
Most Valuable Expert 2015
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE