Parameters

value string The raw value to encode.

Returns

string The percent-encoded string, safe for a URL.

Examples

escapeUrl percent-encodes a string so it survives intact inside a URL. Characters like space, &, =, + or / otherwise break the link or get misread by the server — a real risk in tracking URLs, mirror pages and optout / landing-page links, where the value often carries personalization fields or an encrypted recipient id.

It is a global function available in every server-side JavaScript context and in personalization blocks (<%= %>). Pass it a single string and use the returned value; encode each parameter individually, not the whole URL. It is typically wrapped around an already-encrypted value (cryptString) or a recipient field before it is concatenated into the link.

var recipient = { id: 42 };
var strAESKey = "your-base64-aes-key";
var url =
  "<%@ include option='NmsServer_URL' %>/crm/sc.jssp?rcp=" +
  escapeUrl(cryptString(recipient.id + "|public", strAESKey));

See also