Link to home
Start Free TrialLog in
Avatar of ullenulle
ullenulleFlag for United States of America

asked on

Javascript doesn't work as it uset to anymore...

Hi there.

I use some javascript to create an email from clicking an icon. The script is like this:

function clickemailuhk() {
	username = "uhk";
	hostname = "xxxxx.dk";
var linktext = username + "@" + hostname ;
    var link = "mailto:" + linktext + "&subject=" + escape("XXXXXX website...");
    window.location.href = link;
}

Open in new window


And it is activated with this:

<img src="images/Mail_icon_mini.png" width="26" height="26" title="Click to send email" onClick="clickemailuhk()">

Open in new window


It used to work fine, but now it creates an email with this in the "To" field:

uhk@xxxxx.dk&subject=AgeCare website...


It used to place the subject in the subject-field in an email.
I use Outlook. What happened lately, and how can I correct it to work as intended?

Best regards

Ulrich
Avatar of David Favor
David Favor
Flag of United States of America image

Provide the URL where your code exists.

Many times invalid HTML will work, then fail as new browsers release.

If nothing else has changed, this may be the problem.

You can also use https://validator.w3.org/nu/ to test HTML syntax yourself.

Tip: Fix all HTML syntax errors first, then retest.
ASKER CERTIFIED SOLUTION
Avatar of ullenulle
ullenulle
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The first parameter in a URL must be preceeded by a ? - it is possible that earlier versions of Outlook were lenient in this regard and then changed to stick more rigidly to the standard.

Bottom line if it was working before based on a non-standard implementation then it is expected that at some point it would break.