gpt4 book ai didi

javascript - 使用 colorbox 加载外部 url 然后 chop

转载 作者:行者123 更新时间:2023-11-30 10:46:49 25 4
gpt4 key购买 nike

我已经为此苦苦挣扎了一段时间,所以我希望我能在这里找到解决方案。

我希望在 colorbox 弹出窗口中将外部 URL 打开到 iframe 中。这一切都很好。我只想运行一个后加载函数来删除我不需要的任何内容(例如标题和正文标签)。这是我目前所拥有的:

$('a[href*="/return-policy"]').colorbox({
href: "/return-policy?language=" + lang,
width: "800px",
height: "600px",
scrolling: false,
iframe: true
});

这将返回:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>title</title>
</head>

<body>
<div>load of crap I dont need</div>
<div class="content-content colorbox-content" id="content-content">
THE STUFF I NEED
</div>
<div>load of crap I dont need</div>
</body>
</html>

这就是我所需要的(在 colorbox-content 中,包括 div colorbox-content):

<div class="content-content colorbox-content" id="content-content">
THE STUFF I NEED
</div>

非常感谢对此的任何帮助。

谢谢C

最佳答案

试试这个:

$('a[href*="/return-policy"]').colorbox({
href: "/return-policy?language=" + lang + " #content-content",
width: "800px",
height: "600px",
scrolling: false
});

关于javascript - 使用 colorbox 加载外部 url 然后 chop ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7866865/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com