Take in mind the following; the code below and programs associated at it is runs perfectly.
<script>
window.vorderby = "YEAR"
exibelivrosAJAX();
</script>
but, when I did the modify below gave me the following error: Uncaught ReferenceError: YEAR is not defined
<script>
window.vorderby = <?php echo $_POST['formorderby']; ?>;
exibelivrosAJAX();
</script>
Looking for and reading tons of messages I did the following:
<script type="text/javascript" src="funcoesJS.js">
window.vorderby = <?php echo $_POST['formorderby']; ?>;
exibelivrosAJAX();
</script>
and the error was solved. But, the function exibelivrosAJAX() don't run.
Below you can see the two pieces of code that I think can help you to understand a little better.
1st piece of code in the primary file: echo " ";
2nd piece of code in another php file: window.vorderby = ; exibelivrosAJAX();
Could you help me to understand it? Thanks a lot! Marcos.