Subject: RE: Curious …
Mainly for flexibility but can be a bit of a pain to keep track of for javascript (i.e. if any links to a page are in an inline frame, unless you set the target to be the parent frame the document will appear in the frame itself which can be a bit of a pain if you are going to have multiple views some of which could be in frames and some of which might not be.
inline frames are not resizable and won’t span to fit the view you put in them. If you want iframe-type behavoiur then use
with the width and height (and max-height if you want size to fit) properties and the overflow property for scrolling if needs be.
I will have a look at putting them in the sandbox if I can figure it out but basically it goes somehting like this:
function getXMLDoc(sUrl)
{
var xDoc=null;
var d=new Date();
sUrl+=“&NoCache=”+d.getTime(); //note add dummy item to query string to ensure browser doesnt’ cache it…
if (window.XMLHttpRequest) { xDoc=new XMLHttpRequest(); }
else if (window.ActiveXObject) xDoc=new ActiveXObject(“Microsoft.XMLHTTP”);
if (xDoc==null) return(null);
if(xDoc.overrideMimeType) { xDoc.overrideMimeType(‘text/xml’);}
xDoc.open(“GET”,sUrl,false);
xDoc.send(null);
return(xDoc.responseXML);
}
function embedHTMLView(view, id, category,hdr,ftr,defaultcmt)
{
defaultcmt=defaultcmt || ‘No documents found’;
var sUrl=“”+view+“?ReadViewEntries&ExpandView&Count=200&RestrictToCategory=”+encodeURI(category);
var sTxt=“”;
var sT=“”;
sDoc=getXMLDoc(sUrl);
if(sDoc==null) return;
var dt=sDoc.getElementsByTagName(“viewentry”);
var n=dt.length;
for(i=0;i<n;i++)
{
//get each view entry....
var y=dt[i].getElementsByTagName("entrydata");
n2=y.length;
for(j=0;j<n2;j++)
{
//extract your data and format into sTxt
}
}
var x=document.getElementById(id);
if(sTxt.length!=0) x.innerHTML=hdr+sTxt+ftr; else x.innerHTML=defaultcmt;
}