I'm creating a web push notification setup on my website, and honestly I've never had this issue javascript before that I'm encountering. Essentially what is happening here is that when javascript should be invoking the called method, nothing is happening. Not even a try-catch is catching an error.
test.html
Here is where I'm attempting to call the method from. If you will notice, in the <head>
tag I referenced the js file that has the method.
<html>
<head>
<script src="notify.js"></script>
</head>
<body>
<script type="text/javscript">
document.write("Test #1");
try {
document.write(sendUnsent());
document.write("Test #2");
} catch (error) {
document.write(error);
}
</script>
</body>
</html>
notify.js
This is where I'm attempting to call said function called sendUnsent()
.
function sendUnsent()
{
return "Hello world!";
}
My question is why is this script not executing and what possible fixes are there?