0

I'm passing some query parameters to an html page. One of these is the title where in some of these there are words with " " characters.

What I notice is that when it reaches the superscript (" ") the title is truncated.

That is, if for example I have the following title:

Chaleco López inaugurates the museum of "him"

the title parameter will be equal to: Chaleco López inaugurates the museum of (so it is incomplete because "him" is missing).

The code that does this is as follows:

var url_string = window.location.href;
var url2 = new URL(url_string);
var titolo_url = url2.searchParams.get("title");
console.log(title_url)
Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
a_l_e_x
  • 408
  • 1
  • 6
  • 20

1 Answers1

-1

Maybe try to use these brackets '' in your title

  • Why? That doesn't change anything in this case, see [this post](https://stackoverflow.com/a/242833/17852419). Btw they aren't called *brackets* but *quotes* – nare214 Feb 01 '22 at 18:23