Currently I am making an admin panel for my website and on the main page it contains a bunch of buttons on one said which come from a while loop which gets information from the database (like Value and URL). Right beside it is an iframe which shows the current admin tool and I use javascript so that when you click on a button it changes the page in the iframe. So the code looks like:
Javascript Function:
echo "
<script>
function goto(url) {
var browser = navigator.appName;
if(browser == 'Microsoft Internet Explorer') {
test.location.href = url
} else {
document.test.src = url
}
</script>
";
The Loop for the buttons:
while ($loop = mysql_fetch_object($loop2)) {
echo "<input type=\"button\" value=\"" . $loop->name . "\" onClick=\"goto('" . $loop->url . "')\">";
}
The iFrame:
echo "<iframe name=\"test\" src=\"/admin_index.php\" style=\"width: 500px; height: 500px\"></iframe>";
Now my problem is with the Javascript function, this works in IE but not in any other browser?? How can I get it to work? Thanks in advance.
Napster