如何從包含標題的iframe獲取內容content-type: text/plan
?如何獲取iframe內容?
是否可以在不重新加載內容的情況下使用$.ajax()
加載內容?
iframe中的內容:
{"result":{"posts":0,"posts_imported":0},"error":{"file":{"msg":"ERR_ERROR_FILE","trans":{"file":"csv"}}}}
如何從包含標題的iframe獲取內容content-type: text/plan
?如何獲取iframe內容?
是否可以在不重新加載內容的情況下使用$.ajax()
加載內容?
iframe中的內容:
{"result":{"posts":0,"posts_imported":0},"error":{"file":{"msg":"ERR_ERROR_FILE","trans":{"file":"csv"}}}}
如何:
你的iframe的html文件:
一個div
<div id='iframeContent'>
{"result":{"posts":0,"posts_imported":0},"error":{"file":{"msg":"ERR_ERROR_FILE","trans":{"file":"csv"}}}}
</div>
那麼你的代碼來取代它會是這樣,我相信,
$('your-iframeid').childen('<div>',0).text(your-new-text);
我是初學者;所以,我可能完全不在這一個(太)。
確保縮進任何代碼,如HTML,JavaScript等4個空格在 - 或使用代碼工具欄按鈕(看起來像「{}」)。 – GregL
jQuery中:
var content = $("iframe").contents();
是在同一個域中包含'iframe'頁面的'iframe'的內容? – icktoofay
你的意思是文本/平原的標題嗎? – halfer
[.contents](http://api.jquery.com/contents/)? –