I have jsp code as:
onclick="showURL('${result.url}')"
${result.url} is dynamic value. When an apostrophe comes in the URL I get the error.
I have tried all the methods like escape, encodeURI, replacing the single quotes with double but nothing works.
Script call is as follows:
function showURL(name){
    alert(name);
} 
 
     
     
     
    