隐藏的领域占据空间

时间:2015-08-21 11:53:01

标签: javascript html

我正在使用隐藏字段,它存储了在页面中生成的大量html。

在隐藏字段下方有一个名为AddHtml的按钮,当点击该按钮时,会执行一些操作并将html存储在隐藏字段中。

页面中还有另一个按钮,用于在点击时加载名为loadData的数据。因此,当我点击AddHtml按钮时,它会向某处移动loadData按钮。

这是我的HTML:

 <div>

     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
         <ContentTemplate>
            <script type="text/javascript">

                function doOperation(id, name) {
                    document.getElementById("<%= hdnFldSavedHTML.ClientID %>").value = document.getElementById("<%= divShowImages.ClientID %>").innerHTML;
            </script>


            <section id="ideas" class="container">

                <div id="divShowImages" class="row" style="" runat="server" >

                </div>

                 <div class="row" >
                    <div class="col-xs-12 col-sm-6 col-sm-offset-3 col-lg-4 col-lg-offset-4">
                        <a class="btn btn-default btn-block btn-lg load-more-ideas" href="#" role="button" id="loadData"  runat="server" OnServerClick="btnNextRec_Click">More data please</a>

                    </div>
                </div>
                <div>

                </div>
            </section>
             <asp:Button runat="server" ID="AddHtml" OnClick="btnSubmit_OnClick" style="display:none"/>

             <asp:HiddenField runat="server" ID="hdnFldSavedHTML" Value=""  />
        </ContentTemplate>

    </asp:UpdatePanel>

UPDATE1

这是我在渲染时看到隐藏字段的方式:

<input type="hidden" name="ctl00$ctl40$g_a71dea1c_8102_4358_8ef1_41e74c01a6cc$hdnFldSavedHTML" id="ctl00_ctl40_g_a71dea1c_8102_4358_8ef1_41e74c01a6cc_hdnFldSavedHTML" value="

        <article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 0px; top: 0px;&quot;><div class=&quot;image&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=1&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/1/256_ICMPP.PNG&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>f</strong><span class=&quot;name&quot;> ./kiran1</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(1,&amp;quot;spnLikeStartPage1&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage1&quot;>44</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=1&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=1&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-md-3 col-lg-2&quot; style=&quot;position: absolute; left: 510px; top: 0px;&quot;><div class=&quot;image-small&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=2&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/2/256_ICPPTX.PNG&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>fgfgfgfgfgfgfgf</strong><span class=&quot;name&quot;> ./Kiran2</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(2,&amp;quot;spnLikeStartPage2&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage2&quot;>62</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=2&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=2&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 765px; top: 0px;&quot;><div class=&quot;image&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=3&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/3/256_ICODS.PNG&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>s</strong><span class=&quot;name&quot;> ./dd</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(3,&amp;quot;spnLikeStartPage3&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage3&quot;>13</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=3&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=3&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-md-3 col-lg-2&quot; style=&quot;position: absolute; left: 1275px; top: 0px;&quot;><div class=&quot;image-small&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=4&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/4/256_ICONE.PNG&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>d</strong><span class=&quot;name&quot;> ./d</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(4,&amp;quot;spnLikeStartPage4&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage4&quot;>7</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=4&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=4&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 0px; top: 765px;&quot;><div class=&quot;quote quote-@@class&quot;><div class=&quot;inner&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=5&quot;><p><strong>dfdf</strong><span class=&quot;name&quot;> ./d</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(5,&amp;quot;spnLikeStartPage5&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage5&quot;>27</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=5&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=5&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 510px; top: 765px;&quot;><div class=&quot;quote quote-@@class&quot;><div class=&quot;inner&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=6&quot;><p><strong>dfdf</strong><span class=&quot;name&quot;> ./ffg</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(6,&amp;quot;spnLikeStartPage6&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage6&quot;>20</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=6&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=6&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 1020px; top: 765px;&quot;><div class=&quot;quote quote-@@class&quot;><div class=&quot;inner&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=7&quot;><p><strong>dfdf</strong><span class=&quot;name&quot;> ./dfd</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(7,&amp;quot;spnLikeStartPage7&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage7&quot;>16</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=7&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=7&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 0px; top: 1275px;&quot;><div class=&quot;image&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=8&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/8/ShadesOfBlue.jpg&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>dfdf</strong><span class=&quot;name&quot;> ./sssd</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(8,&amp;quot;spnLikeStartPage8&amp;quot;)&quot;><div class=&quot;like-idea  likedDivShowIdeaPage&quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage8&quot;>8</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=8&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=8&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 510px; top: 1275px;&quot;><div class=&quot;image&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=9&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/9/Peacock.jpg&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>sdsdsd</strong><span class=&quot;name&quot;> ./dfdffdf</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(9,&amp;quot;spnLikeStartPage9&amp;quot;)&quot;><div class=&quot;like-idea likedDivShowIdeaPage&quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage9&quot;>12</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=9&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=9&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-md-3 col-lg-2&quot; style=&quot;position: absolute; left: 1020px; top: 1275px;&quot;><div class=&quot;image-small&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=10&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/10/Roses.jpg&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>sdsd</strong><span class=&quot;name&quot;> ./sdsd</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(10,&amp;quot;spnLikeStartPage10&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage10&quot;>6</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=10&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=10&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-md-3 col-lg-2&quot; style=&quot;position: absolute; left: 1275px; top: 1275px;&quot;><div class=&quot;image-small&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=11&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/11/Peacock.jpg&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>sdsd</strong><span class=&quot;name&quot;> ./sds</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(11,&amp;quot;spnLikeStartPage11&amp;quot;)&quot;><div class=&quot;like-idea &quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage11&quot;>3</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=11&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=11&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article><article class=&quot;idea col-xs-12 col-sm-6 col-lg-4&quot; style=&quot;position: absolute; left: 1020px; top: 1785px;&quot;><div class=&quot;image&quot;> <a href=&quot;http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=12&quot;><img src=&quot;http://zle01066-dev002/sites/idebank/Lists/IdeBank/Attachments/12/SoftBlue.jpg&quot; alt=&quot;&quot;></a><div class=&quot;ide&quot;><a href=&quot;#&quot;><p><strong>sdsd</strong><span class=&quot;name&quot;> ./sds</span></p> </a><a href=&quot;#&quot; class=&quot;like-post&quot; onclick=&quot;increaseLikes(12,&amp;quot;spnLikeStartPage12&amp;quot;)&quot;><div class=&quot;like-idea likedDivShowIdeaPage&quot;><span runat=&quot;server&quot; class=&quot;count&quot; id=&quot;spnLikeStartPage12&quot;>13</span><span class=&quot;heart&quot;></span></div></a><a href=&quot;#&quot; onclick=&quot;return twet_click(400, 350, &amp;quot;https://twitter.com/intent/tweet?text=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=12&amp;quot;)&quot; target=&quot;_blank&quot; class=&quot;some-share share-twitter&quot;><span class=&quot;icon-twitter&quot;></span></a><a href=&quot;#&quot; onclick=&quot;return fbs_click(400, 350, &amp;quot;http://www.facebook.com/share.php?u=http://zle01066-dev002/sites/idebank/Pages/Single.aspx?ItemId=12&amp;quot;)&quot; target=&quot;_blank&quot; title=&quot;Share This on Facebook&quot; class=&quot;some-share share-facebook&quot;><span class=&quot;icon-facebook&quot;></span></a></div></div></article>">

4 个答案:

答案 0 :(得分:1)

display:none

这就是你想要的。只要对象设置为display: none

,占用的空间就无关紧要了

可见性:隐藏

这很可能是你现在所拥有的,物体不可见,但它们的标签,大小等完全是“现在”。在当前页面。

关于这个问题与这个常见的CSS问题无关的可能性很小,那么我将编辑/删除我的答案。尽管如此,你还没有多大的帮助。

答案 1 :(得分:1)

问题与displayvisible等无关......但由于缺少<字符的编码。

基于OP的评论...

  

如何编码和在哪里?在我的代码后面我分配动态html我生成隐藏字段。然后,当我单击AddHtml按钮时,我使用document.getElementById(&#34;&lt;%= hdnFldSavedHTML.ClientID%&gt;&#34;)将该html存储在javascript中.value = document.getElementById(&#34;&lt;% = divShowImages.ClientID%&gt;&#34;)。innerHTML

我建议在将文本保存到隐藏字段之前专门编码<字符,并在加载&#34;从它。

例如,当您将HTML保存到隐藏字段中时,而不是......

document.getElementById("<%=hdnFldSavedHTML.ClientID%>").value =
  document.getElementById("<%=divShowImages.ClientID%>").innerHTML

...有

var html = document.getElementById("<%=divShowImages.ClientID%>").innerHTML;
html = html.replace("<","&lt;");
document.getElementById("<%=hdnFldSavedHTML.ClientID%>").value = html;

当你需要&#34;加载&#34;而不是......

document.getElementById("<%=divShowImages.ClientID%>").innerHTML = 
  document.getElementById("<%=hdnFldSavedHTML.ClientID%>").value;

...有

var html = document.getElementById("<%=hdnFldSavedHTML.ClientID%>").value;
html = html.replace("&lt;","<");
document.getElementById("<%=divShowImages.ClientID%>").innerHTML = html;

答案 2 :(得分:-2)

只需添加到内部答案,如果要再次显示,请使用

display : block

另外,制作  position : absolute;

编辑:我认为问题不在于position : absolute:)

了解显示/可见度herehere

答案 3 :(得分:-2)

尝试添加此css -

#hdnFldSavedHTML { position: absolute; top: 0; left: 0; }