I'm having problems calling a JavaScript from within a PHP app. I'm developing this small system that has a menu on the left and a box where PHP content is outputted according to the option selected. Here's the code for my main page (just in case you can't imagine it):
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"lang="es" xml:lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Adamantoise</title>
<?php
require_once "templates/addStyle.php"; //adds some stupid css style
?>
<script language="JavaScript" type="text/javascript" src="../js/ajax.js"></script>
</head>
<body>
<div id="menu"> <a href="javascript:fill('./login.php', 'contenidos', '', 'POST');">Login</a></div>
<div id="contenidos">
<h3>Welcome blah</h3>
</div>
</body>
</html>
Code: Select all
echo "<script type=text/javascript>redirect('./menu.php', 'contenido', '', 'POST');</script>";Please let me know if I haven't made myself clear, and sorry if I went crazy on the details.
Santiago