簡體   English   中英

使用colorbox加載外部URL然后截斷

[英]Load external url with colorbox then truncate

我已經有一段時間了,所以我希望我能在這里找到解決方案。

我希望打開外部URL到colorbox彈出框中的iframe。 這一切都很好。 我只想運行一個post post加載的函數來擺脫我不需要的任何內容(例如標題和正文標記)。 這是我到目前為止:

$('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
    });
var your_result=     $("div").append($("#content-content")).html()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM