For some reason in my global.html file jquery doesn't work for me.
here is the code that is in my global.html file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>
<title>Hello World</title>
<meta name="generator" content="myHTMLEdit | www.myownapp.com" />
<script type="text/javascript">
function performCommand(event)
{
if (event.command === "alert") {
alert("event fired...");
var $x = $("meta[property=og:image]").attr("content");
alert($x);
alert("completed.");
}
}
function validateCommand(event)
{
if (event.command === "alert") {
event.target.disabled = !event.target.browserWindow.activeTab.url;
}
}
safari.application.addEventListener("command", performCommand, true);
safari.application.addEventListener("validate", validateCommand, true);
</script>
</head>
<body>
</body>
</html>
I'm using alerts to see if my jquery is working. it will alert "event fired..." but stops there (no second alert). however, if I delete the two lines of jquery both alerts pop up. I'm creating a toolbar item that when I click it the event fires if that helps you solve this issue.
Only one error when I press inspect global page