<!DOCTYPE html>
<html>
<head>
<script src="test.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<form>
<input type="text" class="form-control" id="consult" placeholder="consult">
<input type="text" class="form-control" id="url" placeholder="url">
<button type="submit" >Send Data </button>
</form>
</body>
</html>
here is my code html updated
$(document).ready(function(){
console.log("ext loaded")
$("button").click(function(e){
e.preventDefault()
var consult = $("input#consult").val()
var url = $("input#url").val()
console.log(consult, url)
// alert(consult+ url)
$.ajax({
type: "POST",
url:"https://www.jbhired.com/admin/server/submitSearch.php",
dataType: "jsonp",
crossDomain: true,
data : {
consult: consult,
url: url
},
})
});
});
this is js file updated
{
"manifest_version": 2,
"name": "One test",
"description": "test.",
"version": "1.0",
"browser_action": {
"default_icon": "pic1.png",
"default_popup": "popup.html",
"script" : "test.js"
},
"content_security_policy": "script-src 'self' 'http://ajax.googleapis.com; object-src 'self'"
}
and this is menifest file
error is
Uncaught ReferenceError: $ is not defined at test.js:4
popup.html:1 Refused to load the script 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquer%E0%B9%82%E2%82%AC%C2%8C%E0%B9%82%E2%82%AC%C2%8By.min.js' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".