Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/452.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 新值未显示在div(ASP.NET)上_Javascript_Jquery_Html_Css_Asp.net - Fatal编程技术网

Javascript 新值未显示在div(ASP.NET)上

Javascript 新值未显示在div(ASP.NET)上,javascript,jquery,html,css,asp.net,Javascript,Jquery,Html,Css,Asp.net,我在主视图中有div,在那里我在AJAX请求后显示数据 这是代码 <div class="count" style="height: 80%; width: 100%; overflow-y: auto;" id="style-1"> </div> All正在成功添加,但新值未显示在div中 我的问题在哪里?questionHtml是字符串,它无法与您使用它的方式一起使用 请尝试以下方法: $(questionHtml).appendTo(

我在主视图中有div,在那里我在AJAX请求后显示数据

这是代码

<div class="count" style="height: 80%; width: 100%; overflow-y: auto;" id="style-1">


            </div>

All正在成功添加,但新值未显示在div中


我的问题在哪里?

questionHtml
字符串
,它无法与您使用它的方式一起使用

请尝试以下方法:

$(questionHtml).appendTo(".count");
在这种情况下,你甚至不需要var

$('<div class = "title" style="margin-top:15px;margin-left:15px;margin-bottom:10px;">'  +
  '<img class="click" src="' + arrow + '">' +
  '<span class="test">' +
  '<input type="text" class="testclass" readonly value="' +
  result[i].Quest + '">' +'<a style="margin-left:25px;">'+'<img src=">'+ edit+'">' +
  '</div>').appendTo('.count');
$(“”+
'' +
'' +
''+''+''+编辑+'>'+
'').appendTo('.count');

我已经解决了问题,如果成功返回,我需要进行更新

像这样

 if (da.Result === "Success") {
                $('#myModal').hide();
                emails_update();

您调试了吗?成功回调中questionHtml的值是多少?是的。我看到了olón值,新值在表中。如果我再添加一个,我将看到旧值+上一个值,但不是new@mariocatchIt似乎有效。我还有一个问题。当我添加新值并单击“保存”按钮时,我看不到它。如果添加第二个值,我将看到它。
$('<div class = "title" style="margin-top:15px;margin-left:15px;margin-bottom:10px;">'  +
  '<img class="click" src="' + arrow + '">' +
  '<span class="test">' +
  '<input type="text" class="testclass" readonly value="' +
  result[i].Quest + '">' +'<a style="margin-left:25px;">'+'<img src=">'+ edit+'">' +
  '</div>').appendTo('.count');
 if (da.Result === "Success") {
                $('#myModal').hide();
                emails_update();