I have no idea why I am getting this error despite include a Jquery library. My code:
function create() {
var employeeForm = $("#createUser").serializeJSON();
var employee = JSON.stringify(employeeForm);
$.ajax({
url: uric,
type: 'POST',
data: employee,
success: function(results) {
}
});
The library:
<script type="text/javascript" src=".0.3.min.js"></script>
<script type="text/javascript" src=".11.3/jquery.min.js"></script>
What could I be missing???
I have no idea why I am getting this error despite include a Jquery library. My code:
function create() {
var employeeForm = $("#createUser").serializeJSON();
var employee = JSON.stringify(employeeForm);
$.ajax({
url: uric,
type: 'POST',
data: employee,
success: function(results) {
}
});
The library:
<script type="text/javascript" src="http://ajax.aspnetcdn./ajax/jQuery/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis./ajax/libs/jquery/1.11.3/jquery.min.js"></script>
What could I be missing???
Share Improve this question asked Oct 15, 2015 at 4:09 refreshrefresh 1,3292 gold badges26 silver badges74 bronze badges 3-
5
1. You've included jQuery twice. 2. Use serialize or serializeArray. 3. To use
serializeJSON
you need to include github./marioizquierdo/jquery.serializeJSON library after jQuery – Tushar Commented Oct 15, 2015 at 4:10 -
1
You're importing jQuery twice - why? And where did you get the idea that
.serializeJSON()
was part of jQuery? – Pointy Commented Oct 15, 2015 at 4:10 - 2 Ok. So I need to include github./marioizquierdo/jquery.serializeJSON, right? I am so confused. – refresh Commented Oct 15, 2015 at 4:21
1 Answer
Reset to default 2Create a new JS script in your project and paste the script from there : https://raw.githubusercontent./marioizquierdo/jquery.serializeJSON/master/jquery.serializejson.js. Then add then script src to your page.