I have a javascript that works fine
<script>
$(document).ready(function(){
$('.delete').click(function()
{
alert('passed');
});
});
</script>
But when I saved all those script to a PHP variable
$phpVariable = "<script>
\$(document).ready(function(){
\$('.delete').click(function()
{
alert('passed');
});
});
</script>";
and echoed the variable (with or without backslash on dollar '$' sign inside javascript)
echo "$phpVariable";
The problem exists. Javascript doesn't work anymore. Can we save javascript code to php variable without encountering mulfunction?
echo "$phpVariable"?