Javascript 当我执行;jQuery.prepend(HTML)“;,HTML仅在单击“刷新”按钮后才显示
向POST发送AJAX请求后,它将接收JSON数据 如果成功,我将调用Javascript 当我执行;jQuery.prepend(HTML)“;,HTML仅在单击“刷新”按钮后才显示,javascript,jquery,ajax,require,Javascript,Jquery,Ajax,Require,向POST发送AJAX请求后,它将接收JSON数据 如果成功,我将调用require.js中定义的函数 Function name: function (arg1, arg2, arg3, arg4) { require(['Common'], function (Common) { var template = <div Blabla> ~~~~~~; $('Class name').prepend($(template)); }); } 函数名
require.js
中定义的函数
Function name: function (arg1, arg2, arg3, arg4) {
require(['Common'], function (Common) {
var template = <div Blabla> ~~~~~~;
$('Class name').prepend($(template));
});
}
函数名称:函数(arg1、arg2、arg3、arg4){
require(['Common'],函数(Common){
变量模板=~~~~~~~;
$('classname')。前缀($(模板));
});
}
在上述函数声明中,“HTML”直接异步输出
如果我用“If”来包装它以指定一个特定的数字,我将无法正确地得到它
Function name: function (arg1, arg2, arg3, arg4) {
require(['Common'], function (Common) {
if ($('class name to prepend').length <5) {
var template = <div Blabla> ~~~~~~;
$('Class name').prepend($(template));
}
});
}
函数名称:函数(arg1、arg2、arg3、arg4){
require(['Common'],函数(Common){
if($('classname to prepend').length发布实际代码而不是一堆语法错误如何…只需使用$('#selector').val().lengthops,我无法识别重复的类名。谢谢您的帮助。