0

I need to pass a html message through url query string. But i am getting error. I have tried encodeURIComponent() , encodeURI(), escape()

    var uriMessage = encodeURIComponent("<p>This is my test message..</p>");
    window.open("/controller/action?param=" + uriMessage, "_blank");

Any help will be really appreciated.

Jidheesh Rajan
  • 4,744
  • 4
  • 23
  • 29

1 Answers1

0

You don't need to encode html somehow, the simple window.open should work. Without knowing what error do you receive it is pretty hard to tell what do you issue.

Also please take a note that the maximum request length for GET requests are pretty short, as you can see in this post, so sending raw html in a query string does not look like a clean solution.

donatasj87
  • 760
  • 9
  • 23