更改innerhtml但页面不显示新的innerhtml

发布于 2024-12-21 17:17:25 字数 946 浏览 1 评论 0原文

在我正在开发的应用程序中,在页面加载时,我设置了innerhtml并且页面显示正确。我的页面上有一个单选按钮,点击该按钮后,innerhtml 就会发生变化。对innerhtml 的新更改不会显示在页面上。我知道由于设置跟踪点和调试,我的新innerhtml 正在被更改,但旧值仍然保留在我的表中。我是否需要调用某些内容来刷新新的 html(我不希望刷新页面,而是刷新表中的数据)?页面加载调用 LoadDashboardTree - 并且表格显示正确。我的单选按钮的 javascript 操作根据所选单选按钮的值调用正确的子项,我可以知道,当我点击单选按钮来调用 loadDashboardTreeDays 时,它正在调用它,因为我已经在其中设置了跟踪点,并且它确实走了通过,只是表永远不会刷新。 divsummary 内部 html 也不会刷新,但不需要它,因为天和非天都做同样的事情,所以它仍然正确显示并选择 onclick

    Public Sub LoadDashboardTree(ByVal Id, ByVal Cat, ByVal Type, ByVal ExplodeTo)
    div027.InnerHtml = LoadChild(Id, Cat, Type, ExplodeTo)
    divSummary.InnerHtml = LoadSummary(Id, Cat, Type)
End Sub

Public Sub LoadDashboardTreeDays(ByVal Id, ByVal Cat, ByVal Type, ByVal ExplodeTo)
    div027.InnerHtml = LoadChildDays(Id, Cat, Type, ExplodeTo)
    divSummary.InnerHtml = LoadSummaryDays(Id, Cat, Type)
End Sub

编辑 - 这是从我的 aspx.vb 页面更改innerHTML的调用- 对于那些无法分辨的人来说,不是页面的实际 javascript 部分

In an application that I am working on, on page load, I set innerhtml and the page displays correctly. I have a radio button on my page that when hit, the innerhtml is changed. The new change to the innerhtml does not display on the page.I know that my new innerhtml is being changed due to setting tracepoints and debugging but the old values still stay in my table. is there something i need to call to refresh with the new html (i do not want the page to refresh, but the data in my table)? Page load calls LoadDashboardTree - and the table displays correctly. The javascript action of my radio buttons call the correct sub depending on the value of the radio button selected, I can tell that when I hit the radio button to call loadDashboardTreeDays that it is calling this because I have set tracepoints in this and it does go through, just the table never refreshes. divsummary inner html does not refresh either but it is not needed as both days and non days do the same thing, so it still is displaying correctly and picking up the onclick

    Public Sub LoadDashboardTree(ByVal Id, ByVal Cat, ByVal Type, ByVal ExplodeTo)
    div027.InnerHtml = LoadChild(Id, Cat, Type, ExplodeTo)
    divSummary.InnerHtml = LoadSummary(Id, Cat, Type)
End Sub

Public Sub LoadDashboardTreeDays(ByVal Id, ByVal Cat, ByVal Type, ByVal ExplodeTo)
    div027.InnerHtml = LoadChildDays(Id, Cat, Type, ExplodeTo)
    divSummary.InnerHtml = LoadSummaryDays(Id, Cat, Type)
End Sub

edit- this is the call to change the innerHTML from my aspx.vb page - not the actual javascript portion of the page, for those who could not tell

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泛滥成性 2024-12-28 17:17:25

不需要,您无需执行任何操作即可刷新显示。如果您设置 innerHTML 属性,它将更新该元素。

No, there is nothing that you need to do to refresh the display. If you set the innerHTML property, it will update the element.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文