Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:51

PHP include of menu not working


Poster: gjensen
Dated: Monday March 7 2005 - 2:41:19 GMT

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.


Poster: Ruth
Dated: Monday March 7 2005 - 3:01:02 GMT

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?
Code:
<?php include("js_file.inc"); ?>
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

partly works


Poster: gjensen
Dated: Monday March 7 2005 - 3:38:32 GMT

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.


Poster: Ruth
Dated: Monday March 7 2005 - 8:56:25 GMT

I think I didn't explain clearly. It's the menu_data file you name menu_data.php not the program files. They remain as .js files as far as I know. I've never seen anyone saying to convert the actual program files to php.

Ruth


Poster: John
Dated: Monday March 7 2005 - 15:32:32 GMT

Ruth is correct. The menu code files must always remain as .js, but the _data file can be essentially anything - .js, .cfm, .php, etc. If you don't make the change your code in that file will never be parsed.