Hallo,
habe folgendes Problem: Ich möchte gerne eine Navigationsleiste aus der Datenbank erstellen und dann gleichzeitig zwei Frames ändern. Leider funktioniert der JavaScript Teil im Code nicht. Vielleicht kann mir ja mal einer helfen...
Code:
<script language="JavaScript">
function MM_goToURL()
{
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
</script>
</head>
<body>
<table>
<?php
include (...);
sr_db_connect () or exit ();
$result = mysql_query('SELECT `id`, `name`, `url` FROM navigation
WHERE status = "1" AND ebene = "1"
ORDER BY `position` ASC');
while($row = mysql_fetch_array($result))
{
if ($row['id'] != $_GET['id'])
{
echo ('<tr><td>');
echo ('<form action="navigation.php" method="get">
<a href=navigation.php?id='.$row['id'].' target="leftFrame"
onMouseDown="MM_goToURL(\'parent.frames[\'mainFrame\']\',\''
.$row['url'].'\');return document.MM_returnValue">'
.$row['name'].
'</a></form>');
echo ('</td></tr>');
}
else
{
echo ('<tr><td>');
echo ('<form action="navigation.php" method="get">
<a href=navigation.php?id='.$row['id'].' target="leftFrame"
onMouseDown="MM_goToURL(\'parent.frames[\'mainFrame\']\',\''
.$row['url'].'\');return document.MM_returnValue">'
.$row['name'].
'</a></form>');
echo ('</td></tr>');
...
}
}
?>
</table>
</body>
</html>