How can I pass the php variables into an external javascript file? I found a lot of questions regarding this but I can't figure it out anyhow.
In the HTML file I have this link
<script type="text/javascript" src="myscript.php"></script>
This is the myscript.php file that I have been trying to output as a javascript file:
<?
Header("content-type: text/javascript");
?>
$(document).ready(function() {
$("#validate_form").validate({
rules: {
page_title: "required",
seo_url: "required"
},
messages: {
page_title: "<?=$page_title?>",
seo_url: "<?=$seo_url?>"
}
});
});