window.frames[frameName].location.href

解决方案 »

  1.   

    我要取得某个frame里面的url的值,window.frames[frameName].location.href好像只能指定url的值,不能取出来啊
      

  2.   

    这个属性可读/可写 能够得到该框架里现在运行的文件 URL
      

  3.   

    <iframe id="test" src="01.htm" width="100%" scrolling="yes"><script language="javascript">
    var location=test.location.href;
    document.write(location);
    </script>
    href的属性有,href,host,port,protocol,pathname,hash,hostname
    可以到MSDN看!
    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties.asp
      

  4.   

    IFRAME--------------------------------------------------------------------------------DescriptionCreates inline floating frames. ResThis element is a block element. The IFrame functions as a document within a document. Consequently, access to the IFrame object is provided through the frames collection. Use the frames collection to read or write to elements contained in an IFrame.Propertiesalign, className, dataFld, dataSrc, document, frameBorder, frameSpacing, hspace, id, innerHTML, innerText, isTextEdit, lang, language, marginHeight, marginWidth, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, scrolling, sourceIndex, src, style, tagName, title, vspace Methodscontains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute Collectionsall, children ExampleThe following code returns a reference to the all collection within the IFrame. 
    document.all.frames["MyIFrame"].document.all
    HTML ElementIFRAME