In javascript, there are 2 ways to do URL encoding.
1) encodeURIComponent() - This should be used only to encode query parameters.
eg. name=John Conner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="js" description="Query Parameter Encoding Script"> | |
mc.setProperty("ENCODED_PARAMS", encodeURIComponent(mc.getProperty('QUERY_PARAMS'))); | |
</scrpt> | |
eg. www.transformers.com/charactors?name=John Conner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="js" description="URL Encoding Script"> | |
mc.setProperty("ENCODED_URL", encodeURI(mc.getProperty('URL_TO_BE_ENCODED'))); | |
</scrpt> | |
No comments:
Post a Comment