So I am trying to add a js script into a file using php but when I try this nothing happens. Am I able to put that type of function in the $content string?
$dirPath = "Test";
$filename = $dirPath.".js";
$content = "$(document).ready(function() {$('.Name').load('".$dirpath.".txt');});";
file_put_contents($filename, $content);
Can someone please explain to me why it isn't working. Thanks very much.