To solve a problem with single quotes PHP and javascript...you should do like this.
Used command str_replace("'","\'", variable);
example:
<script type="text/javascript">
function deletethis(filename){
//do something here
alert(filename);
}
</script>
<body>
<?php
$filename = "What's this.pdf";
?>
<a href="javascript:void(0)" id="delfile"
onclick="deletethis('<?php echo str_replace("'", "\'", $filename) ?>')">Padam</a>
</body>
Kakicode: Handle Single Quotes In Html,Php And Javascript >>>>> Download Now
ReplyDelete>>>>> Download Full
Kakicode: Handle Single Quotes In Html,Php And Javascript >>>>> Download LINK
>>>>> Download Now
Kakicode: Handle Single Quotes In Html,Php And Javascript >>>>> Download Full
>>>>> Download LINK