I am trying to add javascript to a php file and everytime I add the javascript and save, it just displays the javascript and not the rest of the page content.
The code looks like this:
<section class="portlet grid_6 leading">
<header>
<h2>Time <script type="text/javascript">
<!--var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if (minutes < 10){
minutes = "0" + minutes
}
document.write(hours + ":" + minutes + " ")
if(hours > 11){
document.write("PM")
} else {
document.write("AM")
}
//-->
</script></h2>
Any suggestions?
//for single line comment and/* ... */for multi-line comment.