获取框架内容

A A A
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<script language="javascript"  type="text/javascript">
(function(win,doc){
var s = doc.createElement("script"), h = doc.getElementsByTagName("head")[0];
if (!win.alimamatk_show) {
s.charset = "gbk";
s.async = true;
s.src = "http://a.alimama.cn/tkapi.js";
h.insertBefore(s, h.firstChild);
};
var o = {
pid: "0",/*推广单元ID,用于区分不同的推广渠道*/
appkey: "0",/*通过TOP平台申请的appkey,设置后引导成交会关联appkey*/
unid: "0"/*自定义统计字段*/
};
win.alimamatk_onload = win.alimamatk_onload || [];
win.alimamatk_onload.push(o);
})(window,document);
function show(){
   var iObj = document.getElementById('writeable_iframe_0').contentWindow;
	var a= iObj.document.documentElement.innerHTML;
    var regExp = /<a[^>]*href=['"]([^"]*)['"].*?[^>]*>(.*?)<\/a>/i;
    var arr = a.match(regExp);
   var str = RegExp.$1;
	str=str.replace(/&amp;/ig,"&");
	alert(str);
 }
</script>
<a data-type="0" biz-itemid="39356319126" data-tmpl="628x100" data-tmplid="7" data-rd="2" data-style="2" data-border="1" href="http://detail.tmall.com/item.htm?id=39356319126">淘点金商品</a>
<button onClick="show();">获取源码</button>
<button onClick="taodd();">隐藏</button>
</body>
</html>