I have the below in a navigation Bar, which works Well. My only concern here is that the function will get called EVERY time a page is loaded. So, My question here is “Does anyone know of a better way of doing this?”. Build the value when the navigation item is clicked?
<?php
$cal_info=calendar();
echo “<li><a href=”javascript:void(0)” onClick=”buildwindow(500,400,’Calendar of Events’,’$cal_info’)”>Calendar</a></li>”;
?>
<?php
function calendar()
{
include(“user_access/include/values_main_page_right_marg.php”);
$r_margin_tot = count($rmargin_value);
for($i = 0; $i < $r_margin_tot; $i++)
{
$calendar = “$calendar• $rmargin_value[$i]<br>”;
}
return $calendar;
}
?>
I know you cannot call a php script from Javascript, so anyone here have any better solutions?
Thought about executing the function when the page is initially loaded and storing the value somewhere (MySql), dont want to use a cookie.
Thanks in advance.
DPK