Castro Roy
Castro Roy

Reputation: 7803

JavaScript doesn't work in my PHP code

i have this in my index.php

include 'app/Core.php';     
echo Core::getPageHtml();  

in Core.php

final class Core
{
    public static function getPageHtml()
{
    ob_start();
    include 'layout.php';
    $html = ob_get_clean();
    return $html;
}
}  

layout.php is normal html code, i can see de page, just perfect, but the javascript code doesn't work, i even write an alert('hello world'), like this

   <script type="text/javscript">
     alert('hello world');
   </script>  

so, it should be simple, but i can make it work, what am i missing here? need some help with this code

Upvotes: 1

Views: 2646

Answers (2)

John Giotta
John Giotta

Reputation: 16934

Works for me, you had text/javascript spelled wrong though.

Upvotes: 2

Eric Mickelsen
Eric Mickelsen

Reputation: 10377

"text/javscript" -> "text/javascript"

Upvotes: 7

Related Questions