Migrating frames based code to non frame based code
I am migrating some old frames html code and its corresponding javascript to non-frame based code.
The old frames based html had something like:
<frameset rows="100%,0,0,0,0" border="0">
<frame src="roster.html" name="jwc_main" marginwidth="0" marginheight="0" scrolling="no">
</frameset&g开发者_StackOverflow中文版t;
Iframe code in html:
<iframe src="iRoster.html" name="iRoster" id="iRoster" scrolling="auto"
style="width:100%;height:100%;border:2px groove;" frameborder=0>
and there was a javascript method where iframe within the frame html was accessed like:
var fmd = frames["jwc_main"].iRoster.document;
and this fmd variable was then used like:
fmd.getElementById('display').innerHTML = '';
What should do i need to do in order to change this code?
I found the solution, used
var fmd = iRoster.document;
Thanks
精彩评论