如何在使用 django 的 html 页面中从一个选项卡移动到另一个选项卡时将请求发布到我的 url,该页面有多个选项

How can I post the request to my url on moving from one tab to another tab in a html page which has multiple tabs using django

本文关键字:选项 另一个 url 移动 请求 我的 一个 django html      更新时间:2023-09-26
I have four tabs in my html page(index.html).
1.Dashboard
2.Inventory
3.Log Analysis
4.Configuration Analysis
I have four html pages for each of four tabs
1.Index.html
2.Inventory.html
3.Log.html
4.Configuration.html

当我从"清单"选项卡移动到"日志分析"选项卡时,如何将数据发布到服务器。我正在使用一个名为 script.js 的 JavaScript 文件来处理我的"库存"选项卡 JS 代码。我想从服务器请求数据并将其显示在日志.html文件中。为此,当我单击它时,我应该能够从任何选项卡发布数据。我该怎么做。任何帮助将不胜感激。

这段代码将帮助您:

http://api.jqueryui.com/tabs/#event-activate

$( ".selector" ).tabs({
  activate: function( event, ui ) {
   // Your code will go here
  }
});
相关文章: