|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
co-admin
Join Date: Oct 2006
Location: Belgium
Posts: 666
|
Tutorial Name: Simple match calculator
Description: This script load an external html file into a css layer. It is NS6 compatible as well as supporting IE4+ and NS4. Author: !i! Army !i! Difficulty: Intermediate Details: <!-- THREE STEPS TO INSTALL LOAD HTML: 1. Copy the coding into the HEAD of your HTML document 2. Add the onLoad event handler into the BODY tag 3. Put the last coding into the BODY of your HTML document you will be loading --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> [HTML] <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var nn4 = (document.layers); var nn6 = (document.getElementById && !document.all); var ie4 = (document.all && !document.getElementById); var ie5 = (document.all && document.getElementById); function loadPage(id,nestref,url) { if (nn4) { var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id] lyr.load(url,lyr.clip.width) } else if(ie4) parent.contentFRM.location = url; else if(ie5 || nn6) document.getElementById('contentFRM').src = url; } function showPage(id) { if (ie4) { document.all[id].innerHTML = parent.contentFRM.document.body.innerHTML; } else if(nn6 || ie5) { document.getElementById(id).innerHTML = window.frames['contentFRM'].document.getElementById('theBody').innerHTML; } } // End --> </script> </HEAD> [/HTML] <!-- STEP TWO: Insert the onLoad event handler into your BODY tag --> [HTML] <BODY onload="parent.showPage('contentLayer')"> [/HTML] <!-- STEP THREE: Copy this code into the BODY of your HTML document you will be loading --> [HTML] <a href="javascript:loadPage('contentLayer',null,'loa d-html-demo.html')">Load Page</a> <iframe name="contentFRM" id="contentFRM" width="0" height="0" frameborder="0"> </iframe> <div id="contentLayer" style="position:absolute; width:345px; height:115px; z-index:1; left: 186px; top: 304px"></div> [/HTML] |
|
|
|