AppendChild problem
Hello,
my problem is the following :
I want to update XML nodes and if I don't want to loos its children, I have to create un new node, apped the children of the old node into the new node and update the document.
But I got a problem with the appendChild method:
only one node out of two is added in the new node !
Here is my code :
NodeList nl = oldElt.getChildNodes();
System.out.println(nl.getLength());
for(int i = 0; i < nl.getLength(); i++) {
System.out.println(i + ":" + nl.item(i));
//newElt.appendChild(nl.item(i));
System.out.println(i + ":" + nl.item(i));
}This gives me :
3
0:[Champ: null]
0:[Champ: null]
1:[Champ_0: null]
1:[Champ_0: null]
2:[Champ_1: null]
2:[Champ_1: null]
If I decomment the appendChil line, I have :
3
0:[Champ: null]
0:[Champ: null]
1:[Champ_1: null]
1:[Champ_1: null]
If I put only the System.out line, evrything goed well but if I add the appendChild line, event the System.out line displays one node out of two.
Does anyone have a solution.....?
Thanks.
To quote the JavaDoc for the appendChild method of Node:
Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.
So, putting the childNode somewhere else removes it from its current location, which changes the NodeList object's length and the loop ends early.
One solution is to use the cloneNode method to make a new copy of the current node, use that copy in the appendChild method. Then decide how and when to delete the node from its current location. There is a removeChild method for Node that could be used to remove the old node at the end of the loop.
Dave Patterson
Similar Messages
-
Problems with DBMS_XMLDOM.appendChild
Hi, I have the following function that appends a child node to a parent node and returns an XMLTYPE.
FUNCTION append_element(parent XMLType, child XMLType)
RETURN XMLTYPE DETERMINISTIC IS
parent_document DBMS_XMLDOM.DOMDOCUMENT;
parent_rootnode DBMS_XMLDOM.DOMNODE;
child_document DBMS_XMLDOM.DOMDOCUMENT;
child_rootnode DBMS_XMLDOM.DOMNODE;
BEGIN
parent_document := DBMS_XMLDOM.newDOMDocument(parent);
parent_rootnode := DBMS_XMLDOM.makeNode(DBMS_XMLDOM.getDocumentElement(parent_document));
child_document := DBMS_XMLDOM.newDOMDocument(child);
child_rootnode := DBMS_XMLDOM.makeNode(DBMS_XMLDOM.getDocumentElement(child_document));
parent_rootnode := DBMS_XMLDOM.appendChild(parent_rootnode, child_rootnode);
RETURN parent;
END append_element;The description of the DBMS_XMLDOM.appendChild method from Oracle is "Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.", but in this case it's just adding another child. Here's how I'm using it:
PROCEDURE main IS
v_xml XMLTYPE := XMLTYPE('<parent></parent>');
BEGIN
v_xml := append_element(v_xml, XMLType('<child>one</child>'));
v_xml := append_element(v_xml, XMLType('<child>two</child>'));
htp.p('<textarea cols=50 rows=5>' || htf.escape_sc(v_xml.getClobVal()) || '</textarea>');
htp.br;
END main;Produces:
<parent>
<child>one</child>
<child>two</child>
</parent>Why is this adding a second child and not deleting the first one?
Thanks,
Mike9.2.0.1.0 is not supported for any XML DB functionality. Please upgrade to at least 9.2.0.3.0, or ideally 9.2.0.5.0 or 10.1.0.2.0 and try again
-
Unknown problem with JSP, JavaScript - Pls help
Hi Friends,
I am facing a strange problem. Explained it below. Kindly help me as it is really affecting my work. Thanks in advance.
I am working on building a web application using jsp, servlet, ejb. the IDE used is WSAD 5.1.2.
I have the below :
1 JSP - Input page - for user input entry
2. Java script1 - For all client side validations
Java script2 - For handling the data submission to servlet (as selected by user)
Javascript3 - Header & Menu Bar
3 Servlet - This actually retrieves the values from the hidden parameters, sets them in session and redirects the control back to the jsp.
Logic for one small iteration : Two drop downs are there. On selecting the first drop down the second drop down should be populated and the first drop down should display the user selected value.
1. When the user selects the first drop down onchange() event gets fired which calls a method in the javascript.
2. In the javascript I set the value of a hidden form field to the selected combo index and submit the form to the servlet
3. In the servlet, I retrieve the hidden request parameter (Index),
set the index in session. Do my business logic based on the value of the index. Set the collection (to be displayed) in second drop down in session.
4. Send the response back to the JSP.
5. In the JSP, we have a method which is called during the onload() event of the body
6. This method sets the user selected values in appropriate controls(by taking from session)
Problem faced: I have a javascript which creates the menu bar for my application and this i've included it in my jsp. I dont know whats wrong with this javascript, when it is commented out the page works perfectly fine. Both the user selected value and the collection are loaded exactly as expected. But when it is included the collection is loaded in the second drop down but the selected index of the first drop down is not set - the drop down gets reset to the default value.
Also on body load of my jsp, I call a javascript method which sets the current date in one text field of my form. Even this is not working fine when I include this javascript. I don't see any script error in this javascript in my browser though. Strange but guess something basic :(
I'm sure there is nothing to do with session. I've tried printing the entire flow. The Servlet sets the values correctly in session and they are also correctly available in the JSP page. The JSP also gets loaded with the user selected values but something happens on page load which clears the values to default.
Am also confused in what way javascript is related to this, coz when I remove it things are working fine.
Am really helpless here pls do the needful. any help is appreciated.
Header.js [which includes the menu bar code]
document.write("<!-- COMMON HEADER CODE -->")
document.write(" <table id='mplPageHeader' cellspacing='0' cellpadding='2' border='0'>")
document.write(" <tr> ")
document.write(" <td rowspan='2' bgcolor='#FFFFFF' width='1%'>")
document.write(" <a href='http://www.web.com' target='_top'>")
document.write(" <img src='./images/ford.gif' alt='BLogistics' border='0'>")
document.write(" </a> ")
document.write(" </td>")
document.write(" <td rowspan='2' class='appTitle' title='Mp' width='1%'>MP&L</td>")
document.write(" <td class='appTitle' title='M R'>M R</td>")
document.write(" <td class='pageIdentifier'>"+' '+"</td>");
document.write(" </tr>")
document.write(" <tr>")
document.write(" <td class='pageTitle' nowrap></td>");
document.write(" <td class='dateInfo' nowrap>Thu Jan 22 2004 12:24 PM</td>")
document.write(" </tr>")
document.write(" </table>")
document.write("<!-- Display Menu Items -->")
document.write("<div id='navigationMenu'>")
document.write(" <script type='text/javascript' src='./javascript/MRmenuItem.js'></script>")
document.write(" <script type='text/javascript' src='./javascript/menuScript.js'></script>")
document.write("</div>")-------------------------------------------------------
Menu Bar Code
var AgntUsr=navigator.userAgent.toLowerCase();
var AppVer=navigator.appVersion.toLowerCase();
var DomYes=document.getElementById?1:0,NavYes=AgntUsr.indexOf("mozilla")!=-1&&AgntUsr.indexOf("compatible")==-1?1:0,ExpYes=AgntUsr.indexOf("msie")!=-1?1:0,Opr=AgntUsr.indexOf("opera")!=-1?1:0;
var DomNav=DomYes&&NavYes?1:0,DomExp=DomYes&&ExpYes?1:0;
var Nav4=NavYes&&!DomYes&&document.layers?1:0,Exp4=ExpYes&&!DomYes&&document.all?1:0;
var MacCom=(AppVer.indexOf("mac")!= -1)?1:0,MacExp4=(MacCom&&AppVer.indexOf("msie 4")!= -1)?1:0,Mac4=(MacCom&&(Nav4||Exp4))?1:0;
var Exp5=AppVer.indexOf("msie 5")!= -1?1:0,Fltr=(AppVer.indexOf("msie 6")!= -1||AppVer.indexOf("msie 7")!= -1)?1:0,MacExp5=(MacCom&&Exp5)?1:0,PosStrt=(NavYes||ExpYes)&&!Opr?1:0;
var RmbrNow=null,FLoc,ScLoc,DcLoc,SWinW,SWinH,FWinW,FWinH,SLdAgnWin,FColW,SColW,DColW,RLvl=0,FrstCreat=1,Ldd=0,Crtd=0,IniFlg,AcrssFrms=1,FrstCntnr=null,CurOvr=null,CloseTmr=null,CntrTxt,TxtClose,ImgStr,ShwFlg=0,M_StrtTp=StartTop,M_StrtLft=StartLeft,StaticPos=0,LftXtra=DomNav?LeftPaddng:0,TpXtra=DomNav?TopPaddng:0,FStr="",M_Hide=Nav4?"hide":"hidden",M_Show=Nav4?"show":"visible",Par=MenuUsesFrames?parent:window,Doc=Par.document,Bod=Doc.body,Trigger=NavYes?Par:Bod;
var Ztop=100,InitLdd=0,P_X=DomYes?"px":"";
var OpnTmr=null;
if(PosStrt){if(MacExp4||MacExp5)LdTmr=setInterval("ChckInitLd()",100);
else{if(Trigger.onload)Dummy=Trigger.onload;
if(DomNav)Trigger.addEventListener("load",Go,false);
else Trigger.onload=Go}}
function ChckInitLd(){
InitLdd=(MenuUsesFrames)?(Par.document.readyState=="complete"&&Par.frames[FirstLineFrame].document.readyState=="complete"&&Par.frames[SecLineFrame].document.readyState=="complete")?1:0:(Par.document.readyState=="complete")?1:0;
if(InitLdd){clearInterval(LdTmr);Go()}}
function Dummy(){return}
function CnclSlct(){return false}
function RePos(){
FWinW=ExpYes?FLoc.document.body.clientWidth:FLoc.innerWidth;
FWinH=ExpYes?FLoc.document.body.clientHeight:FLoc.innerHeight;
SWinW=ExpYes?ScLoc.document.body.clientWidth:ScLoc.innerWidth;
SWinH=ExpYes?ScLoc.document.body.clientHeight:ScLoc.innerHeight;
if(MenuCentered.indexOf("justify")!=-1&&FirstLineHorizontal){
ClcJus();
var P=FrstCntnr.FrstMbr,W=Menu1[5],a=BorderBtwnMain?NoOffFirstLineMenus+1:2,i;
FrstCntnr.style.width=NoOffFirstLineMenus*W+a*BorderWidthMain+P_X;
for(i=0;i<NoOffFirstLineMenus;i++){
P.style.width=W-(P.value.indexOf("<")==-1?LftXtra:0)+P_X;
if(P.ai&&!RightToLeft)
P.ai.style.left=BottomUp?W-BorderColor-2+P_X:W-Arrws[4]-2+P_X;
P=P.PrvMbr
StaticPos=-1;
ClcRl();
if(TargetLoc)ClcTrgt();ClcLft();ClcTp();
PosMenu(FrstCntnr,StartTop,StartLeft);
if(RememberStatus)StMnu()}
function NavUnLdd(){Ldd=0;Crtd=0;SetMenu="0"}
function UnLdd(){
NavUnLdd();
if(ExpYes){var M=FrstCntnr?FrstCntnr.FrstMbr:null;
while(M!=null){if(M.CCn){MakeNull(M.CCn);M.CCn=null}
M=M.PrvMbr}}
if(!Nav4){LdTmr=setInterval("ChckLdd()",100)}}
function UnLddTotal(){MakeNull(FrstCntnr);FrstCntnr=RmbrNow=FLoc=ScLoc=DcLoc=SLdAgnWin=CurOvr=CloseTmr=Doc=Bod=Trigger=null}
function MakeNull(P){
var M=P.FrstMbr,Mi;
while(M!=null){Mi=M;
if(M.CCn){MakeNull(M.CCn);M.CCn=null}
M.Cntnr=null;M=M.PrvMbr;Mi.PrvMbr=null;Mi=null}
P.FrstMbr=null}
function ChckLdd(){
if(!ExpYes){if(ScLoc.document.body){clearInterval(LdTmr);Go()}}
else if(ScLoc.document.readyState=="complete"){if(LdTmr)clearInterval(LdTmr);Go()}}
function NavLdd(e){if(e.target!=self)routeEvent(e);if(e.target==ScLoc)Go()}
function ReDoWhole(){if(AppVer.indexOf("4.0")==-1)Doc.location.reload();else if(SWinW!=ScLoc.innerWidth||SWinH!=ScLoc.innerHeight||FWinW!=FLoc.innerWidth||FWinH!=FLoc.innerHeight)Doc.location.reload()}
function Go(){
if(!Ldd&&PosStrt){
BeforeStart();
Crtd=0;Ldd=1;
FLoc=MenuUsesFrames?parent.frames[FirstLineFrame]:window;
ScLoc=MenuUsesFrames?parent.frames[SecLineFrame]:window;
DcLoc=MenuUsesFrames?parent.frames[DocTargetFrame]:window;
if(MenuUsesFrames){
if(!FLoc){FLoc=ScLoc;if(!FLoc){FLoc=ScLoc=DcLoc;if(!FLoc)FLoc=ScLoc=DcLoc=window}}
if(!ScLoc){ScLoc=DcLoc;if(!ScLoc)ScLoc=DcLoc=FLoc}
if(!DcLoc)DcLoc=ScLoc}
if(FLoc==ScLoc)AcrssFrms=0;
if(AcrssFrms)FirstLineHorizontal=MenuFramesVertical?0:1;
FWinW=ExpYes?FLoc.document.body.clientWidth:FLoc.innerWidth;
FWinH=ExpYes?FLoc.document.body.clientHeight:FLoc.innerHeight;
SWinW=ExpYes?ScLoc.document.body.clientWidth:ScLoc.innerWidth;
SWinH=ExpYes?ScLoc.document.body.clientHeight:ScLoc.innerHeight;
FColW=Nav4?FLoc.document:FLoc.document.body;
SColW=Nav4?ScLoc.document:ScLoc.document.body;
DColW=Nav4?DcLoc.document:ScLoc.document.body;
if(TakeOverBgColor){
if(ExpYes&&MacCom)FColW.style.backgroundColor=AcrssFrms?SColW.bgColor:DColW.bgColor;
else FColW.bgColor=AcrssFrms?SColW.bgColor:DColW.bgColor}
if(MenuCentered.indexOf("justify")!=-1&&FirstLineHorizontal)ClcJus();
if(FrstCreat||FLoc==ScLoc)FrstCntnr=CreateMenuStructure("Menu",NoOffFirstLineMenus,null);
else CreateMenuStructureAgain("Menu",NoOffFirstLineMenus);
ClcRl();
if(TargetLoc)ClcTrgt();ClcLft();ClcTp();
PosMenu(FrstCntnr,StartTop,StartLeft);
IniFlg=1;Initiate();Crtd=1;
SLdAgnWin=ExpYes?ScLoc.document.body:ScLoc;SLdAgnWin.onunload=Nav4?NavUnLdd:UnLdd;
if(ExpYes)Trigger.onunload=UnLddTotal;
Trigger.onresize=Nav4?ReDoWhole:RePos;
AfterBuild();
if(RememberStatus)StMnu();
if(Nav4&&FrstCreat){Trigger.captureEvents(Event.LOAD);Trigger.onload=NavLdd}
if(FrstCreat)Dummy();FrstCreat=0;
if(MenuVerticalCentered=="static"&&!AcrssFrms)setInterval("KeepPos()",250) }}
function KeepPos(){
var TS=ExpYes?FLoc.document.body.scrollTop:FLoc.pageYOffset;
if(TS!=StaticPos){var FCSt=Nav4?FrstCntnr:FrstCntnr.style;
FrstCntnr.OrgTop=StartTop+TS;FCSt.top=FrstCntnr.OrgTop+P_X;StaticPos=TS}}
function ClcRl(){
StartTop=M_StrtTp<1&&M_StrtTp>0?M_StrtTp*FWinH:M_StrtTp;
StartLeft=M_StrtLft<1&&M_StrtLft>0?M_StrtLft*FWinW:M_StrtLft}
function ClcJus(){
var a=BorderBtwnMain?NoOffFirstLineMenus+1:2,Sz=Math.round((PartOfWindow*FWinW-a*BorderWidthMain)/NoOffFirstLineMenus),i,j;
for(i=1;i<NoOffFirstLineMenus+1;i++){j=eval("Menu"+i);j[5]=Sz}
StartLeft=0}
function ClcTrgt(){
var TLoc=Nav4?FLoc.document.layers[TargetLoc]:DomYes?FLoc.document.getElementById(TargetLoc):FLoc.document.all[TargetLoc];
if(DomYes){while(TLoc){StartTop+=TLoc.offsetTop;StartLeft+=TLoc.offsetLeft;TLoc=TLoc.offsetParent}}
else{StartTop+=Nav4?TLoc.pageY:TLoc.offsetTop;StartLeft+=Nav4?TLoc.pageX:TLoc.offsetLeft}}
function ClcLft(){
if(MenuCentered.indexOf("left")==-1){
var Sz=FWinW-(!Nav4?parseInt(FrstCntnr.style.width):FrstCntnr.clip.width);
StartLeft+=MenuCentered.indexOf("right")!=-1?Sz:Sz/2;
if(StartLeft<0)StartLeft=0}}
function ClcTp(){
if(MenuVerticalCentered!="top"&&MenuVerticalCentered!="static"){
var Sz=FWinH-(!Nav4?parseInt(FrstCntnr.style.height):FrstCntnr.clip.height);
StartTop+=MenuVerticalCentered=="bottom"?Sz:Sz/2;
if(StartTop<0)StartTop=0}}
function PosMenu(Ct,Tp,Lt){
RLvl++;
var Ti,Li,Hi,Mb=Ct.FrstMbr,CStl=!Nav4?Ct.style:Ct,MStl=!Nav4?Mb.style:Mb,PadL=Mb.value.indexOf("<")==-1?LftXtra:0,PadT=Mb.value.indexOf("<")==-1?TpXtra:0,MWt=!Nav4?parseInt(MStl.width)+PadL:MStl.clip.width,MHt=!Nav4?parseInt(MStl.height)+PadT:MStl.clip.height,CWt=!Nav4?parseInt(CStl.width):CStl.clip.width,CHt=!Nav4?parseInt(CStl.height):CStl.clip.height,CCw,CCh,STp,SLt;
var BRW=RLvl==1?BorderWidthMain:BorderWidthSub,BTWn=RLvl==1?BorderBtwnMain:BorderBtwnSub;
if(RLvl==1&&AcrssFrms)!MenuFramesVertical?Tp=BottomUp?0:FWinH-CHt+(Nav4?MacCom?-2:4:0):Lt=RightToLeft?0:FWinW-CWt+(Nav4?MacCom?-2:4:0);
if(RLvl==2&&AcrssFrms)!MenuFramesVertical?Tp=BottomUp?SWinH-CHt+(Nav4?MacCom?-2:4:0):0:Lt=RightToLeft?SWinW-CWt:0;
if(RLvl==2){Tp+=VerCorrect;Lt+=HorCorrect}
CStl.top=RLvl==1?Tp+P_X:0;Ct.OrgTop=Tp;
CStl.left=RLvl==1?Lt+P_X:0;Ct.OrgLeft=Lt;
if(RLvl==1&&FirstLineHorizontal){Hi=1;Li=CWt-MWt-2*BRW;Ti=0}
else{Hi=Li=0;Ti=CHt-MHt-2*BRW}
while(Mb!=null){
MStl.left=Li+BRW+P_X;
MStl.top=Ti+BRW+P_X;
if(Nav4)Mb.CLyr.moveTo(Li+BRW,Ti+BRW);
if(Mb.CCn){if(RightToLeft)CCw=Nav4?Mb.CCn.clip.width:parseInt(Mb.CCn.style.width);
if(BottomUp)CCh=Nav4?Mb.CCn.clip.height:parseInt(Mb.CCn.style.height);
if(Hi){STp=BottomUp?Ti-CCh:Ti+MHt+2*BRW;SLt=RightToLeft?Li+MWt-CCw:Li}
else{SLt=RightToLeft?Li-CCw+ChildOverlap*MWt+BRW:Li+(1-ChildOverlap)*MWt;
STp=RLvl==1&&AcrssFrms?BottomUp?Ti-CCh+MHt:Ti:BottomUp?Ti-CCh+(1-ChildVerticalOverlap)*MHt+2*BRW:Ti+ChildVerticalOverlap*MHt+BRW}
PosMenu(Mb.CCn,STp,SLt)}
Mb=Mb.PrvMbr;
if(Mb){ MStl=!Nav4?Mb.style:Mb;PadL=Mb.value.indexOf("<")==-1?LftXtra:0;
PadT=Mb.value.indexOf("<")==-1?TpXtra:0;
MWt=!Nav4?parseInt(MStl.width)+PadL:MStl.clip.width;
MHt=!Nav4?parseInt(MStl.height)+PadT:MStl.clip.height;
Hi?Li-=BTWn?(MWt+BRW):(MWt):Ti-=BTWn?(MHt+BRW):MHt}}
status="Ready";RLvl--}
function StMnu(){
if(!Crtd)return;
var i,Pntr=FrstCntnr,Str=ScLoc.SetMenu?ScLoc.SetMenu:"0";
while(Str.indexOf("_")!=-1&&RememberStatus==1){
i=Pntr.NrItms-parseInt(Str.substring(0,Str.indexOf("_")));
Str=Str.slice(Str.indexOf("_")+1);
Pntr=Pntr.FrstMbr;
for(i;i;i--)Pntr=Pntr.PrvMbr;
if(Nav4)Pntr.CLyr.OM();
else Pntr.OM();
Pntr=Pntr.CCn}
i=Pntr.NrItms-parseInt(Str);
Pntr=Pntr.FrstMbr;
for(i;i;i--)Pntr=Pntr.PrvMbr;
if(RmbrNow!=null){SetItem(RmbrNow,0);RmbrNow.Clckd=0}
if(Pntr!=null){SetItem(Pntr,1);Pntr.Clckd=1;
if(RememberStatus==1){if(Nav4)Pntr.CLyr.OM();else Pntr.OM()}}
RmbrNow=Pntr;
ClrAllChlds(FrstCntnr.FrstMbr);
Rmbr(FrstCntnr)}
function Initiate(){
if(IniFlg&&Ldd){Init(FrstCntnr);IniFlg=0;if(RememberStatus)Rmbr(FrstCntnr);if(ShwFlg)AfterCloseAll();ShwFlg=0}}
function Rmbr(CntPtr){
var Mbr=CntPtr.FrstMbr,St;
while(Mbr!=null){
if(Mbr.DoRmbr){
HiliteItem(Mbr);
if(Mbr.CCn&&RememberStatus==1){St=Nav4?Mbr.CCn:Mbr.CCn.style;St.visibility=M_Show;Rmbr(Mbr.CCn)}
break}
else Mbr=Mbr.PrvMbr}}
function Init(CPt){
var Mb=CPt.FrstMbr,MCSt=Nav4?CPt:CPt.style;
RLvl++;MCSt.visibility=RLvl==1?M_Show:M_Hide;CPt.Shw=RLvl==1?1:0;
while(Mb!=null){if(Mb.Hilite)LowItem(Mb);if(Mb.CCn)Init(Mb.CCn);Mb=Mb.PrvMbr}
RLvl--}
function ClrAllChlds(Pt){
var PSt,Pc;
while(Pt){if(Pt.Hilite){Pc=Nav4?Pt.CLyr:Pt;if(Pc!=CurOvr){LowItem(Pt)}
if(Pt.CCn){PSt=Nav4?Pt.CCn:Pt.CCn.style;if(Pc!=CurOvr){PSt.visibility=M_Hide;Pt.CCn.Shw=0}ClrAllChlds(Pt.CCn.FrstMbr)}
break}
Pt=Pt.PrvMbr}}
function SetItem(Pntr,x){while(Pntr!=null){Pntr.DoRmbr=x;Pntr=Nav4?Pntr.CLyr.Ctnr.Cllr:Pntr.Ctnr.Cllr}}
function GoTo(){
var HP=Nav4?this.LLyr:this;
if(HP.Arr[1]){status="";LowItem(HP);IniFlg=1;Initiate();
HP.Arr[1].indexOf("javascript:")!=-1?eval(HP.Arr[1]):DcLoc.location.href=BaseHref+HP.Arr[1]}}
function HiliteItem(P){
if(Nav4){ if(P.ro)P.document.images[P.rid].src=P.ri2;
else{
P.bgColor = HighBgColor;
if(P.value.indexOf("<img")==-1){P.document.write(P.Ovalue);P.document.close()}}}
else{
if(P.ro){var Lc=P.Lvl==1?FLoc:ScLoc;Lc.document.images[P.rid].src=P.ri2}
else{
P.style.backgroundColor=HighBgColor;
P.style.color=FontHighColor;
P.Hilite=1
function LowItem(P){
P.Hilite=0;
if(P.ro){if(Nav4)P.document.images[P.rid].src=P.ri1;
else{var Lc=P.Lvl==1?FLoc:ScLoc;Lc.document.images[P.rid].src=P.ri1}}
else{
if(Nav4){
P.bgColor=LowBgColor;
if(P.value.indexOf("<img")==-1){P.document.write(P.value);P.document.close()}}
else{
P.style.backgroundColor=LowBgColor;
P.style.color=FontLowColor;
function OpenMenu(){
if(!Ldd||!Crtd)return;
if(OpnTmr)clearTimeout(OpnTmr);
var P=Nav4?this.LLyr:this;
if(P.NofChlds&&!P.CCn){
RLvl=this.Lvl;
P.CCn=CreateMenuStructure(P.MN+"_",P.NofChlds,P);
var Ti,Li,Hi;
var MStl=!Nav4?P.style:P;
var PadL=P.value.indexOf("<")==-1?LftXtra:0;
var PadT=P.value.indexOf("<")==-1?TpXtra:0;
var MWt=!Nav4?parseInt(MStl.width)+PadL:MStl.clip.width;
var MHt=!Nav4?parseInt(MStl.height)+PadT:MStl.clip.height;
var CCw,CCh,STp,SLt;
var BRW=RLvl==1?BorderWidthMain:BorderWidthSub;
if(RightToLeft)CCw=Nav4?P.CCn.clip.width:parseInt(P.CCn.style.width);
if(BottomUp)CCh=Nav4?P.CCn.clip.height:parseInt(P.CCn.style.height);
if(RLvl==1&&FirstLineHorizontal){Hi=1;Li=(Nav4?P.left:parseInt(P.style.left))-BRW;Ti=0}
else{Hi=Li=0;Ti=(Nav4?P.top:parseInt(P.style.top))-BRW}
if(Hi){STp=BottomUp?Ti-CCh:Ti+MHt+2*BRW;SLt=RightToLeft?Li+MWt-CCw:Li}
else{SLt=RightToLeft?Li-CCw+ChildOverlap*MWt+BRW:Li+(1-ChildOverlap)*MWt;
STp=RLvl==1&&AcrssFrms?BottomUp?Ti-CCh+MHt:Ti:BottomUp?Ti-CCh+(1-ChildVerticalOverlap)*MHt+2*BRW:Ti+ChildVerticalOverlap*MHt+BRW}
PosMenu(P.CCn,STp,SLt);
RLvl=0}
var CCnt=Nav4?this.LLyr.CCn:this.CCn,HP=Nav4?this.LLyr:this;
CurOvr=this;IniFlg=0;ClrAllChlds(this.Ctnr.FrstMbr);
if(!HP.Hilite)HiliteItem(HP);
if(CCnt!=null&&!CCnt.Shw)RememberStatus?Unfld():OpnTmr=setTimeout("Unfld()",UnfoldDelay);
//alert(HP.value);
status=HP.value;
function Unfld(){
var P=CurOvr;
var TS=ExpYes?ScLoc.document.body.scrollTop:ScLoc.pageYOffset,LS=ExpYes?ScLoc.document.body.scrollLeft:ScLoc.pageXOffset,CCnt=Nav4?P.LLyr.CCn:P.CCn,THt=Nav4?P.clip.height:parseInt(P.style.height),TWt=Nav4?P.clip.width:parseInt(P.style.width),TLt=AcrssFrms&&P.Lvl==1&&!FirstLineHorizontal?0:Nav4?P.Ctnr.left:parseInt(P.Ctnr.style.left),TTp=AcrssFrms&&P.Lvl==1&&FirstLineHorizontal?0:Nav4?P.Ctnr.top:parseInt(P.Ctnr.style.top);
// TS != 0 is only needed if the menu DIVs are positioned relative to the body.
// We've made them positioned relative to div#navigationMenu which causes
// a problem if TS is based on how the body is scrolled. So set TS to zero.
// Note: the code below will adjust the final top offset based on the height of
// the menu bar so the dropdown appears below (and not on top of) the nav bar.
TS = 0;
var CCW=Nav4?P.LLyr.CCn.clip.width:parseInt(P.CCn.style.width),CCH=Nav4?P.LLyr.CCn.clip.height:parseInt(P.CCn.style.height),CCSt=Nav4?P.LLyr.CCn:P.CCn.style,SLt=AcrssFrms&&P.Lvl==1?CCnt.OrgLeft+TLt+LS:CCnt.OrgLeft+TLt,STp=AcrssFrms&&P.Lvl==1?CCnt.OrgTop+TTp+TS:CCnt.OrgTop+TTp;
if(!ShwFlg){ShwFlg=1;BeforeFirstOpen()}
if(MenuWrap){
if(RightToLeft){if(SLt<LS)SLt=P.Lvl==1?LS:SLt+(CCW+(1-2*ChildOverlap)*TWt);if(SLt+CCW>SWinW+LS)SLt=SWinW+LS-CCW}
else{if(SLt+CCW>SWinW+LS)SLt=P.Lvl==1?SWinW+LS-CCW:SLt-(CCW+(1-2*ChildOverlap)*TWt);if(SLt<LS)SLt=LS}
if(BottomUp){if(STp<TS)STp=P.Lvl==1?TS:STp+(CCH-(1-2*ChildVerticalOverlap)*THt);if(STp+CCH>SWinH+TS)STp=SWinH+TS-CCH+(Nav4?4:0)}
else{if(STp+CCH>TS+SWinH)STp=P.Lvl==1?STp=TS+SWinH-CCH:STp-CCH+(1-2*ChildVerticalOverlap)*THt;if(STp<TS)STp=TS}}
CCSt.top=STp+P_X;CCSt.left=SLt+P_X;
if(Fltr&&MenuSlide){P.CCn.filters[0].Apply();P.CCn.filters[0].play()}
CCSt.visibility=M_Show}
function OpenMenuClick(){
if(!Ldd||!Crtd)return;
var HP=Nav4?this.LLyr:this;CurOvr=this;
IniFlg=0;ClrAllChlds(this.Ctnr.FrstMbr);HiliteItem(HP);
function CloseMenu(){
if(!Ldd||!Crtd)return;
status="";
if(this==CurOvr){if(OpnTmr)clearTimeout(OpnTmr);if(CloseTmr)clearTimeout(CloseTmr);IniFlg=1;CloseTmr=setTimeout("Initiate(CurOvr)",DissapearDelay)}}
function CntnrSetUp(W,H,NoOff,WMu,Mc){
var x=BorderColor;
this.FrstMbr=null;this.NrItms=NoOff;this.Cllr=Mc;this.Shw=0;
this.OrgLeft=this.OrgTop=0;
if(Nav4){if(x)this.bgColor=x;this.visibility="hide";this.resizeTo(W,H)}
else{if(x)this.style.backgroundColor=x;this.style.width=W+P_X;this.style.height=H+P_X;
if(!NavYes)this.style.zIndex=RLvl+Ztop;
if(Fltr){FStr="";if(MenuSlide&&RLvl!=1)FStr=MenuSlide;if(MenuShadow)FStr+=MenuShadow;
if(MenuOpacity)FStr+=MenuOpacity;if(FStr!="")this.style.filter=FStr}}}
function MbrSetUp(MbC,PrMmbr,WMu,Wd,Ht,Nofs){
var Lctn=RLvl==1?FLoc:ScLoc,Tfld=this.Arr[0],t,T,L,W,H,S,a;
this.PrvMbr=PrMmbr;this.Lvl=RLvl;this.Ctnr=MbC;this.CCn=null;this.ai=null;this.Hilite=0;this.DoRmbr=0;
this.Clckd=0;this.OM=OpenMenu;this.style.overflow="hidden";
this.MN=WMu;this.NofChlds=Nofs;
this.style.cursor=(this.Arr[1]||(RLvl==1&&UnfoldsOnClick))?ExpYes?"hand":"pointer":"default";this.ro=0;
if(Tfld.indexOf("rollover")!=-1){this.ro=1;this.ri1=Tfld.substring(Tfld.indexOf("?")+1,Tfld.lastIndexOf("?"));
this.ri2=Tfld.substring(Tfld.lastIndexOf("?")+1,Tfld.length);this.rid=WMu+"i";
Tfld="<img src=\""+this.ri1+"\" name=\""+this.rid+"\" width=\""+Wd+"\" height=\""+Ht+"\">"}
this.value=Tfld;
this.style.color=FontLowColor;
this.style.fontFamily=FontFamily;
this.style.fontSize = FontSize + "pt";
this.style.fontWeight="normal";
this.style.fontStyle="normal";
this.style.backgroundColor=LowBgColor;
if (WMu.length > 6)
{ MenuTextCentered = 'left';}
else
{MenuTextCentered = 'center';}
this.style.textAlign=MenuTextCentered;
if(this.Arr[2])this.style.backgroundImage="url(\""+this.Arr[2]+"\")";
if(Tfld.indexOf("<")==-1){this.style.width=Wd-LftXtra+P_X;this.style.height=Ht-TpXtra+P_X;this.style.paddingLeft=LeftPaddng+P_X;this.style.paddingTop=TopPaddng+P_X}
else{this.style.width=Wd+P_X;this.style.height=Ht+P_X}
if(Tfld.indexOf("<")==-1&&DomYes){t=Lctn.document.createTextNode(Tfld);this.appendChild(t)}
else this.innerHTML=Tfld;
if(this.Arr[3]){a=RLvl==1&&FirstLineHorizontal?BottomUp?9:3:RightToLeft?6:0;
if(Arrws[a]!=""){S=Arrws[a];W=Arrws[a+1];H=Arrws[a+2];T=RLvl==1&&FirstLineHorizontal?BottomUp?2:Ht-H-2:(Ht-H)/2;L=RightToLeft?2:Wd-W-2;
if(DomYes){t=Lctn.document.createElement("img");this.appendChild(t);
t.style.position="absolute";t.src=S;t.style.width=W+P_X;t.style.height=H+P_X;t.style.top=T+P_X;t.style.left=L+P_X}
else{Tfld+="<div id=\""+WMu+"_im\" style=\"position:absolute; top:"+T+"; left:"+L+"; width:"+W+"; height:"+H+";visibility:inherit\"><img src=\""+S+"\"></div>";
this.innerHTML=Tfld;t=Lctn.document.all[WMu+"_im"]}
this.ai=t}}
if(ExpYes){this.onselectstart=CnclSlct;this.onmouseover=RLvl==1&&UnfoldsOnClick?OpenMenuClick:OpenMenu;
this.onmouseout=CloseMenu;this.onclick=RLvl==1&&UnfoldsOnClick&&this.Arr[3]?OpenMenu:GoTo}
else{RLvl==1&&UnfoldsOnClick?this.addEventListener("mouseover",OpenMenuClick,false):this.addEventListener("mouseover",OpenMenu,false);
this.addEventListener("mouseout",CloseMenu,false);
RLvl==1&&UnfoldsOnClick&&this.Arr[3]?this.addEventListener("click",OpenMenu,false):this.addEventListener("click",GoTo,false)}}
function NavMbrSetUp(MbC,PrMmbr,WMu,Wd,Ht,Nofs){
var a;
this.value=this.Arr[0];this.ro=0;
if(this.value.indexOf("rollover")!=-1){
this.ro=1;this.ri1=this.value.substring(this.value.indexOf("?")+1,this.value.lastIndexOf("?"));
this.ri2=this.value.substring(this.value.lastIndexOf("?")+1,this.value.length);this.rid=WMu+"i";
this.value="<img src=\""+this.ri1+"\" name=\""+this.rid+"\">"}
CntrTxt="<div align=\""+MenuTextCentered+"\">";
TxtClose="</font>"+ "</div>";
if(LeftPaddng&&this.value.indexOf("<")==-1&&MenuTextCentered=="left")this.value="�\;"+this.value;
this.Ovalue=this.value;
this.value=this.value.fontcolor(FontLowColor);
this.Ovalue=this.Ovalue.fontcolor(FontHighColor);
this.value=CntrTxt+"<font face=\""+FontFamily+"\" point-size=\""+FontSize+"\">"+this.value+TxtClose;
this.Ovalue=CntrTxt+"<font face=\""+FontFamily+"\" point-size=\""+FontSize+"\">"+this.Ovalue+TxtClose;
this.CCn=null;this.PrvMbr=PrMmbr;this.Hilite=0;this.DoRmbr=0;this.Clckd=0;this.visibility="inherit";
this.MN=WMu;this.NofChlds=Nofs;
this.bgColor=LowBgColor;
this.resizeTo(Wd,Ht);
if(!AcrssFrms&&this.Arr[2])this.background.src=this.Arr[2];
this.document.write(this.value);this.document.close();
this.CLyr=new Layer(Wd,MbC);
this.CLyr.Lvl=RLvl;this.CLyr.visibility="inherit";
this.CLyr.onmouseover=RLvl==1&&UnfoldsOnClick?OpenMenuClick:OpenMenu;this.CLyr.onmouseout=CloseMenu;
this.CLyr.captureEvents(Event.MOUSEUP);this.CLyr.onmouseup=RLvl==1&&UnfoldsOnClick&&this.Arr[3]?OpenMenu:GoTo;
this.CLyr.OM=OpenMenu;
this.CLyr.LLyr=this;this.CLyr.resizeTo(Wd,Ht);this.CLyr.Ctnr=MbC;
if(this.Arr[3]){a=RLvl==1&&FirstLineHorizontal?BottomUp?9:3:RightToLeft?6:0;
if(Arrws[a]!=""){this.CLyr.ILyr=new Layer(Arrws[a+1],this.CLyr);this.CLyr.ILyr.visibility="inherit";
this.CLyr.ILyr.top=RLvl==1&&FirstLineHorizontal?BottomUp?2:Ht-Arrws[a+2]-2:(Ht-Arrws[a+2])/2;
this.CLyr.ILyr.left=RightToLeft?2:Wd-Arrws[a+1]-2;this.CLyr.ILyr.width=Arrws[a+1];this.CLyr.ILyr.height=Arrws[a+2];
ImgStr="<img src=\""+Arrws[a]+"\" width=\""+Arrws[a+1]+"\" height=\""+Arrws[a+2]+"\">";
this.CLyr.ILyr.document.write(ImgStr);this.CLyr.ILyr.document.close()}}}
function CreateMenuStructure(MNm,No,Mcllr){
status="Building menu";RLvl++;
var i,NOs,Mbr,W=0,H=0,PMb=null,WMnu=MNm+"1",MWd=eval(WMnu+"[5]"),MHt=eval(WMnu+"[4]"),Lctn=RLvl==1?FLoc:ScLoc;
var BRW=RLvl==1?BorderWidthMain:BorderWidthSub,BTWn=RLvl==1?BorderBtwnMain:BorderBtwnSub;
if(RLvl==1&&FirstLineHorizontal){
for(i=1;i<No+1;i++){WMnu=MNm+eval(i);W=eval(WMnu+"[5]")?W+eval(WMnu+"[5]"):W+MWd}
W=BTWn?W+(No+1)*BRW:W+2*BRW;H=MHt+2*BRW}
else{for(i=1;i<No+1;i++){WMnu=MNm+eval(i);H=eval(WMnu+"[4]")?H+eval(WMnu+"[4]"):H+MHt}
H=BTWn?H+(No+1)*BRW:H+2*BRW;W=MWd+2*BRW}
if(DomYes){var MbC=Lctn.document.createElement("div");MbC.style.position="absolute";MbC.style.visibility="hidden";Lctn.document.getElementById("navigationMenu").appendChild(MbC)}
else{if(Nav4)var MbC=new Layer(W,Lctn);
else{WMnu+="c";Lctn.document.body.insertAdjacentHTML("AfterBegin","<div id=\""+WMnu+"\" style=\"visibility:hidden; position:absolute;\"><\/div>");
var MbC=Lctn.document.all[WMnu]}}
MbC.SetUp=CntnrSetUp;MbC.SetUp(W,H,No,MNm+"1",Mcllr);
if(Exp4){MbC.InnerString="";
for(i=1;i<No+1;i++){WMnu=MNm+eval(i);MbC.InnerString+="<div id=\""+WMnu+"\" style=\"position:absolute;\"><\/div>"}
MbC.innerHTML=MbC.InnerString}
for(i=1;i<No+1;i++){WMnu=MNm+eval(i);NOs=eval(WMnu+"[3]");
W=RLvl==1&&FirstLineHorizontal?eval(WMnu+"[5]")?eval(WMnu+"[5]"):MWd:MWd;
H=RLvl==1&&FirstLineHorizontal?MHt:eval(WMnu+"[4]")?eval(WMnu+"[4]"):MHt;
if(DomYes){Mbr=Lctn.document.createElement("div"); Mbr.style.position="absolute";Mbr.style.visibility="inherit";MbC.appendChild(Mbr)}
else Mbr=Nav4?new Layer(W,MbC):Lctn.document.all[WMnu];
Mbr.Arr=eval(WMnu);
Mbr.SetUp=Nav4?NavMbrSetUp:MbrSetUp;Mbr.SetUp(MbC,PMb,WMnu,W,H,NOs);
if(NOs&&!BuildOnDemand){Mbr.CCn=CreateMenuStructure(WMnu+"_",NOs,Mbr)}
PMb=Mbr}
MbC.FrstMbr=Mbr;
RLvl--;
return(MbC)}
function CreateMenuStructureAgain(MNm,No){
if(!BuildOnDemand){
var i,WMnu,NOs,PMb,Mbr=FrstCntnr.FrstMbr;RLvl++;
for(i=No;i>0;i--){WMnu=MNm+eval(i);NOs=eval(WMnu+"[3]");PMb=Mbr;if(NOs)Mbr.CCn=CreateMenuStructure(WMnu+"_",NOs,Mbr);Mbr=Mbr.PrvMbr}
RLvl--}
else{ var Mbr=FrstCntnr.FrstMbr;
while(Mbr){Mbr.CCn=null;Mbr=Mbr.PrvMbr}}}Hi thanks...As you said I am performing only on onload event..only thing i am confused is if i remove the javacript MRHeader.js everything works fine...am totally confused...pls help
Here is my JSP code for my input page
<%@page import="java.util.*" %>
<%@page import="com.ford.mr.*" %>
<HTML>
<HEAD>
<link href="./css/mplstyle.css" rel="STYLESHEET" type="text/css">
<title>Input Frame</title>
<link type="text/css" rel="STYLESHEET" href="./css/classic.css">
<STYLE>
.vis1 { visibility:visible }
.vis2 { visibility:hidden }
</STYLE>
<%--
MRIFValidation.js contains the java script for the following requirement:
1. Setting the current date in date to compare
2. All input frame client validations.
E.g Plant id should not be empty.
--%>
<script type="text/javascript" src="./javascript/MRIFValidation.js"> </script>
<%--
MRR2HandleDropdown.js is the javascript for the input frame server side actions
It has many functions related to drop down populating and rendering the data
to user from server.
--%>
<script language="javascript" src="./javascript/MRR2HandleDropdown.js"> </script>
<%--
MRheader.js is the javascript which displays the header for our application
plus it has an internal call to MRMenuItem.js and menuscript.js which
builds the menu bar for our application
Issue is here - On commenting the below the previously entered user
inputs are displayed correctly. Else they are not displayed.
--%>
<script language="javascript" src="./javascript/MRheader.js"> </script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a:visited {
color: #0000FF;
.style1 {font-weight: bold}
.style2 {color: #FF0000}
body {
background-color: #FFFFFF;
-->
</style>
<%--
Declaring all the JSP variables used in the page
These variables are used for holding the session parameters
and are used while setting the selected values in the screen.
--%>
<%!
// HTTPSession object
HttpSession sess;
// To hold session Variables //
// Selected plant index
String plantIndex;
// Selected supplier index
String supplierIndex;
// Selected part index
String partIndex;
// List of plant codes
Vector plantCodes = new Vector();
// List of supplier codes
Vector supplierCodes = new Vector();
// List of part codes
Vector partCodes = new Vector();
// To hold the part description for the selected part
String partDescription;
// List of release numbers matching the selected plant, supplier & part
Vector releaseNumbers = new Vector();
// Type of release - Weekly / Daily
String releaseType;
// Selected release1 index
String release1Index;
// Selected release2 index
String release2Index;
// Holds the issue date 1 corresponding to release 1 selected
String issueDate1;
// Holds the issue date 2 corresponding to release 2 selected
String issueDate2;
// List of matching release numbers to the entered issue date1 (Might be one or two
// in case if amended release exist)
Vector matchingRelease1Number = new Vector();
// List of matching release numbers to the entered issue date2 (Might be one or two
// in case if amended release exist)
Vector matchingRelease2Number = new Vector();
// Size of matchingRelease1Number collection
int matchingRelease1Size = 0;
// Size of matchingRelease2Number collection
int matchingRelease2Size = 0;
// Boolean flags to hold if amended release exists in the release numbers
// matching the issue dates entered by user.
boolean amendedRelease1Exist;
boolean amendedRelease2Exist;
String pageName = "";
%>
<%--
The below code does the following:
1. Fetches the various values available in session
2. Stores the same in various JSP variables for access within the page
--%>
<%
System.out.println("In input frame page");
sess = request.getSession(true);
if(sess != null) {
System.out.println("Session id in input frame: "+ sess.getId());
plantIndex = (String) sess.getAttribute("selectedPlantIndex");
supplierIndex = (String) sess.getAttribute("selectedSupplierIndex");
partIndex = (String) sess.getAttribute("selectedPartIndex");
//plantCodes = (Vector) sess.getAttribute("plantCodes");
supplierCodes = (Vector) sess.getAttribute("supplierCodes");
partCodes = (Vector) sess.getAttribute("partCodes");
partDescription = (String) sess.getAttribute("partDescription");
releaseNumbers = (Vector) sess.getAttribute("releaseNumbers");
releaseType = (String) sess.getAttribute("releaseType");
release1Index = (String) sess.getAttribute("selectedRelease1Index");
release2Index =(String) sess.getAttribute("selectedRelease2Index");
issueDate1 = (String) sess.getAttribute("issueDate1");
issueDate2 = (String) sess.getAttribute("issueDate2");
matchingRelease1Number = (Vector) sess.getAttribute("correspondingRelease1Number");
matchingRelease2Number = (Vector) sess.getAttribute("correspondingRelease2Number");
System.out.println("Displaying values in session *******************");
Enumeration enum = sess.getAttributeNames();
while(enum.hasMoreElements()) {
String elementName = (String) enum.nextElement();
System.out.println("element:"+ elementName+": Value: "+ sess.getAttribute(elementName));
System.out.println("Plant Index JSP variable:"+ plantIndex);
%>
<%--
This code is used for getting the plant codes from
the DB. Currently it is hardcoded.
--%>
<%
MRR2GetPlantCodes obj = new MRR2GetPlantCodes();
plantCodes = obj.getPlantCodes();
%>
<%--
The below two blocks are used to iterate through matchingRelease1Number & matchingRelease2Number
and checks if it has amended release. If yes, sets a boolean flag.
matchingRelease1Number & matchingRelease2Number are two collections which
contains the release number(s) matching the inputted issue date
--%>
<%
// Code to set boolean flag amendedRelease1Exist
if(matchingRelease1Number != null) {
Iterator relIter = matchingRelease1Number.iterator();
while(relIter.hasNext()) {
if( ((String)relIter.next()).endsWith("A") ) {
amendedRelease1Exist = true;
// Code to set boolean flag amendedRelease2Exist
if(matchingRelease2Number != null) {
Iterator relIter = matchingRelease2Number.iterator();
while(relIter.hasNext()) {
if( ((String)relIter.next()).endsWith("A") ) {
amendedRelease2Exist = true;
%>
<%--
The below script has one method fillDropDown which is used for setting the
values of the various I/P controls to user selected values:
It sets the below selected values:
1. Plant Index, Supplier Index, Part Index, Part description
2. Release Type (Daily / weekly)
3. Release 1 Index, Release 2 Index
4. Issue date1 & Issue date2
--%>
<script language="javascript">
function fillDropDown(field) {
with(field) {
var partD = "<%=partDescription%>"
<% System.out.println("Loading the index values in input frame......");%>
// inputform.country.selectedIndex = inputform.hiddencountry.value
// Loading plant Index, supplier Index, part index and part description to selected values
<% if(plantIndex != null && !plantIndex.equals("")) {%>
inputframe.plant.selectedIndex = "<%=Integer.parseInt(plantIndex)%>"
<% System.out.println("Selected Plant Index after loading:"+plantIndex);} %>
<% if(supplierIndex != null && !supplierIndex.equals("")) { System.out.println("****Supplier Index not equals null..."+Integer.parseInt(supplierIndex)); %>
inputframe.supplier.selectedIndex = "<%=Integer.parseInt(supplierIndex)%>"
<% } %>
<% if(partIndex != null && !partIndex.equals("")) { %>
inputframe.part.selectedIndex = "<%=Integer.parseInt(partIndex)%>"
<% } %>
<% if(partDescription != null && !partDescription.equals("")) { %>
document.getElementById("partDescription").innerHTML = partD
<% } %>
// Making the default release type selection as done by user
<% if(releaseType != null && !"".equals(releaseType)) {
if("daily".equals(releaseType)) {%>
inputframe.release[0].checked = "checked"
<% //isDaily = true;
} else { %>
inputframe.release[1].checked = "checked"
<% //isWeekly = true;
} %>
<%--
The below code is used to fetch the session variable issueDate1
& issueDate2 (based on the release numbers selected)
and sets the same in two text fields.
--%>
<% if(issueDate1 != null && !issueDate1.equals("")) { %>
inputframe.issueDate1.value = "<%=issueDate1%>"
<% } %>
<% if(issueDate2 != null && !issueDate2.equals("")) { %>
inputframe.issueDate2.value = "<%=issueDate2%>"
<% } %>
<%--
Loading release drop down with the value matching with the entered issue date.
Scenario : User enters the issue date and the corresponding release number is
selected in drop down.
Logic 1:
1. Pass the issue date entered by user and get the matching release numbers
from EJB
2. Compare this with the combo collection and get the perfect match.
3. If more than one match is found take the one with amendment by default
4. Else get the matching one
5. Update the selected index of dropdown to this value
--%>
if(inputframe.release1.options.length > 0) {
var matchingCombo1Index = 0
var comboValue
var matchFound = "false"
var size
var amended = false;
var amendedReleaseExist = "<%=amendedRelease1Exist%>";
var firstValue = ""
var secondValue = ""
var amendedValue = ""
var j = 0
<%
if(matchingRelease1Number != null && matchingRelease1Number.size() != 0) {
Iterator iter = matchingRelease1Number.iterator();
matchingRelease1Size = matchingRelease1Number.size(); %>
size = "<%= matchingRelease1Size %>"
//alert("Size of collection to be matched:"+size)
<% while(iter.hasNext()) {
//String matchFound1 = "false";
String relValue = (String)iter.next();%>
//alert("Collection value under iteration:"+ "<%=relValue%>")
amended = "<%=relValue.endsWith("A")%>"
if(amended) {
amendedValue = "<%=relValue%>"
//alert("Collection value under iteration ends with A:"+amended)
var comb = "<%=relValue%>"
j = j + 1
for(var i = 0; i < inputframe.release1.options.length; i++) {
// breaking the for loop when matchingCombo1Index is set greater than 0
/*if(matchFound == true) {
break
comboValue = inputframe.release1.options.value
//alert("Combo value:->"+comboValue)
//alert("rel value in comparison:"+ comb);
if(comboValue == comb) {
if(size == 1) {
matchFound = "true";
if(size == 2) {
if(j == 1)
firstValue = comb
if(j == 2)
secondValue = comb
// The below if block shall be also kept as if((amended||(!amendedReleaseExist)==true)
// The below one perfectly works fine
if(amended || !amendedReleaseExist) {
matchFound = "true";
if(matchFound == "true") {
matchingCombo1Index = i
// alert("Matching combo index set to:"+ matchingCombo1Index)
inputframe.release1.selectedIndex = matchingCombo1Index
if(size == 2)
document.getElementById('errorArea').innerHTML = "There are"
+ " two release numbers for the particular Issue date."
+" Please select either one of the release numbers ("+firstValue+ " or "+secondValue+" )."
+" Default selection in the Release drop down is "+ amendedValue+ "."
matchingCombo1Index = 0;
matchFound = "false";
// Breaking the for loop
break;
<%
sess.removeAttribute("correspondingRelease1Number") ;
}%>
// Setting the selected release 1 index based on the logic done above.
if(matchingCombo1Index == 0) {
<% if(release1Index != null && !release1Index.equals("")) { matchingRelease1Number = null;%>
inputframe.release1.selectedIndex = "<%=Integer.parseInt(release1Index)%>"
<% } %>
<%--
Performing the above logic to select Release2 value
when the user enters issue date2
--%>
if(inputframe.release2.options.length > 0) {
var matchingCombo2Index = 0
var comboValue
var matchFound = "false"
var size
var amended = false;
var amendedReleaseExist = "<%=amendedRelease2Exist%>";
var firstValue = ""
var secondValue = ""
var amendedValue = ""
var j = 0
<%
if(matchingRelease2Number != null && matchingRelease2Number.size() != 0) {
Iterator iter = matchingRelease2Number.iterator();
matchingRelease2Size = matchingRelease2Number.size(); %>
size = "<%= matchingRelease2Size %>"
//alert("Size of collection to be matched:"+size)
<% while(iter.hasNext()) {
String matchFound1 = "false";
String relValue = (String)iter.next();%>
//alert("Collection value under iteration:"+ "<%=relValue%>")
amended = "<%=relValue.endsWith("A")%>"
if(amended) {
amendedValue = "<%=relValue%>"
//alert("Collection value under iteration ends with A:"+amended)
var comb = "<%=relValue%>"
j = j + 1
for(var i = 0; i < inputframe.release2.options.length; i++) {
// breaking the for loop when matchingCombo2Index is set greater than 0
/*if(matchFound == true) {
break
comboValue = inputframe.release2.options[i].value
//alert("Combo value:->"+comboValue)
//alert("rel value in comparison:"+ comb);
if(comboValue == comb) {
if(size == 1) {
matchFound = "true";
if(size == 2) {
if(j == 1)
firstValue = comb
if(j == 2)
secondValue = comb
// The below if block shall be also kept as if((amended||(!amendedReleaseExist)==true)
// The below one perfectly works fine
if(amended || !amendedRelease2Exist) {
matchFound = "true";
if(matchFound == "true") {
matchingCombo2Index = i
// alert("Matching combo index set to:"+ matchingCombo2Index)
inputframe.release2.selectedIndex = matchingCombo2Index
if(size == 2)
document.getElementById('errorArea').innerHTML = "There are"
+ " two release numbers for the particular Issue date."
+" Please select either one of the release numbers ("+firstValue+ " or "+secondValue+" )."
+" Default selection in the Release drop down is "+ amendedValue+ "."
matchingCombo2Index = 0;
matchFound = "false";
// Breaking the for loop
break;
<%
sess.removeAttribute("correspondingRelease2Number") ;
}%>
// Loading the selected release2 value in drop down
if(matchingCombo2Index == 0) {
<% if(release2Index != null && !release2Index.equals("")) { matchingRelease2Number = null;%>
inputframe.release2.selectedIndex = "<%=Integer.parseInt(release2Index)%>"
<% } %>
} // end of WITH
Logic 2: Not used
1. Pass the issue date entered by user and get the matching release numbers
2. Get the release numbers from session.
3. if release type is daily get the daily release numbers else get weekly release numbers
4. Compare the matching release numbers with daily / weekly release numbers collection
5. Find the match and update the selected index of drop down to this value
}// end of function
</script>
</HEAD>
<%-- Calling the two methods onload event of body --%>
<BODY onload="setCurrentDate(this);fillDropDown(this)"> -
Problem with ExternalInterface.call and Internet Explorer
Hi, I´m developing a site, (
www.gen-studio.com/avelart2
), and I´m using a swf to display a set of thumbs that when
clicked show an item and its description on the browser, those
items might be images or video, everything works fine with the
images.
And actually it works fine with the videos too, when using
Firefox, but when I test the page on Internet explorer it just
doesn’t work!
On principle let me describe how it´s supposed to work,
a thumbnail when clicked sends an id number to javaScript using
ExternalInterface.call(“myFunction”,myId); -I´m
using AS3 for the swf´s-
the javaScript file has already loaded (ever since$(
document).ready) a XML file which uses to match the id with a file
and the description, if the item to show it´s a video, then it
creates a variable which holds a string with the proper html to
embed a swf (a swf movie player that resides just next to the HTML
file), when loaded, the swf movie player uses
ExternalInterface.call() to ask for the source of the video that
has to play, and that function is as follows:
setVideo: function(){
alert("hola");
return comun.miVideo;
(The alert(“hola”); is just to test that the
function is being called), which it is, but it returns null as a
value instead of the proper string, and this happens only on
internet Explorer, but works correctly on Firefox.
I´ve been reading all day about the subject and found a
few interesting things, which though have made me narrow my
problem, they haven´t just provided me with a solution, what I
found so far:
-I must have in account flash security issues: Checked (my
actionScript follows:)
import fl.video.*;
import flash.external.ExternalInterface;
flash.system.Security.allowDomain("*");
var vid:FLVPlayback = this.miPlayer;
vid.source =
flash.external.ExternalInterface.call("comun.setVideo");
-ExternalInterface and Internet explorer don´t work
properly when tested locally: Checked (I have a server on my PC and
I´m testing the site as well in the above direction).
-The object tag holding the swf must have a proper id
attribute: Checked.
-It´s super important the way the object tag is formed:
Checked, and I also tested the tag separately (I put it directly in
the HTML instead of adding it via javaScript) and it worked as
expected in both Firefox and Internet Explorer, which leads me to
believe:
-I read somewhere that if you add the object tag by using
innerHTML or appendChild, returning values from javaScript to swf
won´t work, but I couldn´t find an explanation nor a
solution.
Well, as I said now I´ve been looking all day for an
answer, so I really hope you can help me or give me some advice on
the subject, thank you so much for your time!Hi! it solved itself !! (nahh, I wish), but it indeed had a
solution, it was something quite simple, and I don´t really
understand why it was not working in the first place, but here is
the thing:
I´m learning jquery and this is the first proyect
I´m officially using it, so I was using
$('#myDIV').append("string"); to embed the swf, (and it was working
perfectly on Firefox), so since I had narrowed my problem to those
lines, I decided to try some good-old-fashioned-javaScript and
changed it for: var myDiv =
document.getElementById('thatParticularDiv'); myDiv.innerHTML =
('string'); and it worked both in Firefox and IE !!!!!! :)
I´m quite happy about it, and if someone knows
what´s the issue with my jquery approach I would love to hear
it. THANKS !! -
Problems creating a sticky footer
Hi,
I'm trying to create a website in Dreamweaver using a template that I purchased but I am having problems fixing a footer to the bottom of the page,
At the moment the content footer that I have created (which is a table) changes positon from page to page depending on the content.
The template comes with 2 x CSS style sheets and 1 x JS coded page which I know I need to amend in order for the footer to remain fixed to the bottom of each page.
The trouble is my CSS and JS are not up to much. I have inserted the code from the HTML, CSS & JS below.
If anyone can help me out it would be fantastic as I'm really at a loss!
The HTML of my main webpage is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0023)http://www.contoso.com/ -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
<script src="maxheight.js" type="text/javascript"></script>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
</script>
</head>
<body id="page1" onload="new ElementMaxHeight(); ;MM_preloadImages('images/facebook2.gif','images/linkedin2.gif','images/twitter2.gif')">
<div id="header">
<div class="main">
<div class="flash">
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="980" height="137">
<param name="movie" value="flash/menu_v8.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="swfversion" value="8.0.35.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="flash/menu_v8.swf" width="980" height="137">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="swfversion" value="8.0.35.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" id="Image2" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<div class="flash1">
<object id="FlashID2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="587" height="389">
<param name="movie" value="flash/header_v8.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="swfversion" value="8.0.35.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="flash/header_v8.swf" width="587" height="389">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="swfversion" value="8.0.35.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" id="Image3" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<div class="indent1">
<div class="container1">
<p>Welcome to ACL International.<br />
Through our offices in the UK and Portugal we supply the<br />
very latest in energy saving technologies with our main<br />
focus being on lighting. ACL have been active in the lighting<br />
industry for over 10 years and have built up strong relationships with some of the world's leading lighting manufacturers.</p>
<p> </p>
<p>Welcome to ACL International.<br />
Through our offices in the UK and Portugal we supply the<br />
very latest in energy saving technologies with our main<br />
focus being on lighting. ACL have been active in the lighting<br />
industry for over 10 years and have built up strong relationships with some of the world's leading lighting manufacturers.</p>
</div>
</div>
</div>
</div>
<div id="content">
<div class="main">
<div class="indent-main">
<div class="container bg">
<div class="container bg1">
<div class="container bg2">
<div class="col-1 bg-1">
<div class="indent-col">
<img alt="" src="images/1page_title1.gif" class="title" /><br />
<p>An easy and affordable<br />
way to change existing<br />
lighting to an energy<br />
saving alternative...</p>
<div class="container"><a href="#" class="link-1"><em><b>read more</b></em></a></div>
</div>
</div>
<div class="col-1 bg-2">
<div class="indent-col">
<img alt="" src="images/1page_title2.gif" class="title" /><br />
<p>A more natural,<br />
environmentally<br />
friendly light<br />
source... </p>
<div class="container"><a href="#" class="link-1"><em><b>read more</b></em></a></div>
</div>
</div>
<div class="col-1 bg-3">
<div class="indent-col">
<img alt="" src="images/1page_title3.gif" class="title" /><br />
<p>Up to 80% energy <br />
saving with an<br />
extremely long<br />
lifetime... </p>
<div class="container"><a href="#" class="link-1"><em><b>read more</b></em></a></div>
</div>
</div>
<div class="col-1 bg-4">
<div class="indent-col">
<img alt="" src="images/1page_title4.gif" class="title" /><br />
<p>Low glare,<br />
creating a more<br />
comfortable<br />
environment... </p>
<div class="container"><a href="#" class="link-1"><em><b>read more</b></em></a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="main">
<div class="indent-footer">
<table width="929" border="0">
<tr>
<td width="869">ACLI © 2012 <a href="index-5.html">Privacy Policy</a></td>
<td><img src="images/followus.gif" alt="" width="73" height="20" /></td>
<td width="20"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('facebook','','images/facebook2.gif',1)"><img src="images/facebook.gif" width="20" height="20" border="0" id="facebook" /></a></td>
<td width="20"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('linkedin','','images/linkedin2.gif',1)"><img src="images/linkedin.gif" width="25" height="20" border="0" id="linkedin" /></a></td>
<td width="20"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('twitter','','images/twitter2.gif',1)"><img src="images/twitter.gif" width="27" height="20" border="0" id="twitter" /></a></td>
</tr>
</table>
</div>
</div>
</div>
<script type="text/javascript">
swfobject.registerObject("FlashID");
swfobject.registerObject("FlashID2");
</script>
</body>
</html>
The CSS of the layout is as follows:
.col-1, .col-2, .col-3, .col-4, .col-5{ float:left}
/*======= width =======*/
.main{margin:0 auto; text-align:left; width:929px; }
/*======= header =======*/
#header {height:339px; background:url(images/bg.jpg) }
#page1 #header {height:526px;}
/*======= index.html =======*/
#page1 #content .col-1{ width:231px; margin-right:1px}
#page1 #content .bg{ background:url(images/tail.gif) repeat-y 231px top }
#page1 #content .bg1{ background:url(images/tail.gif) repeat-y 463px top }
#page1 #content .bg2{ background:url(images/tail.gif) repeat-y 695px top }
/*======= index-1.html =======*/
#page2 #content .col-1{ width:339px; margin-right:0}
#page2 #content .col-2{ width:590px}
#page2 #content .col-3{ width:154px; margin-right:32px}
#page2 #content .col-4{ width:158px; margin-right:30px}
#page2 #content .col-5{ width:155px; margin-right:0}
/*======= index-2.html =======*/
#page3 #content .col-1{ width:590px; margin-right:0}
#page3 #content .col-2{ width:339px}
#page3 #content .col-3{ width:188px; margin-right:0}
#page3 #content .col-4{ width:155px; margin-right:0}
/*======= index-3.html =======*/
#page4 #content .col-1{ width:339px; margin-right:0}
#page4 #content .col-2{ width:590px}
#page4 #content .col-3{ width:95px; margin-right:2px; text-align:right; line-height:1em; padding-top:3px}
#page4 #content .col-4{ width:188px; margin-right:0}
/*======= index-4.html =======*/
#page5 #content .col-1{ width:590px; margin-right:0}
#page5 #content .col-2{ width:339px}
#page5 #content .col-3{ width:95px; margin-right:2px; text-align:right; line-height:1em; padding-top:3px}
#page5 #content .col-4{ width:188px; margin-right:0}
/*======= footer =======*/
#footer { height:110px; }
The CSS of the style is as follows:
/* CSS Document */
* { margin:0; padding:0;}
html, body { height:100%; }
body {font-size:100%; line-height:1.125em;}
html, input, textarea {
font-family: "Century Gothic";
color:#646464;
.alignMiddle{ vertical-align:middle}
.alignCenter{ text-align: center}
.container1{ width:100%}
object { vertical-align:top; outline:none}
.clear { clear:both;}
.fleft{ float:left}
.fright{ float:right}
div.container { overflow:hidden; width: 100%;}
a img{ border:0}
img{ vertical-align:top; }
a{color:#000000; text-decoration:underline; outline:none}
a:hover{text-decoration:none}
.link{color:#000000; background:url(images/marker.gif) top left no-repeat; padding-left:20px; background-position:0 5px; text-decoration:none; font-size:.916em }
.link:hover{text-decoration:underline }
.button{color:#fff; font-size:.916em; line-height:20px ; padding:2px 8px 8px 6px; text-decoration:none; }
.button:hover{color:#000; background:url(images/button.gif) top left no-repeat; padding:2px 8px 8px 6px; text-decoration:none; line-height:20px ; }
.current{color:#000; background:url(images/button.gif) top left no-repeat; padding:2px 8px 8px 6px; text-decoration:none; line-height:20px ; }
ul{margin:0; padding:0; list-style:none;}
ul li a{color:#646464; text-decoration: underline; line-height:1.66em}
ul li a:hover { text-decoration:none; }
.ul1 li{background:url(images/marker.gif) top left no-repeat; background-position:0 5px; margin:0; padding-left:10px; }
.ul1 li a{color:#646464; text-decoration:none ; line-height:1.5em}
.ul1 li a:hover { text-decoration:underline; }
.ul li{background:url(images/tail-1.gif) repeat-x bottom; margin:0; padding-left:0; }
.ul li span{color:#646464; float:right; background:url(images/tail-2.gif) repeat-x bottom;}
.ul li a{color:#646464; text-decoration: underline; line-height:1.66em; background:url(images/tail-2.gif) repeat-x bottom;}
.ul li a:hover { text-decoration:none; }
.link-1 { display:block; float:left; background:url(images/link_bg.gif) left top repeat-x; color:#ffffff; text-decoration:none; }
.link-1 em { display:block; background:url(images/link_left.gif) no-repeat left top;}
.link-1 b { display:block; background:url(images/link_right.gif) no-repeat right top; padding:0 5px 3px 7px; font-weight:normal; font-style:normal;}
.link-1:hover{ text-decoration:none; color:#627311}
.link-2 { display:block; float:left; background:url(images/link_bg.gif) left top repeat-x; color:#ffffff; text-decoration:none; }
.link-2 em { display:block; background:url(images/link_left.gif) no-repeat left top;}
.link-2 b { display:block; background:url(images/link_right.gif) no-repeat right top; padding:0 15px 3px 17px; font-weight:normal; font-style:normal;}
.link-2:hover{ text-decoration:none; color:#627311}
/*header*/
#header {font-size:0.75em; color:#646464 }
#header .logo{ margin:19px 0 9px 0 }
#header .indent{margin:30px 0 0 755px; position:absolute; width:175px; color:#625a49}
#page1 #header .indent1{padding:40px 0 0 565px}
#header .indent1{padding:22px 0 0 0px}
#header .indent2{padding:11px 0 0 397px}
#header .img-left{ float:left; margin:0 31px 0 0}
#header .img-indent{ margin:0 24px 0 0}
#header .img-indent1{ margin:0 23px 0 0;}
#header .title{ margin-bottom:11px}
#header a{ color:#625a49; text-decoration:none}
#header a:hover{text-decoration: underline}
.flash{ margin:0 -27px 0 -25px; position:relative}
.flash1{ margin:0 0 0 -25px; position: absolute}
#page1 .bg-1{
background-image: url(images/1page_img1.jpg);
background-repeat: no-repeat;
background-position: right bottom;
#page1 .bg-2{ background:url(images/1page_img2.jpg) no-repeat bottom right}
#page1 .bg-3{ background:url(images/1page_img3.jpg) no-repeat bottom right}
#page1 .bg-4{ background:url(images/1page_img4.jpg) no-repeat bottom right}
.bg-5{ background:url(images/bg-1.gif) repeat-x top #e5e5e5; width:100%}
.bg-6{ background:url(images/bg-2.gif) repeat-x top #fff; width:100%}
/*content*/
#content{ font-size:0.75em; width:100%; text-align:left; background:url(images/bg_cont.gif) repeat-x top #fff}
#content .indent-main{padding:11px 0 0 0}
#content .indent-main1{padding:3px 0 0 0}
#content .indent-col{padding:14px 0 28px 20px}
#content .indent-col1{padding:32px 14px 24px 15px}
#content .indent-col2{padding:32px 28px 0 28px}
#content .title{ margin-bottom:8px}
#content .img-left{ float:left; margin:0 20px 16px 0}
#content .img-right{ float:right; margin:0 0 0 10px}
#content .img-indent{ margin:0 0 16px 0}
#content p{ margin:0 0 17px 0}
#content .p{ margin:0}
#content .p1{ margin:0 0 17px 0}
#content h4{color:#8b870e; font-size:1em; margin-bottom:13px; }
#content .tail{ background:url(images/tail2.gif) repeat-x bottom; padding-bottom:26px; margin-bottom:21px}
.txt{ color:#8e9c2e; font-weight:normal}
.txt a{ color:#8e9c2e; }
#content .indent{padding:15px 0 0 0}
/*box*/
.box{ background:#fcfcfc; width:100%;}
.box .indent-box{ padding:11px 18px 11px 20px; }
.box .indent-box1{ padding:11px 10px 11px 10px; }
/*footer*/
#footer { color:#5a5a5a; text-transform:uppercase; font-size:0.6875em ; }
#footer .indent-footer{ padding:37px 0 0 0; background:url(images/bot.gif) repeat-x top;}
#footer a {color:#5a5a5a; text-decoration:underline}
#footer a:hover { text-decoration:none}
.jamp{ width:69px;}
.jamp1{ width:64px;}
.jamp2{ width:58px;}
.jamp3{ width:52px;}
select{font-size:12px; color:#646464; height:19px; font-family: Arial, Helvetica, sans-serif;}
.indent-2{ position:relative; padding-right:20px; float:left}
.h{ height:29px}
.block-contact span{ float:right; margin-right:50px}
input{
width:183px; height:17px;
font-size:1em;
color:#646464;
padding-left:5px;
textarea{
width:183px; height:57px;
font-size:1em;
color:#646464;
padding-left:5px;
margin-bottom:11px;
overflow:auto}
.textarea{
width:183px; height:142px;
font-size:1em;
color:#646464;
padding-left:5px;
margin-bottom:11px;
overflow:auto}
The JS page is as follows:
var ElementMaxHeight = function() {
this.initialize.apply(this, arguments);
ElementMaxHeight.prototype = {
initialize: function(className) {
this.elements = document.getElementsByClassName(className || 'maxheight');
this.textElement = document.createElement('span');
this.textElement.appendChild(document.createTextNode('A'));
this.textElement.style.display = 'block';
this.textElement.style.position = 'absolute';
this.textElement.style.fontSize = '1em';
this.textElement.style.top = '-1000px';
this.textElement.style.left = '-1000px';
document.body.appendChild(this.textElement);
this.textElementHeight = document.getDimensions(this.textElement).height;
var __object = this;
var __checkFontSize = this.checkFontSize;
this.checkFontSizeInterval = window.setInterval(function() {return __checkFontSize.apply(__object)}, 500);
this.expand();
// Refresh elements height onResize event
var __expand = this.expand;
if (window.addEventListener) {
window.addEventListener('resize', function(event) {return __expand.apply(__object, [( event || window.event)])}, false);
} else if (window.attachEvent) {
window.attachEvent('onresize', function(event) {return __expand.apply(__object, [( event || window.event)])});
expand: function() {
this.reset();
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].style.height = document.getDimensions(this.elements[i].parentNode).height + 'px';
reset: function() {
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].style.height = 'auto';
checkFontSize: function() {
var height = document.getDimensions(this.textElement).height;
if(this.textElementHeight != height) {
this.textElementHeight = height;
this.expand();
if (!!document.evaluate) {
document._getElementsByXPath = function(expression, parentElement) {
var results = [];
var query = document.evaluate(expression, parentElement || document,
null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0, length = query.snapshotLength; i < length; i++)
results.push(query.snapshotItem(i));
return results;
document.getElementsByClassName = function(className, parentElement) {
if (!!document.evaluate) {
var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
return document._getElementsByXPath(q, parentElement);
} else {
var children = (parentElement || document.body).getElementsByTagName('*');
var elements = [], child;
for (var i = 0, length = children.length; i < length; i++) {
child = children[i];
if (child.className.length != 0 &&
(child.className == className ||
child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))) {
elements.push(child);
return elements;
document.getDimensions = function (element) {
var display = element.style.display;
if (display != 'none' && display != null) { // Safari bug
return {width: element.offsetWidth, height: element.offsetHeight};
return {width: originalWidth, height: originalHeight};A sticky footer is position:fixed and therefor always visible in the bottom of browser viewports -- even when users scroll up or down the page.
Sticky Footer Demo:
http://alt-web.com/DEMOS/CSS2-Sticky-Footer.shtml
I believe what you're trying to achieve is 100% height on long & short pages. Try this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>100% height page layout</title>
<style type="text/css">
/**==========================
100% height layout
===========================*/
html,body {
margin:0;
padding:0;
height:100%; /* needed for container min-height */
background:gray;
font-family:arial,sans-serif;
font-size:small;
color:#666;
zoom: 1;
#container {
position:relative; /* needed for footer positioning*/
margin:0 auto; /* center, not in IE5 */
width:1000px;
background:#FF9999;
height:auto !important; /* real browsers */
height:100%; /* IE6: treated as min-height*/
min-height:100%; /* real browsers */
#header {
padding:1em;
background:#ddd;
min-height: 95px;
border-bottom:6px double gray;
#content {
padding:1em 1em 5em; /* bottom padding for footer */
#footer {
position:absolute;
width:100%;
bottom:0; /* stick to bottom */
background:#ddd;
min-height: 95px;
border-top:6px double gray;
#footer p {padding:1em}
</style>
</head>
<body>
<div id="container">
<div id="header">
<p>here is the header</p>
</div>
<div id="content">
<p>Here is the content</p>
</div>
<div id="footer">
<p>Here is the footer</p>
</div>
<!--end container --></div>
</body>
</html>
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
hello i've got a problem with a spry menu
on opera and other there's no problem but on IE the will not appear correctly
here to see on IE
and for opera
here is the code from the pages
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/Connections/cieffedb.asp" -->
<%
dim fs,fo,tfile,cpt,rsImage, crnd, first
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set fo=fs.GetFolder("c:\inetpub\wwwroot\slideshow")
Set tfile=fo.CreateTextFile("sample.xml",true)
set rsImage=server.CreateObject("adodb.recordset")
connstring="dsn=cieffeDB"
cpt = 0
first = true
randomize
crnd = int(rnd(20)*10)
rsImage.source = "select image from Images where id_page = 3 order by Rnd((-1000*id)*Time())"
rsImage.activeconnection = connstring
rsImage.locktype = 1
rsImage.open()
tfile.WriteLine("<?xml version=""1.0"" encoding=""UTF-8""?>")
tfile.WriteLine("<slideshow>")
while (cpt<15)
tfile.WriteLine("<slide>")
tfile.WriteLine("<image url='"&rsImage.Fields.Item("image").Value& "' duration='5' fill = 'stretch' />")
tfile.WriteLine("<link>")
tfile.WriteLine("<area x="& Chr(34)&"1"& Chr(34)& " y="& Chr(34)&"1"& Chr(34)&" width="& Chr(34)&"715"& Chr(34)&" height="& Chr(34)&"80"& Chr(34)&" url="& Chr(34)&"http://www.cieffe.be"& Chr(34)&" target="& Chr(34)&"_parent"& Chr(34)& "/>")
tfile.WriteLine("</link>")
tfile.WriteLine("</slide>")
rsImage.movenext()
cpt = cpt+1
wend
tfile.WriteLine("</slideshow>")
tfile.Close
rsImage.close
set tfile=nothing
set rsImage = nothing
set fo=nothing
set fs=nothing
%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Contents.Remove("MM_Username")
Session.Contents.Remove("MM_UserAuthorization")
if application("langue") = "FR" then
MM_logoutRedirectPage = "/acceuil.asp?lang=FR"
end if
if application("langue") = "NL" then
MM_logoutRedirectPage = "/acceuil.asp?lang=NL"
end if
if application("langue") = "EN" then
MM_logoutRedirectPage = "/acceuil.asp?lang=EN"
end if
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
session("login")=""
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<% application("langue") = Request.QueryString("lang")
%>
<%
Dim categorie
Dim categorie_cmd
Dim categorie_numRows
Set categorie_cmd = Server.CreateObject ("ADODB.Command")
categorie_cmd.ActiveConnection = MM_cieffedb_STRING
categorie_cmd.CommandText = "SELECT CategoryFR, CategoryNL, CategoryEN, N°, CommentaireFR,CommentaireNL, CommentaireEN FROM Categories"
categorie_cmd.Prepared = true
Set categorie = categorie_cmd.Execute
categorie_numRows = 0
%>
<%
Dim images
Dim images_cmd
Dim images_numRows
Set images_cmd = Server.CreateObject ("ADODB.Command")
images_cmd.ActiveConnection = MM_cieffedb_STRING
images_cmd.CommandText = "SELECT image FROM images, categories WHERE N° = id_categorie"
images_cmd.Prepared = true
Set images = images_cmd.Execute
images_numRows = 0
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
Repeat2__numRows = 10
Repeat2__index = 0
images_numRows = images_numRows + Repea2__numRows
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
categorie_numRows = categorie_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Categorie</title>
<link href="/template/style.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="/template/ie.css" type="text/css" />
<![endif]-->
<script src="/SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="/SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="global">
<div id="container">
<div id="line1"> </div>
<div id="line2" align="right"> <a href="categorie.asp?lang=FR" target="_parent">FR</a> <a href="categorie.asp?lang=NL" target="_parent">NL</a> <a href="categorie.asp?lang=EN" target="_parent">EN</a> </div>
<div style="clear: both"></div>
<div id="name">CIEFFE BENELUX</div>
<div id="left">
</div>
<div id="center">
<% If application("langue")="FR" Then %>
<div id="menu">
<p><a href="acceuil.asp?lang=FR">Acceuil</a><br />
menu </p>
<p><a href="categorie.asp?lang=FR">Catégories</a><br />
menu </p>
<%if session("login") <> "OK" then%>
<p><a href="login.asp?lang=FR">Login</a><br />
menu </p>
<%else%>
<p><a href="<%= MM_Logout %>">Log out</a><br />
menu </p>
<%END IF%>
<p><a href="enregistrement.asp?lang=FR">Incription</a><br />
menu </p>
<p><a href="contact.asp?lang=FR">Contactez nous</a><br />
menu </p>
</div>
<% End If %>
<% If application("langue")="NL" Then %>
<div id="menu">
<p><a href="acceuil.asp?lang=NL">Home</a><br />
menu </p>
<p><a href="categorie.asp?lang=NL">Categorieën</a><br />
menu </p>
<%if session("login") <> "OK" then%>
<p><a href="login.asp?lang=NL">Login</a><br />
menu </p>
<%else%>
<p><a href="<%= MM_Logout %>">Log out</a><br />
menu </p>
<%END IF%>
<p><a href="enregistrement.asp?lang=NL">Opschrift</a><br />
menu </p>
<p><a href="contact.asp?lang=NL">Contact</a><br />
menu </p>
</div>
<% End If %>
<% If application("langue")="EN" Then %>
<div id="menu">
<p><a href="acceuil.asp?lang=EN">Home</a><br />
menu </p>
<p><a href="categorie.asp?lang=EN">Categories</a><br />
menu </p>
<%if session("login") <> "OK" then%>
<p><a href="login.asp?lang=EN">Login</a><br />
menu </p>
<%else%>
<p><a href="<%= MM_Logout %>">Log out</a><br />
menu </p>
<%END IF%>
<p><a href="enregistrement.asp?lang=EN">Registration</a><br />
menu </p>
<p><a href="contact.asp?lang=EN">Contact us</a><br />
menu </p>
</div>
<% End If %>
</div>
<div id="right">
<center> <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="716"
HEIGHT="80"
id="slideshow">
<PARAM NAME="movie" VALUE="slideshow\slideshow.swf?xml_source=slideshow\sample.xml"/>
<PARAM NAME="quality" VALUE="high" />
<PARAM NAME="bgcolor" VALUE="#000000" />
<param name="allowScriptAccess" value="sameDomain" />
<EMBED src="\slideshow\slideshow.swf?xml_source=slideshow\sample.xml"
quality="high"
bgcolor="#000000"
WIDTH="715"
HEIGHT="80"
NAME="slideshow"
allowScriptAccess="sameDomain"
swLiveConnect="true"
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</center>
<% If application("langue")="FR" Then %>
<ul id="MenuBar1" class="MenuBarHorizontal">
<% While ((NOT categorie.EOF)) %>
<li><a class="MenuBarItemSubmenu" href="/produits.asp?Num=<%=(categorie.Fields.Item("N°").Value)%>&lang=FR"><%=(categorie.F ields.Item("CategoryFR").Value)%> </a>
<%
dim rs,numProd
numProd=categorie.fields.item("N°").value
connstring="dsn=cieffeDB"
set rs=server.CreateObject("adodb.recordset")
rs.source = "select * from Produits where NumCategorie = " & numProd
rs.activeconnection = connstring
rs.locktype = 1
rs.open()%>
<ul>
<% While ( (NOT rs.EOF)) %>
<li><a class="MenuBarItemSubmenu" href="#"><%=(rs.Fields.Item("NomFR").Value)%></a>
<%
dim rs11,numCat
numCat=rs.fields.item("ID").value
connstring="dsn=cieffeDB"
set rs11=server.CreateObject("adodb.recordset")
rs11.source = "select * from marque where id_Produit = " & numCat
rs11.activeconnection = connstring
rs11.locktype = 1
rs11.open()%>
<ul>
<% While ( (NOT rs11.EOF)) %>
<li><a class="MenuBarItemSubmenu" href="#"><%=rs11.fields.item("marque").value%></a>
<%
dim rs12, numMarq
numMarq = rs11.fields.item("ID").value
connstring = "dsn=cieffeDB"
set rs12 = server.CreateObject("adodb.recordset")
rs12.source = "select * from produitsM where id_marque ="& numMarq
rs12.activeconnection = connstring
rs12.locktype = 1
rs12.open()
%>
<ul>
<%while (not rs12.EOF)%>
<li><a class="MenuBarItemSubmenu" href="#"><%=rs12.fields.item("nom").value%></a>
<%
dim rs13,numPrd
connstring = "dsn=cieffeDB"
numPrd = rs12.fields.item("ID").value
set rs13 = server.CreateObject("adodb.recordset")
rs13.source = "select * from type where id_produitM ="&NumPrd
rs13.activeconnection = connstring
rs13.locktype = 1
rs13.open()
%>
<ul>
<%while (not rs13.EOF)%>
<li><a class="MenuBarItemSubmenu" href="#"><%=rs13.fields.item("type").value%></a></li>
<%
rs13.movenext()
WEND
%>
<%
rs13.close()
set rs13 = nothing
%>
</ul>
</li>
<%rs12.movenext()
WEND
%>
</ul>
<% rs12.close()
set rs12=nothing
%>
</li>
<%rs11.movenext()
WEND%>
</ul>
<% rs11.close()
set rs11=nothing%>
</li>
<%
rs.MoveNext()
WEND%>
</ul>
</li>
<% rs.close()
set rs=nothing
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1%>
<%categorie.MoveNext()
Wend
%>
<%categorie.close()
Set categorie = categorie_cmd.Execute
categorie_numRows = 0
Repeat1__index = 0
Repeat1__numRows = 10%>
</ul>
<p> </p>
<p> </p>
<table border="1" >
<% While ((NOT categorie.EOF)) %>
<td width="96"><%=(categorie.Fields.Item("CommentaireFR").Value)%></td>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
categorie.MoveNext()
Wend
%>
</table>
<% End If %>
<% If application("langue")="NL" Then %>
<ul id="MenuBar1" class="MenuBarHorizontal">
<% While ((NOT categorie.EOF)) %>
<li><a class="MenuBarItemSubmenu" href="/produits.asp?Num=<%=(categorie.Fields.Item("N°").Value)%>&lang=NL"><%=(categorie.F ields.Item("CategoryNL").Value)%> </a>
<%
dim rs2,numProd2
numProd2=categorie.fields.item("N°").value
connstring="dsn=cieffeDB"
set rs2=server.CreateObject("adodb.recordset")
rs2.source = "select * from Produits where NumCategorie = " & numProd2
rs2.activeconnection = connstring
rs2.locktype = 1
rs2.open()%>
<ul>
<% While ( (NOT rs2.EOF)) %>
<li><a href="#"><%=(rs2.Fields.Item("NomNL").Value)%></a>
<%
dim rs21,numCat2
numCat2=rs2.fields.item("ID").value
connstring="dsn=cieffeDB"
set rs21=server.CreateObject("adodb.recordset")
rs21.source = "select * from marque where id_Produit = " & numCat2
rs21.activeconnection = connstring
rs21.locktype = 1
rs21.open()%>
<ul>
<% While ( (NOT rs21.EOF)) %>
<li><a href="#"><%=rs21.fields.item("marque").value%></a>
<%rs21.movenext()
WEND%>
<% rs21.close()
set rs21=nothing%></ul></li>
<%
rs2.MoveNext()
WEND%>
</ul>
</li>
<% rs2.close()
set rs2=nothing
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
categorie.MoveNext()
Wend
%>
<%categorie.close()
Set categorie = categorie_cmd.Execute
categorie_numRows = 0
Repeat1__index = 0
Repeat1__numRows = 10%>
</ul>
<p> </p>
<p> </p>
<table border="1" >
<% While ((NOT categorie.EOF)) %>
<td width="96"><%=(categorie.Fields.Item("CommentaireNL").Value)%></td>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
categorie.MoveNext()
Wend
%>
</table>
<% End If %>
<% If application("langue")="EN" Then %>
<ul id="MenuBar1" class="MenuBarHorizontal">
<% While ((NOT categorie.EOF)) %>
<li><a class="MenuBarItemSubmenu" href="/produits.asp?Num=<%=(categorie.Fields.Item("N°").Value)%>&lang=EN"><%=(categorie.F ields.Item("CategoryEN").Value)%> </a>
<%
dim rs3,numProd3
numProd3=categorie.fields.item("N°").value
connstring="dsn=cieffeDB"
set rs3=server.CreateObject("adodb.recordset")
rs3.source = "select * from Produits where NumCategorie = " & numProd3
rs3.activeconnection = connstring
rs3.locktype = 1
rs3.open()%>
<ul>
<% While ( (NOT rs3.EOF)) %>
<li><a href="#"><%=(rs3.Fields.Item("NomEN").Value)%></a>
</li>
<%
rs3.MoveNext()
WEND%>
</ul>
</li>
<% rs3.close()
set rs3=nothing
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
categorie.MoveNext()
Wend
%>
<%categorie.close()
Set categorie = categorie_cmd.Execute
categorie_numRows = 0
Repeat1__index = 0
Repeat1__numRows = 10%>
</ul>
<p> </p>
<p> </p>
<table border="1" >
<% While ((NOT categorie.EOF)) %>
<td width="96"><%=(categorie.Fields.Item("CommentaireFR").Value)%></td>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
categorie.MoveNext()
Wend
%>
</table><% End If %>
<table border="2">
<tr>
<td>image</td>
</tr>
<% While ((Repeat2__numRows <> 0) AND (NOT images.EOF)) %>
<tr>
<td><img src="<%=(images.Fields.Item("image").Value)%>" width="150" height="150" /></td>
</tr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
images.MoveNext()
Wend
%>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
<%
images.Close()
Set images = Nothing
%>
<%
categorie.Close()
Set categorie = Nothing
%>
than the css
@charset "UTF-8";
/* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */
/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
LAYOUT INFORMATION: describes box model, positioning, z-order
/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
cursor: default;
width: auto;
background-color: #FF9000;
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
z-index: 1000;
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
position: relative;
text-align: center;
cursor: pointer;
width: 102.5px;
float: left;
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 100 px;
position: absolute;
left: -1000em;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
left: auto;
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
width: 100px;
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
position: absolute;
margin: -5% 0 0 95%;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
left: auto;
top: 0;
DESIGN INFORMATION: describes color scheme, borders, fonts
/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
border: 1px solid #CCC;
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
display: block;
cursor: pointer;
background-color: #EEE;
height:35px;
padding: 7px 7px;
color: #333;
text-decoration: none;
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
background-color: #FF9000;
color: #FFF;
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
background-color: #FF9000;
color: #FFF;
SUBMENU INDICATION: styles if there is a submenu under a given menu item
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
background-image: url(boutonNorm.gif);
background-repeat: no-repeat;
/* background-position: 95% 50%;*/
size:auto;
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
background-image: url(boutonSourisDess.gif);
background-repeat: no-repeat;
/* background-position: 95% 50%;*/
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
background-image: url(boutonNorm.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
background-image: url(boutonSourisDess.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
BROWSER HACKS: the hacks below should not be changed unless you are an expert
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
position: absolute;
z-index: 1010;
filter:alpha(opacity:0.1);
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
ul.MenuBarHorizontal li.MenuBarItemIE
display: inline;
f\loat: left;
background: #FFF;
and for the end the js
// SpryMenuBar.js - version 0.12 - Spry Pre-Release 1.6.1
// Copyright (c) 2006. Adobe Systems Incorporated.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Adobe Systems Incorporated nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
SpryMenuBar.js
This file handles the JavaScript for Spry Menu Bar. You should have no need
to edit this file. Some highlights of the MenuBar object is that timers are
used to keep submenus from showing up until the user has hovered over the parent
menu item for some time, as well as a timer for when they leave a submenu to keep
showing that submenu until the timer fires.
var Spry; if (!Spry) Spry = {}; if (!Spry.Widget) Spry.Widget = {};
Spry.BrowserSniff = function()
var b = navigator.appName.toString();
var up = navigator.platform.toString();
var ua = navigator.userAgent.toString();
this.mozilla = this.ie = this.opera = this.safari = false;
var re_opera = /Opera.([0-9\.]*)/i;
var re_msie = /MSIE.([0-9\.]*)/i;
var re_gecko = /gecko/i;
var re_safari = /(applewebkit|safari)\/([\d\.]*)/i;
var r = false;
if ( (r = ua.match(re_opera))) {
this.opera = true;
this.version = parseFloat(r[1]);
} else if ( (r = ua.match(re_msie))) {
this.ie = true;
this.version = parseFloat(r[1]);
} else if ( (r = ua.match(re_safari))) {
this.safari = true;
this.version = parseFloat(r[2]);
} else if (ua.match(re_gecko)) {
var re_gecko_version = /rv:\s*([0-9\.]+)/i;
r = ua.match(re_gecko_version);
this.mozilla = true;
this.version = parseFloat(r[1]);
this.windows = this.mac = this.linux = false;
this.Platform = ua.match(/windows/i) ? "windows" :
(ua.match(/linux/i) ? "linux" :
(ua.match(/mac/i) ? "mac" :
ua.match(/unix/i)? "unix" : "unknown"));
this[this.Platform] = true;
this.v = this.version;
if (this.safari && this.mac && this.mozilla) {
this.mozilla = false;
Spry.is = new Spry.BrowserSniff();
// Constructor for Menu Bar
// element should be an ID of an unordered list (<ul> tag)
// preloadImage1 and preloadImage2 are images for the rollover state of a menu
Spry.Widget.MenuBar = function(element, opts)
this.init(element, opts);
Spry.Widget.MenuBar.prototype.init = function(element, opts)
this.element = this.getElement(element);
// represents the current (sub)menu we are operating on
this.currMenu = null;
this.showDelay = 250;
this.hideDelay = 600;
if(typeof document.getElementById == 'undefined' || (navigator.vendor == 'Apple Computer, Inc.' && typeof window.XMLHttpRequest == 'undefined') || (Spry.is.ie && typeof document.uniqueID == 'undefined'))
// bail on older unsupported browsers
return;
// Fix IE6 CSS images flicker
if (Spry.is.ie && Spry.is.version < 7){
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
this.upKeyCode = Spry.Widget.MenuBar.KEY_UP;
this.downKeyCode = Spry.Widget.MenuBar.KEY_DOWN;
this.leftKeyCode = Spry.Widget.MenuBar.KEY_LEFT;
this.rightKeyCode = Spry.Widget.MenuBar.KEY_RIGHT;
this.escKeyCode = Spry.Widget.MenuBar.KEY_ESC;
this.hoverClass = 'MenuBarItemHover';
this.subHoverClass = 'MenuBarItemSubmenuHover';
this.subVisibleClass ='MenuBarSubmenuVisible';
this.hasSubClass = 'MenuBarItemSubmenu';
this.activeClass = 'MenuBarActive';
this.isieClass = 'MenuBarItemIE';
this.verticalClass = 'MenuBarVertical';
this.horizontalClass = 'MenuBarHorizontal';
this.enableKeyboardNavigation = true;
this.hasFocus = false;
// load hover images now
if(opts)
for(var k in opts)
if (typeof this[k] == 'undefined')
var rollover = new Image;
rollover.src = opts[k];
Spry.Widget.MenuBar.setOptions(this, opts);
// safari doesn't support tabindex
if (Spry.is.safari)
this.enableKeyboardNavigation = false;
if(this.element)
this.currMenu = this.element;
var items = this.element.getElementsByTagName('li');
for(var i=0; i<items.length; i++)
if (i > 0 && this.enableKeyboardNavigation)
items[i].getElementsByTagName('a')[0].tabIndex='-1';
this.initialize(items[i], element);
if(Spry.is.ie)
this.addClassName(items[i], this.isieClass);
items[i].style.position = "static";
if (this.enableKeyboardNavigation)
var self = this;
this.addEventListener(document, 'keydown', function(e){self.keyDown(e); }, false);
if(Spry.is.ie)
if(this.hasClassName(this.element, this.verticalClass))
this.element.style.position = "relative";
var linkitems = this.element.getElementsByTagName('a');
for(var i=0; i<linkitems.length; i++)
linkitems[i].style.position = "relative";
Spry.Widget.MenuBar.KEY_ESC = 27;
Spry.Widget.MenuBar.KEY_UP = 38;
Spry.Widget.MenuBar.KEY_DOWN = 40;
Spry.Widget.MenuBar.KEY_LEFT = 37;
Spry.Widget.MenuBar.KEY_RIGHT = 39;
Spry.Widget.MenuBar.prototype.getElement = function(ele)
if (ele && typeof ele == "string")
return document.getElementById(ele);
return ele;
Spry.Widget.MenuBar.prototype.hasClassName = function(ele, className)
if (!ele || !className || !ele.className || ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)
return false;
return true;
Spry.Widget.MenuBar.prototype.addClassName = function(ele, className)
if (!ele || !className || this.hasClassName(ele, className))
return;
ele.className += (ele.className ? " " : "") + className;
Spry.Widget.MenuBar.prototype.removeClassName = function(ele, className)
if (!ele || !className || !this.hasClassName(ele, className))
return;
ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
// addEventListener for Menu Bar
// attach an event to a tag without creating obtrusive HTML code
Spry.Widget.MenuBar.prototype.addEventListener = function(element, eventType, handler, capture)
try
if (element.addEventListener)
element.addEventListener(eventType, handler, capture);
else if (element.attachEvent)
element.attachEvent('on' + eventType, handler);
catch (e) {}
// createIframeLayer for Menu Bar
// creates an IFRAME underneath a menu so that it will show above form controls and ActiveX
Spry.Widget.MenuBar.prototype.createIframeLayer = function(menu)
var layer = document.createElement('iframe');
layer.tabIndex = '-1';
layer.src = 'javascript:""';
layer.frameBorder = '0';
layer.scrolling = 'no';
menu.parentNode.appendChild(layer);
layer.style.left = menu.offsetLeft + 'px';
layer.style.top = menu.offsetTop + 'px';
layer.style.width = menu.offsetWidth + 'px';
layer.style.height = menu.offsetHeight + 'px';
// removeIframeLayer for Menu Bar
// removes an IFRAME underneath a menu to reveal any form controls and ActiveX
Spry.Widget.MenuBar.prototype.removeIframeLayer = function(menu)
var layers = ((menu == this.element) ? menu : menu.parentNode).getElementsByTagName('iframe');
while(layers.length > 0)
layers[0].parentNode.removeChild(layers[0]);
// clearMenus for Menu Bar
// root is the top level unordered list (<ul> tag)
Spry.Widget.MenuBar.prototype.clearMenus = function(root)
var menus = root.getElementsByTagName('ul');
for(var i=0; i<menus.length; i++)
this.hideSubmenu(menus[i]);
this.removeClassName(this.element, this.activeClass);
// bubbledTextEvent for Menu Bar
// identify bubbled up text events in Safari so we can ignore them
Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
return Spry.is.safari && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget));
// showSubmenu for Menu Bar
// set the proper CSS class on this menu to show it
Spry.Widget.MenuBar.prototype.showSubmenu = function(menu)
if(this.currMenu)
this.clearMenus(this.currMenu);
this.currMenu = null;
if(menu)
this.addClassName(menu, this.subVisibleClass);
if(typeof document.all != 'undefined' && !Spry.is.opera && navigator.vendor != 'KDE')
if(!this.hasClassName(this.element, this.horizontalClass) || menu.parentNode.parentNode != this.element)
menu.style.top = menu.parentNode.offsetTop + 'px';
if(Spry.is.ie && Spry.is.version < 7)
this.createIframeLayer(menu);
this.addClassName(this.element, this.activeClass);
// hideSubmenu for Menu Bar
// remove the proper CSS class on this menu to hide it
Spry.Widget.MenuBar.prototype.hideSubmenu = function(menu)
if(menu)
this.removeClassName(menu, this.subVisibleClass);
if(typeof document.all != 'undefined' && !Spry.is.opera && navigator.vendor != 'KDE')
menu.style.top = '';
menu.style.left = '';
if(Spry.is.ie && Spry.is.version < 7)
this.removeIframeLayer(menu);
// initialize for Menu Bar
// create event listeners for the Menu Bar widget so we can properly
// show and hide submenus
Spry.Widget.MenuBChange
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 100 px;
position: absolute;
left:
-1000em;
to
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 100px;
position: absolute;
left:
-1000em;
I hope this helps.
Ben -
Problem with the PUT operation some files won't transfer help please
Hi everyone,
I am using DWCS3 on OS X Leoard 10.5 and MAMP
I am putting together a basic index.html page and then I want to template it. Pretty basic stuff.
However when I want to view the index.html page in my MAMP testing server, In the middle of the PUT operation I get a message saying;
File activity incomplete 1 file or folder was not completed.
index.html - Put operation successful
- error occurred - An error occurred - cannot put . An unknown error occurred.
css:index.css - same - not transferred
SpryAssets:SpryMenuBar.js - same - not transferred
SpryAssets:SpryMenuBarHorizontal.css - same - not transferred
SpryAssets:SpryMenuBarDown.gif - same - not transferred
SpryAssets:SpryMenuBarRight.gif - same - not transferred
SpryAssets:SpryMenuBarDownHover.gif - same - not transferred
SpryAssets:SpryMenuBarRightHover.gif - same - not transferred
SpryAssets:SpryMenuBarVertical.css - same - not transferred
File activity incomplete. 1 file(s) or folder(s) were not completed.
Files updated: 1
Files skipped: 8
Files with errors: 1
Finished: 23/07/2010 13:30
I am aware that files are not transferring over to the testing server but I don't understand why or how to fix the problem. I don't think the problem lies with the path from Dreamweaver to the testing server because I have been working on the page and viewing it in the testing server. It's only just started displaying the message above and not passing some of the files over. It will for example pass the index.css page over.
I have copied the code over for index.html, SpryMenuBar.js, SpryMenuBarHorizontal.ccs and SpryMenuBarVertical.css.
In the hope that someone will not mind taking a look at this for me.
Below is the code for my home page in case the problem lies here
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Home Page Geoff Hyde is Innocent</title>
<link href="//index.html" rel="stylesheet" type="text/css" media="all" />
<link href="css/index.css" rel="stylesheet" type="text/css" />
<!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>
<body class="twoColFixLtHdr">
<div id="container">
<div id="header">
<h1><u>Geoff Hyde is Innocent!</u></h1>
<!-- end #header -->
</div>
<div id="nav">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="index.html" title="Home page">Home</a> </li>
<li><a href="about.html" title="About the campaign">About us</a> </li>
<li><a href="updates1.html" title="links to updates" class="MenuBarItemSubmenu">Updates</a>
<ul>
<li><a href="confisupdate.html" title="Confiscation update">Confiscation</a></li>
<li><a href="appealupdate.html" title="Appeal update">Appeal</a></li>
<li><a href="petitionupdate.html" title="Petition update">Petition</a></li>
<li><a href="newspdf.html" title="News articles">News articles</a></li>
</ul>
</li>
<li><a href="charity.html" title="About charity for Geoff Hyde" class="MenuBarItemSubmenu">Charity</a>
<ul>
<li><a href="friends.html" title="About the people supporting Geoff Hyde" class="MenuBarItemSubmenu">Friends</a>
<ul>
<li><a href="#">Item 3.1.1</a></li>
<li><a href="#">Item 3.1.2</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#" title="Links to the petition">Petition</a></li>
</ul>
</div>
<br/>
<div id="sidebar1">
<h3> </h3>
<ul id="MenuBar2" class="MenuBarVertical">
<li><a href="case.html" title="What happened on 27 Feb">The case</a> </li>
<li><a href="invest1.html" title="Links to investigation" class="MenuBarItemSubmenu">Investigation</a>
<ul>
<li><a href="tipoff.html" title="Some things we are not allowed to know">Tip off</a></li>
<li><a href="whyg.html" title="Why arrest Geoff?">Why Geoff</a></li>
<li><a href="int27.html" title="27 minute interview">27 minutes</a></li>
<li><a href="cops.html" title="What the Police did not do">Police</a></li>
</ul>
</li>
<li><a href="evi.html" title="Links to evidence" class="MenuBarItemSubmenu">Evidence</a>
<ul>
<li><a href="calls.htnl" title="Fictional phone calls">Phone calls</a> </li>
<li><a href="timing.html" title="It's all in the timing">Timing</a></li>
<li><a href="lie.html" title="Can you convict on a lie">Lucas directive</a></li>
<li><a href="all.html" title="That's all folks">That's all</a></li>
</ul>
</li>
<li><a href="confis.html" title="Links to Confiscation" class="MenuBarItemSubmenu">Confiscation</a>
<ul>
<li><a href="claners.html" title="Taken to the cleaners">Cleaners</a></li>
<li><a href="ruin.html" title="Family faces ruin">Ruin</a></li>
<li><a href="won.html" title="We won the Confiscation">We won</a></li>
</ul>
</li>
<li><a href="biog.html" title="About Geoff Hyde">Biography</a></li>
<li><a href="#" title="Link to the Petition">Petition</a></li>
<li><a href="friends.html" title="About the Charity Friends of Geoff Hyde" class="MenuBarItemSubmenu">Charity</a>
<ul>
<li><a href="supp.html" title="About the people who supprt Geoff Hyde">Supporters</a></li>
</ul>
</li>
<li><a href="about.html" title="About the Geoff Hyde is Innocent campaign">About us</a></li>
</ul>
<h3> </h3>
<!-- end #sidebar1 --></div>
<div id="mainContent">
<h1>An Innocent Man</h1>
<p>On February 27, 2006, haulier Geoff Hyde took a call on his mobile. Taking that call changed his life forever; because it ended up with the 59-year-old grandfather with no previous convictions to his name being found guilty of drug smuggling. He was sentenced to 22 years in prison. This website is devoted to showing how the Crown Prosecution Service conspired to put an innocent man behind bars, and once they did set about siezing the fruits of nearly four decades of hard work.</p>
<h2> </h2>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<p>©copyright2010</p>
<!-- end #footer --></div>
<!-- end #container --></div>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
This is the SpryMenuBar.js code which is not being transferred
var Spry;
if(!Spry)
Spry = {};
if(!Spry.Widget)
Spry.Widget = {};
// Constructor for Menu Bar
// element should be an ID of an unordered list (<ul> tag)
// preloadImage1 and preloadImage2 are images for the rollover state of a menu
Spry.Widget.MenuBar = function(element, opts)
this.init(element, opts);
Spry.Widget.MenuBar.prototype.init = function(element, opts)
this.element = this.getElement(element);
// represents the current (sub)menu we are operating on
this.currMenu = null;
var isie = (typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE');
if(typeof document.getElementById == 'undefined' || (navigator.vendor == 'Apple Computer, Inc.' && typeof window.XMLHttpRequest == 'undefined') || (isie && typeof document.uniqueID == 'undefined'))
// bail on older unsupported browsers
return;
// load hover images now
if(opts)
for(var k in opts)
var rollover = new Image;
rollover.src = opts[k];
if(this.element)
this.currMenu = this.element;
var items = this.element.getElementsByTagName('li');
for(var i=0; i<items.length; i++)
this.initialize(items[i], element, isie);
if(isie)
this.addClassName(items[i], "MenuBarItemIE");
items[i].style.position = "static";
if(isie)
if(this.hasClassName(this.element, "MenuBarVertical"))
this.element.style.position = "relative";
var linkitems = this.element.getElementsByTagName('a');
for(var i=0; i<linkitems.length; i++)
linkitems[i].style.position = "relative";
Spry.Widget.MenuBar.prototype.getElement = function(ele)
if (ele && typeof ele == "string")
return document.getElementById(ele);
return ele;
Spry.Widget.MenuBar.prototype.hasClassName = function(ele, className)
if (!ele || !className || !ele.className || ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)
return false;
return true;
Spry.Widget.MenuBar.prototype.addClassName = function(ele, className)
if (!ele || !className || this.hasClassName(ele, className))
return;
ele.className += (ele.className ? " " : "") + className;
Spry.Widget.MenuBar.prototype.removeClassName = function(ele, className)
if (!ele || !className || !this.hasClassName(ele, className))
return;
ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
// addEventListener for Menu Bar
// attach an event to a tag without creating obtrusive HTML code
Spry.Widget.MenuBar.prototype.addEventListener = function(element, eventType, handler, capture)
try
if (element.addEventListener)
element.addEventListener(eventType, handler, capture);
else if (element.attachEvent)
element.attachEvent('on' + eventType, handler);
catch (e) {}
// createIframeLayer for Menu Bar
// creates an IFRAME underneath a menu so that it will show above form controls and ActiveX
Spry.Widget.MenuBar.prototype.createIframeLayer = function(menu)
var layer = document.createElement('iframe');
layer.tabIndex = '-1';
layer.src = 'javascript:false;';
menu.parentNode.appendChild(layer);
layer.style.left = menu.offsetLeft + 'px';
layer.style.top = menu.offsetTop + 'px';
layer.style.width = menu.offsetWidth + 'px';
layer.style.height = menu.offsetHeight + 'px';
// removeIframeLayer for Menu Bar
// removes an IFRAME underneath a menu to reveal any form controls and ActiveX
Spry.Widget.MenuBar.prototype.removeIframeLayer = function(menu)
var layers = menu.parentNode.getElementsByTagName('iframe');
while(layers.length > 0)
layers[0].parentNode.removeChild(layers[0]);
// clearMenus for Menu Bar
// root is the top level unordered list (<ul> tag)
Spry.Widget.MenuBar.prototype.clearMenus = function(root)
var menus = root.getElementsByTagName('ul');
for(var i=0; i<menus.length; i++)
this.hideSubmenu(menus[i]);
this.removeClassName(this.element, "MenuBarActive");
// bubbledTextEvent for Menu Bar
// identify bubbled up text events in Safari so we can ignore them
Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
return (navigator.vendor == 'Apple Computer, Inc.' && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget)));
// showSubmenu for Menu Bar
// set the proper CSS class on this menu to show it
Spry.Widget.MenuBar.prototype.showSubmenu = function(menu)
if(this.currMenu)
this.clearMenus(this.currMenu);
this.currMenu = null;
if(menu)
this.addClassName(menu, "MenuBarSubmenuVisible");
if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
if(!this.hasClassName(this.element, "MenuBarHorizontal") || menu.parentNode.parentNode != this.element)
menu.style.top = menu.parentNode.offsetTop + 'px';
if(typeof document.uniqueID != "undefined")
this.createIframeLayer(menu);
this.addClassName(this.element, "MenuBarActive");
// hideSubmenu for Menu Bar
// remove the proper CSS class on this menu to hide it
Spry.Widget.MenuBar.prototype.hideSubmenu = function(menu)
if(menu)
this.removeClassName(menu, "MenuBarSubmenuVisible");
if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
menu.style.top = '';
menu.style.left = '';
this.removeIframeLayer(menu);
// initialize for Menu Bar
// create event listeners for the Menu Bar widget so we can properly
// show and hide submenus
Spry.Widget.MenuBar.prototype.initialize = function(listitem, element, isie)
var opentime, closetime;
var link = listitem.getElementsByTagName('a')[0];
var submenus = listitem.getElementsByTagName('ul');
var menu = (submenus.length > 0 ? submenus[0] : null);
var hasSubMenu = false;
if(menu)
this.addClassName(link, "MenuBarItemSubmenu");
hasSubMenu = true;
if(!isie)
// define a simple function that comes standard in IE to determine
// if a node is within another node
listitem.contains = function(testNode)
// this refers to the list item
if(testNode == null)
return false;
if(testNode == this)
return true;
else
return this.contains(testNode.parentNode);
// need to save this for scope further down
var self = this;
this.addEventListener(listitem, 'mouseover', function(e)
if(self.bubbledTextEvent())
// ignore bubbled text events
return;
clearTimeout(closetime);
if(self.currMenu == listitem)
self.currMenu = null;
// show menu highlighting
self.addClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
if(menu && !self.hasClassName(menu, "MenuBarSubmenuVisible"))
opentime = window.setTimeout(function(){self.showSubmenu(menu);}, 250);
}, false);
this.addEventListener(listitem, 'mouseout', function(e)
if(self.bubbledTextEvent())
// ignore bubbled text events
return;
var related = (typeof e.relatedTarget != 'undefined' ? e.relatedTarget : e.toElement);
if(!listitem.contains(related))
clearTimeout(opentime);
self.currMenu = listitem;
// remove menu highlighting
self.removeClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
if(menu)
closetime = window.setTimeout(function(){self.hideSubmenu(menu);}, 600);
}, false);
The code below is the SpryMenuBarHorizontal.css
@charset "UTF-8";
/* SpryMenuBarHorizontal.css - Revision: Spry Preview Release 1.4 */
/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
LAYOUT INFORMATION: describes box model, positioning, z-order
/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
cursor: default;
width: 780px;
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
z-index: 1000;
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
position: relative;
text-align: left;
cursor: pointer;
width: 156px;
float: left;
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 156px;
position: absolute;
left: -1000em;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
left: auto;
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
width: 156px;
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
position: absolute;
margin: -5% 0 0 95%;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
left: auto;
top: 0;
DESIGN INFORMATION: describes color scheme, borders, fonts
/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
border: 1px solid #CCC;
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
display: block;
cursor: pointer;
background-color: #CC0000;
padding: 0.5em 0.75em;
color: #FFFFFF;
text-decoration: none;
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
background-color: #000000;
color: #FFF;
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
background-color: #33C;
color: #FFF;
SUBMENU INDICATION: styles if there is a submenu under a given menu item
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
background-image: url(SpryMenuBarDown.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
background-image: url(SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
background-image: url(SpryMenuBarDownHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
background-image: url(SpryMenuBarRightHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
BROWSER HACKS: the hacks below should not be changed unless you are an expert
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
position: absolute;
z-index: 1010;
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
ul.MenuBarHorizontal li.MenuBarItemIE
display: inline;
f\loat: left;
background: #FFF;
Below is the code for SpryMenuBarVertical.css
@charset "UTF-8";
/* SpryMenuBarVertical.css - Revision: Spry Preview Release 1.4 */
/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
LAYOUT INFORMATION: describes box model, positioning, z-order
/* The outermost container of the Menu Bar, a fixed width box with no margin or padding */
ul.MenuBarVertical
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
cursor: default;
width: 8em;
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
z-index: 1000;
/* Menu item containers, position children relative to this container and are same fixed width as parent */
ul.MenuBarVertical li
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
position: relative;
text-align: left;
cursor: pointer;
width: 8em;
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarVertical ul
margin: -5% 0 0 95%;
padding: 0;
list-style-type: none;
font-size: 100%;
position: absolute;
z-index: 1020;
cursor: default;
width: 8.2em;
left: -1000em;
top: 0;
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarVertical ul.MenuBarSubmenuVisible
left: 0;
/* Menu item containers are same fixed width as parent */
ul.MenuBarVertical ul li
width: 8.2em;
DESIGN INFORMATION: describes color scheme, borders, fonts
/* Outermost menu container has borders on all sides */
ul.MenuBarVertical
border: 1px solid #CCC;
/* Submenu containers have borders on all sides */
ul.MenuBarVertical ul
border: 1px solid #CCC;
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarVertical a
display: block;
cursor: pointer;
background-color: #000000;
padding: 0.5em 0.75em;
color: #FFFFFF;
text-decoration: none;
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarVertical a:hover, ul.MenuBarVertical a:focus
background-color: #666666;
color: #FFF;
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarVertical a.MenuBarSubmenuVisible
background-color: #33C;
color: #FFF;
SUBMENU INDICATION: styles if there is a submenu under a given menu item
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarVertical a.MenuBarItemSubmenu
background-image: url(SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarVertical a.MenuBarItemSubmenuHover
background-image: url(SpryMenuBarRightHover.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
BROWSER HACKS: the hacks below should not be changed unless you are an expert
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarVertical iframe
position: absolute;
z-index: 1010;
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
ul.MenuBarVertical li.MenuBarItemIE
display: inline;
f\loat: left;
background: #FFF;I've only encountered two instances where the PUT operation failed on certain files. One, the server does not like the particular file type, and two, when the file was open in another program.
Other than that, I could only guess that it may have something else to do with the web server configuration and not DW. -
Transforming to HTML and problems with incorrect entities for quotes
Hello,
I have a seemingly fairly simple problem, I have a DOM tree which I would like to convert to HTML.
This works fine, also for special characters like umlauts - they are escaped with the correct html entities.
However single and double quotes are not escaped at all. Do I need to define custom entities for that?
Sample code:
package generaltests;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
import java.io.*;
public class XmlTransform {
public static void main(String args[]) {
try {
DocumentBuilderFactory dbfac =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
Document doc = docBuilder.newDocument();
//<QBXML>
Element root = doc.createElement("ROOT");
doc.appendChild(root);
Element text = doc.createElement("TEXT");
root.appendChild(text);
text.appendChild(doc.createTextNode("Test text\n< With special character ' and umlaut �"));
// Transformation
TransformerFactory transfac = TransformerFactory.newInstance();
Transformer trans = transfac.newTransformer();
trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
trans.setOutputProperty(OutputKeys.METHOD, "html");
trans.setOutputProperty(OutputKeys.ENCODING, "US-ASCII");
//create string from xml tree
StringWriter sw = new StringWriter();
StreamResult result = new StreamResult(sw);
DOMSource source = new DOMSource(doc);
trans.transform(source, result);
System.out.println(sw.toString());
} catch (Exception e) {
}Output is (the first left bracket in the second line is actually escaped correctly and only transformed to < in this post):
<ROOT><TEXT>Test text
< With special character ' and umlaut ö</TEXT></ROOT>Edited by: tzu22 on Apr 16, 2008 1:44 AM
Edited by: tzu22 on Apr 16, 2008 1:50 AM& quot; and & apos; have to be used for attribute values. For text nodes, " and ' can be used as ordinary characters.
Edited by: Alain_COUTHURES on Apr 16, 2008 8:32 AM -
Problem with hardware acceleration on HBO GO
I just got a Zotac ZBOX AD02 (AMD E-350 APU w/ Radeon HD 6310) and in general it's working great. However, I have a problem with Flash video on HBO GO. For the first minute or so of steaming video, everything seems perfect. Video is high quality and smooth, CPU is around 50%. Then after a minute or two there will always be some visible video glitch and CPU utilization will jump up to 90-100% and playback becomes extremely choppy. So I'm guessing Flash hardware acceleration is working initially, then something happens that kills the hardware acceleration, and of course the E-350 CPU is not up the task by itself.
The really strange thing is that it seems to be specific to HBO GO. I can stream HD all day long from Amazon Instant Video and Youtube (at least when Youtube is able to dish it out fast enough). And it's definitely not a bandwidth problem. I have Comcast cable (20Mb down), and a bigger computer I have hooked up to another TV has no problem with HBO GO. I think the same problem happens on the bigger computer, but it's faster CPU can overcome the lack of hardware acceleration.
I've got the latest drivers from AMD and the latest Flash player (even tried the 11 beta) and have tried all the main browsers (FF, IE, Chrome), but it's always the same: 1-2 minutes of perfect playback and moderate CPU utilization, then jacked up CPU and choppy playback.
Unfortunately, there doesn't seem to be any way to contact HBO GO directly about this problem (support links just refer you to your cable provider), so I thought I'd give it a shot here. Is anyone else out there having this problem with HBO GO or any other Flash video sites? Any thoughts on what else I could do to track down the root cause?Well, my idea with 10.x on IE didn't really work. Results were not nearly as good as in Firefox, and I'm not willing to use 10.x in my main browser.
However, based on your insight on the wmode=transparent issue, I started playing around with a Greasemonkey script to force wmode=direct, and I think it actually works. I haven't been able to try it at home yet on the problem PC, but here on my work PC (don't tell anyone I'm not actually working) it makes a massive difference in CPU utilization. Without the script CPU is around 80-90% during video playback. When I enable the script it drops to around 20%. The only issue is that I usually have to refresh the page once video playback starts to get wmode=direct to take effect (start video playback, then once the video playback page loads, hit refresh in the browser).
My script is just a modified version of this one I found:
http://userscripts.org/scripts/show/67260
Here's my modified Greasemonkey script (hopefully the forum will allow javascript in posts):
// ==UserScript==
// @name Force flash wmode direct on HBO GO
// @namespace http://userscripts.org/topics/3090#posts-11620
// @description Force flash video playback on HBO GO to use wmode direct to allow hardware acceleration
// @include http://www.hbogo.com/*/video*
// @grant none
// ==/UserScript==
(function ()
nodeInserted();
document.addEventListener("DOMNodeInserted", nodeInserted, false);
function nodeInserted()
for (var objs = document.getElementsByTagName("object"), i = 0, obj; obj = objs[i]; i++)
if (obj.type == 'application/x-shockwave-flash')
var skip = false;
for (var params = obj.getElementsByTagName("param"), j = 0, param; param = params[j]; j++)
if (param.getAttribute("name") == "wmode")
skip = true;
param.setAttribute("value", "direct");
break;
if(skip) continue;
var param = document.createElement("param");
param.setAttribute("name", "wmode");
param.setAttribute("value", "direct");
obj.appendChild(param); -
Problem with serial.serialize(doc) ;statement
hi this is my code but iam having problem in the aboe statement iam using net beans and it says cannot find symbol serialize while it is still in the package import {com.sun.org.apache.xml.internal.serialize.XMLSerializer;}
package newPack;
import org.jdom.Document;
import org.jdom.JDOMFactory;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
//import org.w3c.dom.Document;
import java.sql.DriverManager;
import javax.xml.parsers.ParserConfigurationException;
import java.sql.ResultSet;
import java.sql.SQLException;
//import org.w3c.dom.Element;
import java.sql.ResultSetMetaData;
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import java.io.StringWriter;
import java.io.IOException;
import org.jdom.Element;
import org.jdom.Document;
public class Conversion {
// public DocumentBuilderFactory dbf;
// public DocumentBuilder dob;
// public Document doc;
/** Creates a new instance of Conversion */
public static Document convert(ResultSet rs) throws ParserConfigurationException,SQLException
// DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
//DocumentBuilder builder=dbf.newDocumentBuilder();
// Document doc=builder.newDocument();
Element root=new Element("Artist");
//doc.appendChild(root);
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
while (rs.next())
Element songo= new Element("song1");
root.addContent(songo);
//root.appendChild(songo);
for (int i = 1; i <= colCount; i++)
String columnName = rsmd.getColumnName(i);
Object value = rs.getObject(i);
Element node = new Element(columnName);
node.setText(value.toString());
songo.addContent(node);
Document doc=new Document(root);
return doc;
public static String serialized(Document doc) throws IOException
StringWriter writer = new StringWriter();
OutputFormat format = new OutputFormat();
format.setIndenting(true);
XMLSerializer serial = new XMLSerializer(writer,format);
serial.serialize(doc);
return writer.getBuffer().toString();
}VISA is the generic communication interface.
Hyperterminal has serial comm drivers as well. It just so happens that Hyperterminal is using the serial comm drivers that are built into Windows. That's why you don't notice them.
If you installed LabVIEW, then you should have installed the drivers that come with it. It is on a separate DVD. Obviously you haven't. -
Ajax problem in IE7 - get.get() is empty
I am testing Ajax under Mozilla Firefox and IE7. Under Firefox is everything fine but IE7 gives me errors.
My process is the following:
declare
l_counter number;
l_o_name varchar2(2000);
begin
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<select>');
htp.prn('<option value="x">x</option>');
htp.prn('</select>');
debug.add('ok');
end;
debug_add('ok') adds text 'ok' into debugging table. I can see that this info is being inserted into the table, so the process runs through.
My JavaScript is in ApEx page attributes "HTML header" section and is like the following:
<script type="text/javascript">
function get_AJAX_SELECT_XML(pThis,pSelect){
var l_Return = null;
var l_Select = html_GetElement(pSelect);
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=my_proc',0);
get.add('GTEST',pThis.value);
alert(get.get());
gReturn = get.get('XML');
if(gReturn && l_Select){
alert('Never here in IE7');
var l_Count = gReturn.getElementsByTagName("option").length;
l_Select.length = 0;
for(var i=0;i<l_Count;i++){
var l_Opt_Xml = gReturn.getElementsByTagName("option");
appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
get = null;
function appendToSelect(pSelect, pValue, pContent) {
var l_Opt = document.createElement("option");
l_Opt.value = pValue;
if(document.all){/* why is ie different ask bill */
pSelect.options.add(l_Opt);
l_Opt.innerText = pContent;
}else{
l_Opt.appendChild(document.createTextNode(pContent));
pSelect.appendChild(l_Opt);
</script>
alert(get.get()); gives me popup with text "undefined" in IE.
So "if(gReturn && l_Select)" will never become true.
I call it in an item:
onchange="get_AJAX_SELECT_XML(this,'P3201_XXX')"
In Mozilla 2.0.0.7 everything works, i can get correct answer from get.get() and the list is being filled with "x".Hi,
I'm having a sporatic problem.
Where do you put the encoding?
Content-type: text/xml; charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache
<?xml version="1.0" encoding="UTF-8"?>
I have the following in my ODP function
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
then I start my select list:
htp.prn('<select>');
htp.prn(ls_default);
and a loop to build the option code -
Get problem in loading the xml code
Hi all,
I have got one problem in program. </method >not get generates after method block.
I want output like this:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
---<name>the name of package</name>
---<className>The name of class</className>
----<methods>
---------<name>the name of the method</name>
---------<returnType>the return type of the method</returnType>
-----</methods>
----<methods>
---------<name>the name of the method22</name>
---------<returnType>the return type of the method22</returnType>
---------</methods>
</interface>
But the output comes like:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
---<name>the name of package</name>
---<className>The name of class</className>
----<methods>
---------<name>the name of the method</name>
---------<returnType>the return type of the method</returnType>
---------<name>the name of the method22</name>
---------<returnType>the return type of the method22</returnType>
---------</methods>
</interface>
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
public class TryXML
public static void main(String args[])
try
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
Document methoddoc = parser.parse(new File("methodinfo.xml"));
Document packageDoc = parser.parse(new File("interface.xml"));
Node packagenameNode = packageDoc.getElementsByTagName("name").item(0);
Node packageclassNode = packageDoc.getElementsByTagName("className").item(0);
Node methodnode = packageDoc.getElementsByTagName("methods").item(0);
packagenameNode.setTextContent("the name of package");
packageclassNode.setTextContent("The name of class");
Node nameNode = methoddoc.getElementsByTagName("name").item(0);
Node returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
nameNode.setTextContent("the name of the method");
returnTypeNode.setTextContent("the return type of the method");
Node node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
// Create the document fragment node to hold the new nodes
DocumentFragment docfrag = packageDoc.createDocumentFragment();
// Move the nodes into the fragment
while (node.hasChildNodes())
docfrag.appendChild(node.removeChild(node.getFirstChild()));
methodnode.appendChild(docfrag);
nameNode.setTextContent("the name of the method22");
returnTypeNode.setTextContent("the return type of the method22");
node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
// Create the document fragment node to hold the new nodes
docfrag = packageDoc.createDocumentFragment();
// Move the nodes into the fragment
while (node.hasChildNodes())
docfrag.appendChild(node.removeChild(node.getFirstChild()));
methodnode.appendChild(docfrag);
DOMSource source = new DOMSource(packageDoc);
StreamResult result = new StreamResult(System.out);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
System.out.println("This is the content of the XML document:\n");
transformer.transform(source, result);
catch (Exception e)
Please help me.
Thanks
buntyReplace the following line:methodnode.appendChild(docfrag);with these lines:Node methodnode2 = packageDoc.createElement("methods");
packageDoc.getDocumentElement().appendChild(methodnode2);
methodnode2.appendChild(docfrag);The problem was that you omitted to create a new <methods> element for the document fragment to be inserted in, so it got inserted in the original <methods> element. -
Hi All,
Because of your help I am doing small application and I am new in xml I gets small small problem and by the your help i cam solve it.
Now i have last problem when i solve it then my tool gets complete. I have attached small code of it and its working. The problem is when i fill one methods parameter information its comes in all methods. Which is wrong.
I want output like:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<name>the name of package</name>
<className>The name of class</className>
<methods>
<name>the name of the method</name>
<invokeKind/>
<returnType>the return type of the method</returnType>
<optionalParameters/>
<parameters>
<name>Param1</name>
<type>Void</type>
</parameters>
</methods>
<methods>
<name>the name of the method22</name>
<returnType>the return type of the method22</returnType>
<parameters/>
</methods>
</interface>But output comes like
<?xml version="1.0" encoding="UTF-8"?><interface>
<name>the name of package</name>
<className>The name of class</className>
<methods>
<name>the name of the method</name>
<invokeKind/>
<returnType>the return type of the method</returnType>
<optionalParameters/>
<parameters>
<name>Param1</name>
<type>Void</type>
</parameters>
</methods>
<methods>
<name>the name of the method22</name>
<returnType>the return type of the method22</returnType>
<parameters>
<name>Param1</name>
<type>Void</type>
</parameters>
</methods>
</interface>
I have not given parameter in second method but given in first method but replicates in second thats y i am stucked,
Please help me.
Code is ::
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
public class TryXML
public static void main(String args[])
try
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
Document methoddoc = parser.parse(new File("methodinfo.xml"));
Document packageDoc = parser.parse(new File("interface.xml"));
//***Package information
Node packagenameNode = packageDoc.getElementsByTagName("name").item(0);
Node packageclassNode = packageDoc.getElementsByTagName("className").item(0);
packagenameNode.setTextContent("the name of package");
packageclassNode.setTextContent("The name of class");
//***First method information
Node nameNode = methoddoc.getElementsByTagName("name").item(0);
Node returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
nameNode.setTextContent("the name of the method");
returnTypeNode.setTextContent("the return type of the method");
//**Parameter Informtion of this method.
Document parameterDoc = parser.parse(new File("parameter.xml"));
Node paramnameNode = parameterDoc.getElementsByTagName("name").item(0);
Node paramreturnTypeNode = parameterDoc.getElementsByTagName("type").item(0);
paramnameNode.setTextContent("Param1");
paramreturnTypeNode.setTextContent("Void");
//***adding parameter information into method.
Node methodaddnode = methoddoc.importNode(parameterDoc.getDocumentElement(), true);
DocumentFragment docfrag = methoddoc.createDocumentFragment();
//***Move the nodes into the fragment
while (methodaddnode.hasChildNodes())
docfrag.appendChild(methodaddnode.removeChild(methodaddnode.getFirstChild()));
Node paramNode = methoddoc.createElement("parameters");
methoddoc.getDocumentElement().appendChild(paramNode);
paramNode.appendChild(docfrag);
//***adding first methode's information into package.
Node node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
docfrag = packageDoc.createDocumentFragment();
while (node.hasChildNodes())
docfrag.appendChild(node.removeChild(node.getFirstChild()));
Node methodnode = packageDoc.createElement("methods");
packageDoc.getDocumentElement().appendChild(methodnode);
methodnode.appendChild(docfrag);
//***adding second methode's information into package.
nameNode.setTextContent("the name of the method22");
returnTypeNode.setTextContent("the return type of the method22");
node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
docfrag = packageDoc.createDocumentFragment();
while (node.hasChildNodes())
docfrag.appendChild(node.removeChild(node.getFirstChild()));
Node methodnode2 = packageDoc.createElement("methods");
packageDoc.getDocumentElement().appendChild(methodnode2);
methodnode2.appendChild(docfrag);
//**Display
DOMSource source = new DOMSource(packageDoc);
StreamResult result = new StreamResult(System.out);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
System.out.println("This is the content of the XML document:\n");
transformer.transform(source, result);
catch (Exception e)
}regards
-buntymy problem was, if i dont have parameters for second method then also parameters of first methods comes into 2nd method. I think its headache for me.
Parmeter.xml:
<parameter>
<name></name>
<type></type>
</parameter>Method.xml
<method>
<name></name>
<returnType></returnType>
<parameters>
</parameters>
</method>So my quetion is, I have put whole parameter.xml into method.xml's parameter node. In previous post u said refresh it. How can i refresh it ? not get this point .
Code is :
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class TryXML
public static void main(String args[])
try
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
Document methoddoc = parser.parse(new File("method.xml"));
Document packageDoc = parser.parse(new File("interface.xml"));
Document parmerterDoc=parser.parse(new File("parameter.xml"));
//***Package information
Node packagenameNode = packageDoc.getElementsByTagName("name").item(0);
Node packageclassNode = packageDoc.getElementsByTagName("className").item(0);
packagenameNode.setTextContent("package1");
packageclassNode.setTextContent("class1");
//***First method information
Node nameNode = methoddoc.getElementsByTagName("name").item(0);
Node returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
nameNode.setTextContent("method1");
returnTypeNode.setTextContent("int");
//**Parameter Informtion of this method.
Node paramnameNode = parmerterDoc.getElementsByTagName("name").item(0);
Node paramreturnTypeNode = parmerterDoc.getElementsByTagName("type").item(0);
paramnameNode.setTextContent("Param1");
paramreturnTypeNode.setTextContent("Void");
NodeList list = parmerterDoc.getElementsByTagName("parameter");
Element element = (Element)list.item(0);
NodeList list1 = methoddoc.getElementsByTagName("parameters");
Element element1 = (Element)list1.item(0);
// Make a copy of the element subtree suitable for inserting into doc2
Node dup = methoddoc.importNode(element, true);
// Insert the copy into doc2
element1.appendChild(dup);
NodeList methodlist = methoddoc.getElementsByTagName("method");
Element methodelement = (Element)methodlist.item(0);
NodeList methodlist1 = packageDoc.getElementsByTagName("methods");
Element methodelement1 = (Element)methodlist1.item(0);
// Make a copy of the element subtree suitable for inserting into doc2
Node methoddup = packageDoc.importNode(methodelement, true);
// Insert the copy into doc2
methodelement1.appendChild(methoddup);
// ***Second method information
nameNode = methoddoc.getElementsByTagName("name").item(0);
returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
nameNode.setTextContent("method2");
returnTypeNode.setTextContent("short");
//**Parameter Informtion of this method.
methodlist = methoddoc.getElementsByTagName("method");
methodelement = (Element)methodlist.item(0);
methodlist1 = packageDoc.getElementsByTagName("methods");
methodelement1 = (Element)methodlist1.item(0);
// Make a copy of the element subtree suitable for inserting into doc2
methoddup = packageDoc.importNode(methodelement, true);
// Insert the copy into doc2
methodelement1.appendChild(methoddup);
//**Display
DOMSource source = new DOMSource(packageDoc);
StreamResult result = new StreamResult(System.out);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
System.out.println("This is the content of the XML document:\n");
transformer.transform(source, result);
catch (Exception e)
e.printStackTrace();
}Message was edited by:
bunty_barge -
Problems with transforming special characters
Hi,
I develop a small educational application ( http://sourceforge.net/projects/pauker/ ). I work with JDK-1.4.0 on Mandrake Linux 8.2. At first I used serialized objects to save the lessons to a file. This worked well until I wanted to change some public members of the involved classes. That's why I switched over to the new and shiny XML. Now I have a different problem!
Pauker saves its lessons in gziped XML files. Users from all over the world can create lessons containing very different characters. There are European characters like ������� and asian characters. Loading this lessons on a system with a different encoding works fine. Saving such a lesson on a system with a different encoding can destroy the lesson.
Example:
On a german system a user creates a lesson with the letter � on a card side and saves it. A different user working on an english system loads this lesson. The character "�" is displayed correctly. The english user saves the lesson. The character "�" will be replaced by a question mark in the xml file. Next time the english user loads the lesson she will not see "�" but "?" on the display.
Here is a little example program that does the transformation in exactly the way Pauker does. Please test it out.
import java.io.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
import org.w3c.dom.*;
public class XMLTest {
public XMLTest() {
try {
// create document
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document document = documentBuilder.newDocument();
// fill document
Element element = document.createElement("Element");
document.appendChild(element);
element.appendChild(document.createTextNode("�������"));
// transform to XML
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
//transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
DOMSource source = new DOMSource(document);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
StreamResult result = new StreamResult(outputStream);
transformer.transform(source, result);
System.out.println("original: �������");
System.out.println(outputStream.toString());
} catch (Exception e) {
e.printStackTrace();
System.out.println();
public static void main(String[] args) {
new XMLTest();
So what do I have to do to fix this problem? I have a lot of new features waiting in the CVS but this bug is still open and discussed. I dont want to release a new version with such a gaping hole in it...
Thanks a lot!
If you prefer to reply peronally, please use Ronny.Standtke at gmx.deI don't see how you can say that there's a problem with saving your XML files when the code you post doesn't actually save it to a file. Your transform is being written to a ByteArrayOutputStream, which isn't used except for this statement which I assume is for debugging:System.out.println(outputStream.toString());Of course that is useless for debugging the problem you describe, for two reasons:
1. the toString() method uses your system's default encoding, which may be ISO-8859-1 but is definitely not UTF-8. You could write toString("UTF-8") but that is a waste of time because:
2. You use System.out.println() to examine the data, which writes it to a console that also probably does not use UTF-8. I don't know what encoding it does use, but UTF-8 is unlikely.
So, save your files using the UTF-8 encoding as robadmin suggested. And to test the result, make sure you use a tool that understands the UTF-8 encoding. -
AppendChild doesn't work correctly?
I've got an xml file:
<filmlist>
<user num="1">
<film>clip02.flv</film>
<film>clip01.flv</film>
</user>
<user num="2">
<film>clip02.flv</film>
<film>clip01.flv</film>
</user>
</filmlist>
At the start I read this file, count the number of 'user' tags and want to add a next 'user' tag to it, so it should look like this:
<filmlist>
<user num="1">
<film>clip02.flv</film>
<film>clip01.flv</film>
</user>
<user num="2">
<film>clip02.flv</film>
<film>clip01.flv</film>
</user>
<user num="3">
<film>clip02.flv</film>
<film>clip01.flv</film>
<film>clip01.flv</film>
</user>
</filmlist>
To do this I use:
var loadedXML:XML = new XML(event.target.data);
newUser = loadedXML.user.length() + 1;
var str:String = "<user num='" + (newUser ) + "'>\n";
for (var s:int=0; s<selectedMovies.length; s++)
str += "<film>" + selectedMovies[s] + "</film>\n";
str += "</user>";
loadedXML.appendChild(new XML(str));
xmlToSend = new XML(loadedXML);
The xmlToSend object I send to my php script:
<?php
if (isset($GLOBALS["HTTP_RAW_POST_DATA"])){
$data = $GLOBALS["HTTP_RAW_POST_DATA"];
$file = fopen("filmpjes.xml", "w");
fwrite($file, $data);
fclose($file);
if (!$file) {
echo("<stuff>Server unable to create file.</stuff>");
} else {
echo("<stuff>File saved.</stuff>");
} ?>
The weird thing is, when I trace xmlToSend right before accessing my php script it traces correctly:
<filmlist>
<user num="1">
<film>clip02.flv</film>
<film>clip01.flv</film>
</user>
<user num="2">
<film>clip02.flv</film>
<film>clip01.flv</film>
</user>
<user num="3">
<film>clip02.flv</film>
<film>clip01.flv</film>
<film>clip01.flv</film>
</user>
</filmlist>
When the php script saves the new xml file however, appendChild doesn't seem to have worked ok. Instead of adding a next 'user' tag' it has replace the last one (2) with the new, so it looks like this.
<filmlist>
<user num="1">
<film>clip02.flv</film>
<film>clip01.flv</film>
</user>
<user num="2">
<film>clip02.flv</film>
<film>clip01.flv</film>
<film>clip01.flv</film>
</user>
</filmlist>
Have I done something wrong with appendChild? Which makes it look ok when I trace the xmlToSend XML object, but writes it with always the last node replaced by the new instead of adding a node???Found this on actionscript.org about similar cache problems with xml files:
Put some random number after URL. Example:
var request:URLRequest = new URLRequest("http://www.site.com/page.html?rand="+Math.random()*1000);
And now my online version works too Is this a bug regarding cache and URLRequest? Anyone heard of this?
Maybe you are looking for
-
How to fetch KM folder owner by java API in JSPDynpage
Hi All, we have an application accessing KM folders using KM APIs, using some of them we could get folder name created bye, modified by etc. but to fetch the owner of the folder (specified in the properties-->mislenous) we couldn't fined any method.
-
Can I put that really bitter, sour dog spray that makes dogs go away on the top of my MacBook air surface? Please reply quick first good reply gets best answer
-
Forms Takes TOOOOOO Long to Load
Hi all, I am having a form containing a tabbed canvas consisting of 7 tab pages.There are approximately 8 blocks containing nearly 300 items in total(mainly display items and buttons and no image items) and nearly 10 form level program units and 2 li
-
I need help with some technical YouTube Settings, third party tools page
How can I add ios mobile Safari, back to my google + third-party tools page? I updated my ipad 2 to ios7 and could no longer upload videos to youtube for my blog. YouTube had been saying unrecognized file type because it's not longer compatible wit
-
Update Itemcost from the Production order.
Hi Experts, I have created a UDF(Amount) in the Production order rows, if iam entering the amount for the input item the Amount should get updated in the Itemcost of the Itemmaster data.. How to write the update statement? Is it possible to update th