I am trying to reference a JavaScript file, containing a table sort function, in a PHP file.
Everything functions the way it should, but once I add the code below to my PHP report page it causes issues with the format of the tabs on my navigation page. The same issue comes up if I add a random document.write
outside of the PHP code. Not a huge issue but rather unsightly to the user.
Benim php Gezinme sayfası biçimi ile interfer olmaz JavaScript kaynak doc başvurmak için daha iyi bir yolu var mı? Ben açgözlü değilim basit bir düzeltme var gibi hissediyorum.
<script language="JavaScript" src="include/sorttable.js"></script>
Ayrıca kullanılan PHP echo
PHP etiketleri çağrı, aynı sorunu yapmak için içeride.
İşte biçimi sorunu üzerinde geliyor olduğunu sekmeler için navigasyon kodu parçasıdır.
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////
function start_page_printer_friendly(
$section = "home",
$headContents = null,
$bodyAttributes = null
)
//////////////////////////////////////////////////////////////////////////////////////////////////
{?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php print $page_title; ?></title>
<link href="/trellis_portal/include/portal.css" media="screen"
rel="Stylesheet" type="text/css" />
<?php if ( ! is_null($headContents)) { print $headContents; } ?>
</head>
<body onload="printpage();" <?php if ( ! is_null($bodyAttributes)) { print $bodyAttributes; } ?>>
<script language="JavaScript">
<!--
function printpage() { window.print(); }
-->
</script>
<br />
<?php
}
//////////////////////////////////////////////////////////////////////////////////////////////////
function start_page( $section = "home",
$subsection = null,
$headContents = null,
$bodyAttributes = null
)
//////////////////////////////////////////////////////////////////////////////////////////////////
{
if (isset($_GET['printer']))
{
start_page_printer_friendly();
return;
}
$section = strtolower($section);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php print $page_title; ?></title>
<?php if ( ! is_null($headContents)) { print $headContents; } ?>
</head>
<body class=" yui-skin-sam" <?php if ( ! is_null($bodyAttributes)) { print $bodyAttributes; } ?>>
<br />
<div id="header">
<ul>
<!--
<li><a class="<?php print tabSelector($section, 'executive'); ?>"
href="/trellis_portal/portal.php?section=executive&title=Executive">Executive</a></li>
<li><a
class="<?php print tabSelector($section, 'community'); ?>"
href="/trellis_portal/portal.php?section=community&title=Community">Community</a></li>
-->
<li><a class="<?php print tabSelector($section, 'trellis'); ?>"
href="/trellis_portal/portal.php?section=trellis&title=Trellis">Trellis</a></li>
<!--