我rewrited比如你發現改變錨點目標,現在鏈接在同一窗口中打開,但這種方法也有侷限性 - 只有靜態鏈接都是固定的,任何JS方法試圖鄰在新窗口中的筆連接將失敗。
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
initialize="init()">
<mx:Script>
<![CDATA[
private function init():void
{
html.htmlText =
"<html><body>" +
"<a href='http://adobe.com' target='_blank'>Adobe (blank)</a><br/>" +
"<a href='http://ixbt.com' target='_self'>iXBT (self)</a>" +
"</body></html>";
html.addEventListener(Event.COMPLETE, onHTMLComplete);
}
private function onHTMLComplete(event:Event):void
{
var document:Object = html.domWindow.document;
for each (var anchor:Object in document.getElementsByTagName("a"))
{
if (anchor.hasOwnProperty("target"))
{
if (anchor.target == "_blank")
{
anchor.target = "_self";
}
}
}
}
]]>
</mx:Script>
<mx:HTML id="html" width="100%" height="100%"/>
</mx:WindowedApplication>
想要對這樣的鏈接做什麼,在同一個窗口中打開它們? – alxx 2011-04-14 05:40:08
是的,如果它可能在同一窗口中。 – 2011-04-14 07:17:54
嗨alxx,運氣好的話? – 2011-04-14 15:25:28