Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8858229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:46:51+00:00 2026-06-14T14:46:51+00:00

I am trying to call a mailto: URI which is stored in a variable.

  • 0

I am trying to call a mailto: URI which is stored in a variable. When I do window.location.href = mailto_link; Firefox gives me the following error:

NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057        
(NS_ERROR_ILLEGAL_VALUE) [nsIDOMLocation.href] 

window.location.href = mailto_link;` 

What IE says:

Object doesn't support this property or method

The code works in Chrome but not in IE nor Firefox.

my original function:

function email()
{
    var nom = $('#nom').val();nom = encodeURIComponent(nom);
    var compagnie = $('#compagnie').val();compagnie = encodeURIComponent(compagnie);
    var rue = $('#rue').val();rue = encodeURIComponent(rue);
    var ville = $('#ville').val();ville = encodeURIComponent(ville);
    var province = $('#province').val();province = encodeURIComponent(province);
    var cp = $('#cp').val();cp = encodeURIComponent(cp);
    var remarques = $('#remarques').val();if(remarques ==""){remarques = "Aucune remarque.";}remarques = encodeURIComponent(remarques);
    var quantite = $('#quantite').val(); 
    var email= "someEmail@somedomain.com";
    var subject= "Nouvelle commande";
    var body_message= "%0D%0D%0D%0D"+nom+"%0D"+compagnie+"%0D"+rue+"%0D"+ville+", "+province+"%0D"+cp+"%0D%0D%0DRemarques:"+remarques+"%0D%0D Quantit%E9:"+quantite;
    var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message;
    window.location.href = mailto_link;
}

UPDATE 1

I found out what was causing the issue for IE, although I am still looking to resolve it for Firefox. The problem for IE was that I had a console.log(); which wouldn’t be recognized (IE8 and lower versions).

Here is a console.log() of the content of mailto_link:

mailto:someEmail@someDomain.com?subject=Nouvelle commande&body=Charger %0Dmodems des %CEseulement%0D%0D%0D%0Djshad%0Daskjda%0Daskdj%0Daskdj, askdj%0DJ9P%204A1%0D%0D%0DRemarques:asldk%0D%0D Quantit%E9:14 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:46:52+00:00Added an answer on June 14, 2026 at 2:46 pm

    Firefox is apparently unable to handle the ISO 8859-1 characters above 128 in URLs. The problem disappears if you remove the %CE(Î) and %E9(é) from your logged example. Unfortunately, the only workaround I can think of requires manually replacing extended characters like those with an equivalent (perhaps HTMLEntities*). Since there is no native function to do so in Javascript, that could get quite annoying.

    **Because HTMLEntities are only rendered properly in an HTML context, and mailto: URIs produce a plain-text message body, this is an imperfect solution. Below is a function that will do this, but the message will have instances of é and the like. Perhaps a more convenient solution is to convert accented characters to their equivalents in the first 128 ASCII characters as you mentioned in the comments.*


    function encodeISO8859 (str) {
        var rstr="";
        for(var i=0; i<str.length; i++) {
            var c = str.charCodeAt(i);
            if(c>191&&c<=255&&!(c==215||c==247)){
                console.log(c);
                rstr += "&#"+c+";";
            } else {
                rstr += str.charAt(i);
            }
        }
        return rstr;
    }
    

    This will turn any character in the ISO8859-1 character set (see bottom of page) into its equivalent HTMLEntity. Use this BEFORE encoding for URI:

    var nom = $('#nom').val();nom = encodeURIComponent(encodeISO8859(nom));
    

    Of course, only do this if the accented characters are absolutely necessary for comprehension, and there’s likely to be overlap between many accents that use the same base character (like A).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to call some ejb bean method from tread. and getting error :
When trying to call this function in my code i get the error in
Im trying to call if div exists with the following code. Div 1 and
In the following I am trying call action script function from js function. What
Im trying to call the following code: Ext.namespace(menu); menu.menuItems = function(){ var menuItems= [{
I get this error trying call my service in WcfTestClient My config: <services> <service
Im trying to call a js function on a HTML element which I have
Trying to call a function from another file in C with the following code:
Am trying to call a UDF which just takes a parameter and returns a
Trying to call a SAP SOAP Web Service from a generated sudzc app shows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.