D
donpro
Hi,
I've created a table where the header columns link to an AJAX function
which calls a PHP file and returns content - the purpose is to sort
the table on the heading.
The code snippet is:
<th scope="col"><a href="javascript:;" onclick="loadBookingContent('<?
php echo $SERVERPAGE_URL . SORT_BY_BOOKING; ?>','innerhbl')">Booking</
a></th>
<th scope="col"><a href="javascript:;" onclick="loadBookingContent('<?
php echo $SERVERPAGE_URL . SORT_BY_VESSEL; ?>','innerhbl')">Vessel</
a></th>
<th scope="col"><a href="javascript:;" onclick="loadBookingContent('<?
php echo $SERVERPAGE_URL . SORT_BY_CUTOFF; ?>','innerhbl')">Cutoff</
a></th>
The $SERVERPAGE_URL variable also contains one parameter, a session ID
I would like to convert this to DOM and store the code in an external
JS file thereby separating the JavaScript code from the HTML.
However, I need to pass the first content of the loadBookingContent()
function but my PHP code doesn't work in an external JS file.
I'm relatively new at DOM but there must be a way.
Thanks,
Don
I've created a table where the header columns link to an AJAX function
which calls a PHP file and returns content - the purpose is to sort
the table on the heading.
The code snippet is:
<th scope="col"><a href="javascript:;" onclick="loadBookingContent('<?
php echo $SERVERPAGE_URL . SORT_BY_BOOKING; ?>','innerhbl')">Booking</
a></th>
<th scope="col"><a href="javascript:;" onclick="loadBookingContent('<?
php echo $SERVERPAGE_URL . SORT_BY_VESSEL; ?>','innerhbl')">Vessel</
a></th>
<th scope="col"><a href="javascript:;" onclick="loadBookingContent('<?
php echo $SERVERPAGE_URL . SORT_BY_CUTOFF; ?>','innerhbl')">Cutoff</
a></th>
The $SERVERPAGE_URL variable also contains one parameter, a session ID
I would like to convert this to DOM and store the code in an external
JS file thereby separating the JavaScript code from the HTML.
However, I need to pass the first content of the loadBookingContent()
function but my PHP code doesn't work in an external JS file.
I'm relatively new at DOM but there must be a way.
Thanks,
Don