我在adv java中创建一个Web应用程序并使用许多外部库,如choosen.js summernote.js bootstrap bootstrapValidator等。现在我收到一些错误,我现在能够找到导致所有这些错误的内容。如果有人知道的话有关此事的任何事情请帮助我
请帮我找到解决方案。
夏天的代码$(document).ready(function(){
$('.summernote').summernote({
height:270,
minHeight: null, // set minimum height of editor
maxHeight: null, // set maximum height of editor
focus: true,
});
});
我正在使用的所有库
<link href='https://fonts.googleapis.com/css?family=Spinnaker' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="assets/css/adminstyles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="assets/js/bootstrapValidator.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.js"> </script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.0/summernote.js"></script>
<script type="text/javascript"
src="${pageContext.request.contextPath}/admin/assets/js/myscripts.js"></script>
我的ajax调用代码
$(document).ready(function () {
$("#side-menu li").click(function (event) {
var link = $(this).attr('id');
switch (link) {
case 'dash':
$.get("ajaxpages/dashboard.jsp", function (data) {
$("#contentLoader").html(data);
});
break;
case 'info':
$.get("ajaxpages/info.jsp", function (data) {
$("#contentLoader").html(data);
});
break;
case 'sms':
$.get("ajaxpages/sms.jsp", function (data) {
$("#contentLoader").html(data).fadeIn("slow");
});
break;
case 'email':
$.get("ajaxpages/email.jsp", function (data) {
$("#contentLoader").html(data).fadeIn("slow");
});
break;
case 'achievements':
$.get("ajaxpages/achievements.jsp", function (data) {
$("#contentLoader").html(data);
});
break;
case 'test':
$.get("ajaxpages/questions.jsp", function (data) {
$("#contentLoader").html(data);
});
break;
case 'profile':
$.get("ajaxpages/settings.jsp", function (data) {
$("#contentLoader").html(data);
});
break;
default:
$.get("ajaxpages/dashboard.jsp", function (data) {
$("#contentLoader").html(data);
});
}
});
});
**choosen library code**
$(document).ready(function () {
var config = {
'.chosen-select': {},
'.chosen-deselect': {allow_single_deselect: true},
'.chosen-select-no-single': {disable_search_threshold: 10},
'.chosen-select-no-result': {no_results_text:'Oops,nothing fund!'},
'.chosen-select-width':{width:'95%'}
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
});
bootstrapValidator
$(document).ready(function () {
console.log("email-form validation");
var validator = $("#email-form").bootstrapValidator({
live:'enabled',
message:'This value is not valid',
submitButton:'$email-form button[type="submit]',
submitHandler:function(validatior,form,submitButton){
$.ajax({
url: "../../MailDispatcherServlet",
method: "post",
data: $('#email-form').serialize(),
dataType: "String",
success: function (data) {
$('#message_show').text("success");
$("#email-form").data('bootstrapValidator').resetForm();
alert("hiiiiii");
console.log("hiiiii");
$("#email-form")[0].reset();
}
});
return false;
},
fields: {
email: {
message: "Email is required",
validators: {
notEmpty: {
message: "Please provide an email address"
},
stringLength: {
min: 6,
max: 35,
message: "Email must be between 6 and 35 characters long"
},
emailAddress: {
message: "Email address must be valid"
},
regexp: {
regexp: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
message: 'Not a valid email address'
}
}
}, //.email
subject: {
validators: {
notEmpty: {
message: 'Content is required'
},
stringLength: {
min: 6,
max: 30,
message: 'Must be more than 6 and less than 500 characters long'
},
regexp: {
regexp: /^[A-Za-z0-9 ]*[A-Za-z0-9][A-Za-z0-9 ]*$/,
message: 'The title can only consist of alphabetical number and spaces'
}
}
},
message: {
validators: {
notEmpty: {
message: 'Content is required'
},
stringLength: {
min: 0,
max: 3000,
message: 'Must be more than 0 and less than 5000 characters long'
},
regexp: {
regexp: /^[A-Za-z0-9 ]*[A-Za-z0-9][A-Za-z0-9 ]*$/,
message: 'The title can only consist of alphabetical number and spaces'
}
}
}
}
});
});
答案 0 :(得分:2)
没有任何代码,很难提供帮助,但从错误判断,当您调用此函数时,看起来您有一个拼写错误,或者它未包含在您正在使用的库中。