Jquery in PHP & Perl…

When we try to print “jquery” inside “PHP or Perl” using “echo or print” statement we should escape the$” symbol used in the jquery. It should be as follows.

print qq{

<script type=”text/javascript”>
(function(\$) {
\$(function() {
\$(“#scroller”).simplyScroll({orientation:’vertical’,customClass:’vert’});
});
})
(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller1”).simplyScroll({direction:’backwards’});
});
})(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller2”).simplyScroll({direction:’backwards’});
});
})(jQuery);
</script>

}

echo ‘

<script type=”text/javascript”>
(function(\$) {
\$(function() {
\$(“#scroller”).simplyScroll({orientation:’vertical’,customClass:’vert’});
});
})
(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller1”).simplyScroll({direction:’backwards’});
});
})(jQuery);
(function(\$) {
\$(function() {
\$(“#scroller2”).simplyScroll({direction:’backwards’});
});
})(jQuery);
</script>

‘;