kopman Posted August 1, 2006 Share Posted August 1, 2006 I have inherited a website that has 40 pages each with the code for the menu in it. I want to remove that to it's own function in a separate file to make management easier. I have created the file and added the function which builds a $menu variable which is returned to the main file. The function adds line similar to below$menu .= "<img border='0' id='img70' src='images/nav_buttons/home_link.gif' height='20' width='156' alt='Home' onmouseover='FP_swapImg(1,0,/*id*/'img70',/*url*/'images/nav_buttons/home_active.gif')' onmouseout='FP_swapImg(0,0,/*id*/'img70',/*url*/'images/nav_buttons/home_link.gif')' onmousedown='FP_swapImg(1,0,/*id*/'img70',/*url*/'images/nav_buttons/home_hover.gif')' onmouseup='FP_swapImg(0,0,/*id*/'img70',/*url*/'images/nav_buttons/home_link.gif')' fp-style='fp-btn: Glass Capsule 1; fp-font-color-normal: #D82D01; fp-font-color-hover: #D82D01; fp-font-color-press: #D82D01; fp-justify-horiz: 0; fp-proportional: 0' fp-title='Home'></a></TD></tr>";As you can see it includes calls to a javascript function to replace images when the cursor moves in and out of the menu button and the picture should change as you do it. These calls aren't working. Should I be approaching this differently or are the js functions not going to work when called in this way?Thanks.Peter Quote Link to comment Share on other sites More sharing options...
Eric_Ryk Posted August 1, 2006 Share Posted August 1, 2006 What you have is a case of client-side vs. server-side. Server-side is not seen by the browser, while client-side is. So javascript is client-side, and will be sent through to the browser and read. So in this case, that will work. However there is no way to obtain a value from a client-side language and use it on the server-side. Quote Link to comment Share on other sites More sharing options...
kopman Posted August 1, 2006 Author Share Posted August 1, 2006 Thank you for that, makes sense now. :) Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted August 1, 2006 Share Posted August 1, 2006 [quote]However there is no way to obtain a value from a client-side language and use it on the server-side.[/quote]As was said in the movie Independence Day "That is not entirely accurate".You can now pass information from the client to the server without invoking a page load by using AJAX.Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.