How to put single quote with in single quote in jquery string ?
var buttonString = "<button onclick='window.webkit.messageHandlers.callbackHomePageHandler.postMessage('Redirecting to Home');' class='agree' style='color:#EE8B13;border:none;background:white;padding:0px 3px'> <b>here</b> </button>";
In above example, onclick event has single quote with in single quote. This syntax give error when its render in browser.
Solution: replace inner single quote with '
var buttonString = "<button onclick='window.webkit.messageHandlers.callbackHomePageHandler.postMessage('Redirecting to Home');' class='agree' style='color:#EE8B13;border:none;background:white;padding:0px 3px'> <b>here</b> </button>"
Share This with your friend by choosing any social account