JavaScript Editor Ajax software     Free javascripts 



Main Page

Figure 6-3
That was quite a bit of code, but this is a useful technique! Once your popup library is in place, it
becomes really easy to make the navigation link show up whenever it is needed. Here you use the
simulated popup window method, but you could have also used a regular JavaScript popup with
the same results.
In order to add the navigational link to any popup, there are only two steps you need to take. First,
you need to include the
popup_utils.inc.php
script in your popup script. This is what you did in
popup.php
:
<?php
// load the popup utils library
require_once ‘include/popup_utils.inc.php’;
?>
Then, you need to call the
display_popup_navigation()
function that’s defined in
popup_
-
utils.inc.php
, in the place where you want the navigational link included:
<?php
// display popup navigation only when visitor comes from a SERP
display_popup_navigation();
?>
127
Chapter 6: SE-Friendly HTML and JavaScript
c06.qxd:c06 10:55 127


JavaScript Editor Ajax software     Free javascripts