From fd6b8644e46b6ecc0658ac722fb7df92c5432f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=BD=E8=8A=B1=E4=BA=BA=E7=8B=AC=E7=AB=8B?= <2270969436@qq.com> Date: Thu, 10 Jul 2025 13:55:27 +0000 Subject: [PATCH] =?UTF-8?q?page.js=E6=96=B0=E5=A2=9E"=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=93=BE=E6=8E=A5=E5=86=85=E5=AE=B9"?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=85=B1=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 落花人独立 <2270969436@qq.com> --- component/pear/module/page.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/component/pear/module/page.js b/component/pear/module/page.js index 52ff2ef..a8d1ff3 100644 --- a/component/pear/module/page.js +++ b/component/pear/module/page.js @@ -82,6 +82,28 @@ layui.define(['jquery', 'element'], function (exports) { } } + /** + * 获取指定链接内容 + * @param href + * @returns {string} + */ + page.prototype.getHrefContent = function (href) { + let content = ''; + $.ajax({ + url: href, + type: 'get', + dataType: 'html', + async: false, + success: function (data) { + content = data; + }, + error: function (xhr) { + return layer.msg('Status:' + xhr.status + ',' + xhr.statusText + ',请稍后再试!'); + } + }); + return content; + } + function renderContent(option) { $("#" + option.elem).html(`
-- Gitee