Encoding ampersands in URL
I am making an ajax request from a regular html page (NOT php!) to get posts from a WordPress blog:
The html page fails validation because of the ampersands in the URL string. I tried to encode them using ‘&’, ‘%26’ and ‘\u0026’ but all of them fail.
Using ‘&’ returns a json error: “Include ‘id’ or ‘slug’ var in your request.”
Using ‘%26’ or ‘\u0026’ ignores the category id and count variables and returns the default 10 latest post.
Any ideas how can I correct the URL to make the page pass validation?
- The topic ‘Encoding ampersands in URL’ is closed to new replies.