I am just starting to play on Mac for the first time, and I have created a very simple HTML page that uses jQuery to easily exchange text when the h1 tag is clicked.
When I do not view the page through the web server and simply open it directly in Safari (file: ///Applications/xampp/xamppfiles/htdocs/test/mypage.html), it works as expected. However, when I try to browse through Apache ( http: //localhost/test/mypage.html ), this will not work.
Here is the code :
<html>
<head>
<title>My Awesome Page</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" charset="utf-8">
function sayHello()
{ $('#foo').text('Hi there!');
}
</script>
</head>
<body>
<h1 id="foo" onclick="sayHello()">Click me!</h1>
</body>
</html>
Am I missing something on the Mac? Would not be setting up Apache from its client code. Correctly?
, , , XAMPP Apache MySQL. Apache PHP .