Jump to content

Archived

This topic is now archived and is closed to further replies.

jwwceo

How to integrate PHP and Javscript

Recommended Posts

I want to add some javascript rollover menus to my php pages. But the javascript menu items will be pulled from my MySQL databse.

I usually have a seperate .js file which I link in at the top of my HTML...

but if this seperate document is a php doc (that outputs javascript) will this still work..

what's the best way to go about this????

Share this post


Link to post
Share on other sites
Instead of using Javascript for the rollover menus, think about using CSS. Most of the CSS implementations are based on simple [nobbc]<ul></ul>[/nobbc] lists.  Take a look at http://css.maxdesign.com.au/listamatic/ for more information.

Ken

Share this post


Link to post
Share on other sites
The menus are supposed to pop up when a link is hovered on, not just change color....

can this be done with CSS???
sorry for not being clear...

Share this post


Link to post
Share on other sites
It is possable.
http://cssplay.co.uk/menus/index.html
Many examples of neat CSS menus. (including ones similar to that which you describe.)

Share this post


Link to post
Share on other sites
Try this one:

http://www.dhtmlgoodies.com/index.html?whichScript=dhtmlgoodies_menu2

It uses an unordered list, but it also uses js to make it compatible with IE without using some crazy hacks the only work half the time.

Share this post


Link to post
Share on other sites
I like the last menu...thanks..1 question....

This may sound stupid..but I don't want to jarble up my <head> with all that css and script data..

can I make one big php file to echo the whole thing and just plop it into my header...and just include the php file....

JW

Share this post


Link to post
Share on other sites
I would use an external CSS stylesheet, and external script. thus only 2 lines need to be in the header, and the browser may cache the data for faster loading times.

Share this post


Link to post
Share on other sites
I already have a Style sheet applied...will this style sheet overide the other one for containers of the same type....

how do you make sure that for items like <html> or <p> the right style sheet is being used...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.