I've created Popup menus that work fine in HTML pages (www.anakhacoman.com), but for some reason these same menus aren't working on a PHP page (www.anakhacoman.com/blog)
Any help appreciated - thanks!
I've created Popup menus that work fine in HTML pages (www.anakhacoman.com), but for some reason these same menus aren't working on a PHP page (www.anakhacoman.com/blog)
Any help appreciated - thanks!
The problem is here:
You're using that same code on both pages, but on the blog page, you've gone down one directory, so you need to change the "src" attribute to either:Code:<script language="JavaScript" src="mm_menu.js"></script>
orCode:<script language="JavaScript" src="../mm_menu.js"></script>
The second option may be preferred, as it will always start you at the root directory, so it doesn't matter how many directories down you are.Code:<script language="JavaScript" src="/mm_menu.js"></script>
wispsofsmoke (11-10-2010)
Hi Schmoopy - does the single "/" start you from the root on all systems?The second option may be preferred, as it will always start you at the root directory, so it doesn't matter how many directories down you are.
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
No - the .../ goes down one directory. I'm pretty sure that just the / does nothing.
Jeremy | jfein.net
So, if in doubt, its probably safest to use an absolute path or something like href="<?php 'http://'.$_SERVER['HTTP_HOST']?>/path/to/js/script.js" in the case of an application where you dont know the domain. (I think)
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
What do you mean? If I had a script file in /scripts/blah.js, and I was running an html file in files/blah.html, to link from files/blah.html, I would do: ../scripts/blah.js which would go up one level the parent directory, and then find the folder scripts.
Jeremy | jfein.net
Thanks - it's working now!
Amazing how sometimes it comes down to something so simple . . .
Bookmarks