ullenulle
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:
And it is activated with this:
It used to work fine, but now it creates an email with this in the "To" field:
uhk@xxxxx.dk&subject=AgeCa re 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
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;
}
And it is activated with this:
<img src="images/Mail_icon_mini.png" width="26" height="26" title="Click to send email" onClick="clickemailuhk()">
It used to work fine, but now it creates an email with this in the "To" field:
uhk@xxxxx.dk&subject=AgeCa
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
Bottom line if it was working before based on a non-standard implementation then it is expected that at some point it would break.
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.