Here is a html page:
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.0.min.js" type="text/javascript"></script>
</head>
<body>
<script src="background.js" type="text/javascript"></script>
</body>
</html>
Here is background.js:
alert("Alert1!");
var test = jQuery.trim(" Words and / { objects & things");
alert("Alert2!");
Alert1 works, but alert2 never plays. If i remove the jQuery then it works. I’ve tried the background.js file in both the header and body. What am I doing wrong?
Thanks.
Download
jquery.jsfrom http://code.jquery.com/jquery-1.9.0.min.js and put it inline to your extension directory and refer it inline as shown here.Root Cause
External reference to files is not supported in Chrome Extensions.
Working Version
Edit 1
Working Version
manifest.json
Registered both Jquery and Your code to
manifest file.background.js
Your code as before