What is the best way to seperate my js code from the rest of my code? I have tried to do a PHP include without success. Interestingly the code still shows up in the browser source, but not in the browser display.
If I embed the JS in the file all is fine.
Please advise.
PHP include of menu not working
I know the Milonic site is php, I don't know if they use includes, but I do know they rename the menu_data.js file to menu_data.php. I really don't know about php, so I'm not sure if that addresses your issue. Or if you are asking what the include code would be to include a js file? Is one I saw on a search, but since I got that on a search I have no clue if it's even correct
Ruth
Code: Select all
<?php include("js_file.inc"); ?>

Ruth
partly works
I changed the name of the JS files to PHP and I can include those files.
but I still needed Milonic specific code down further in the content inorder to embed the menu at a certain location of the page layout. This is the code that shows up in the browser source, but will not work unless I put it statically into the file. Which would be tedious to maintain if i want to reuse that code in other files.
but I still needed Milonic specific code down further in the content inorder to embed the menu at a certain location of the page layout. This is the code that shows up in the browser source, but will not work unless I put it statically into the file. Which would be tedious to maintain if i want to reuse that code in other files.
George