JavaScript Editor Ajax software     Free javascripts 



Main Page

alter the references to
heading.php
and
test.tif
to reflect their location under the
dynatext
folder, as shown here:
function com_stewartspeak_replacement() {
/*
Dynamic Heading Generator
By Stewart Rosenberger
http://www.stewartspeak.com/headings/
This script searches through a web page for specific or general elements
and replaces them with dynamically generated images, in conjunction with
a server-side script.
*/
replaceSelector(“h1”,”dynatext/heading.php”,true);
var testURL = “dynatext/test.tif” ;
var doNotPrintImages = false;
var printerCSS = “replacement-print.css”;
var hideFlicker = false;
var hideFlickerCSS = “replacement-screen.css”;
var hideFlickerTimeout = 100;
10.
You now need to create a PNG image file named
test.tif
in your
seophp
folder. This file
can contain anything, but it’s best if it’s as small as possible — such as a 1x1 pixel image. This
is a probe file used by the scripts for testing browser features.
If
test.tif
is not present, your
text won’t be replaced.
You can copy this file from the code download of this chapter.
11.
Modify
popup.php
by adding a reference to the
replacement.js
script:
<?php
// load the popup utils library
require_once ‘include/popup_utils.inc.php’;
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN”
“http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
<html>
<head>
<title>: Table of
Contents</title>
<script src=”dynatext/replacement.js” type=”text/javascript”></script>
</head>
<body onload=”window.resizeTo(800, 600);”
onresize=’setTimeout(“window.resizeTo(800, 600);”, 100);’>
<h1>: Table of Contents</h1>
12.
Load
http://seophp.example.com/popup.php
. If you followed the steps correctly and your
machine is configured with GD2 support, you should get your title replaced with an image as
shown in Figure 6-10. Compare Figure 6-10 with Figure 6-2 in order to see the difference!
139
Chapter 6: SE-Friendly HTML and JavaScript
c06.qxd:c06 10:55 139


JavaScript Editor Ajax software     Free javascripts