Fix url encoding if it contains parameters

The url was not encoded enough if it contains some parameters.
For instance `mysite.com/?post_type=page&post_id=24` would create a faceook like on `mysite.com/?post_type=page`.

I changed encodeURI to encodeURIComponent and it fixed my issue.