Forum Moderators: coopster
Layout is:
1 page with the header code of Java.
1 page with the table code of Java
the Actual page which has a php code to include the above
and the actual javascript
Any thoughts? I would post the code but its long. The menu is created from Fireworks, nothing added, nothing taken away.
Arthur
having a problem displaying the drop down menu in the display portion of the browser. However, it displays in the code just fine.
In other words, when browsing it doesn't work, but in view source it looks fine?
If so, it's not a PHP problem. What you need to do is save the source that you are seeing in view source, edit that until it works, and then try to figure out how to make PHP output the working code.
As it stand the Java code is in a file called menucode.php and is inserted into the header. All the lines are marked with print "--code--\n"; and all the " in the code have a \ to escape the ". Should it all be one long line of code, and each line just have a \n?
Thoughts?
Arthur
Firstly, write the javascript as you would for any webpage. Meaning: no "print" or "\n" in the code. Also, leave off the "<script>" and "</script>" tags. Save that file as "script_name.js".
In your PHP script file add
?>Or if using a header include file, insert
<html>
<head>
<script language="javascript" src="script_name.js"></script>
</head>
<?
<script language="javascript" src="script_name.js"></script>between your <head> calls.
Both of the above are assuming that you need to insert your script into the head portion of your page of course.
Hope it helps in some way, however small.
IamStang
<?php
//bla bla some code you have
$a = 10;
?>
<script type="text/javascript" language="JavaScript">
<!--
var a = <?php echo $a;?>;
//-->
</script>
You can print the html outside the php, but still processed.
Hope this helps
Michal Cibor
Horizontal Menus using CSS and Lists [webmasterworld.com]