Javascript: replace /escape character

venkatesh padmanabhan 181 Reputation points
2022-06-01T07:02:16.053+00:00

Hi.

I am trying to do a javascript change location bookmarklet - if condition to replace with another URL

javascript:if(location.host=='abc')(location.href='http://cde'+location.pathname+'\?test\=enable');

The code works fine, but the last ' comes as %27 . How to correct this ?
Thanks

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
{count} votes