By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,472 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,472 IT Pros & Developers. It's quick & easy.

IE code is Not compatible with firefox

P: 28
plzzz help me............
Jun 19 '07 #1
Share this Question
Share on Google+
8 Replies


P: 28
This is my javascript


what i want to change in this plz help me...............



<script language="javascript">
var head="display:''"
img1=new Image()
img1.src="";
img2=new Image()
img2.src=""
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1
var ff4=document.getElementById&&!document.all

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage=""
} else {
foldercontent.style.display="none"
cur.style.listStyleImage=""
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

</script>
Jun 19 '07 #2

10K+
P: 13,264
1.) Please use code tags when posting code
2.) Post Javascript questions in the Javascript forum not in the Java forum (the two languages are very different)
3.) Which part of your code is not working?
Jun 19 '07 #3

10K+
P: 13,264
plzzz help me............
Please read the posting guidelines. Your question is too vague for you to get any reasonable answers.
Jun 19 '07 #4

P: 28
<script language="javascript">
var head="display:''"
img1=new Image()
img1.src="";
img2=new Image()
img2.src=""
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1
var ff4=document.getElementById&&!document.all

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){// this is the error code which my browser is showing
foldercontent.style.display=""
cur.style.listStyleImage=""
} else {
foldercontent.style.display="none"
cur.style.listStyleImage=""
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

</script>
Jun 19 '07 #5

P: 28
hallo


when ever i click my leftmenu.jsp i geting the errorconsole

like this .


Error: foldercontent has no properties
Source File: http://10.1.2.28:8080/ILICTreasury/banker-web/banker-displayTxLeftSideMenu.do
Line: 76

in line 76
Expand|Select|Wrap|Line Numbers
  1.  
  2. if (iscontained){
  3.             var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
  4.             if (foldercontent.style.display=="none")
  5.                         {
  6.             foldercontent.style.display=""
  7.             cur.style.listStyleImage=""
  8.             } else {
  9.             foldercontent.style.display="none"
  10.             cur.style.listStyleImage=""
  11.             }
  12.         }
  13.  
  14.  
Jun 19 '07 #6

acoder
Expert Mod 15k+
P: 16,027
Threads merged. Please keep all posts on the same topic/problem in one thread.
Jun 19 '07 #7

P: 28
hi


iam sending my leftmenu .jsp this is some times working some times its not working iam using Firefox2.0 why its not working, the browser page
error console shows some error that one is


Error: foldercontent has no properties
Source File: http://10.1.2.28:8080/ILICTreasury/banker-web/banker-displayTxLeftSideMenu.do
Line: 47

my jsp is
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <style>
  4.  
  5. .foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
  6. list-style-image:url(fold.gif)}
  7. .foldinglist{list-style-image:url(list.gif)}
  8. </style>
  9. <script language="JavaScript" type="text/javascript">
  10.  
  11.  
  12. //Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
  13. //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
  14. //This credit MUST stay intact for use
  15.  
  16. var head="display:''"
  17. img1=new Image()
  18. img1.src="fold.gif"
  19. img2=new Image()
  20. img2.src="open.gif"
  21.  
  22. var ns6=document.getElementById&&!document.all
  23. var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
  24.  
  25. function checkcontained(e){
  26. var iscontained=0
  27. cur=ns6? e.target : event.srcElement
  28. i=0
  29.  
  30. if (cur.getAttribute("class")=="foldheader"){
  31. iscontained=1
  32. }
  33. else
  34. while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
  35. if (cur.getAttribute("class")=="foldheader"||cur.getAttribute("class")=="foldinglist"){
  36. iscontained=(cur.getAttribute("class")=="foldheader")? 1 : 0
  37. break
  38. }
  39. cur=ns6? cur.parentNode : cur.parentElement
  40. }
  41.  
  42.  
  43. if (iscontained){
  44. var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
  45.  
  46. if (foldercontent.style.display=="none"){ error shows on here 
  47. var ar = document.getElementsByTagName("ul")
  48.  
  49. for (var i=0; i<ar.length; i++){
  50.  
  51. if (ar[i].getAttribute("class")=="foldinglist" && (ar[i].id==foldercontent.id) ){ 
  52. ar[i].style.display = "none";
  53. }
  54.  
  55. foldercontent.style.display=""
  56. cur.style.listStyleImage="url(open.gif)"
  57. }
  58. else{
  59. foldercontent.style.display="none"
  60. cur.style.listStyleImage="url(fold.gif)"
  61. }
  62.  
  63. }//if
  64. }
  65.  
  66. if (ie4||ns6)
  67. document.onclick=checkcontained
  68.  
  69.  
  70. </script>
  71.  
  72. <body>
  73. <font face="Verdana">
  74.  
  75.  
  76. <div id="masterdiv">
  77.  
  78.  
  79.  
  80. <ul>
  81.  
  82. <li class="foldheader">News</li>
  83.  
  84. <ul id="1" class="foldinglist" style="display:none" style=&{head};>
  85. <li><a href="http://www.cnn.com">CNN</a></li>
  86. <li><a href="http://www.abcnews.com">ABC News</a></li>
  87. <li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
  88. <li class="foldheader">Other News</li>
  89. <ul id="2" class="foldinglist" style="display:none" style=&{head};>
  90. <li><a href="http://www.bbc.com">BBC</a></li>
  91. <li><a href="http://www.cnn.com">CNN</a></li>
  92. </ul>
  93. </ul>    
  94.   <li class="foldheader">TREASURY</li>  
  95.          <ul id="foldinglist" class="foldheader" style="display:none" style="&amp{head};">
  96.                          <li id="foldheader" class="foldheader">MAINTENANCE</li>
  97.                          <ul id="foldinglist" class="foldinglist" style="display:none" style="&amp{head};">
  98.  
  99.                          <li class="style5">
  100.                             <a href="X30.do?action=init" target="displayarea" class="style5">Counterparty Maintenance</a>
  101.                      </li>   
  102.                          <li class="style5">
  103.                             <a href="X31.do?action=init" target="displayarea" class="style5">Agent Bank Maintenance</a>
  104.                      </li>  
  105.                          <li class="style5">
  106.                             <a href="X32.do?action=init" target="displayarea" class="style5">Broker File Maintenance</a>
  107.                      </li>  
  108.                           <li class="style5">
  109.                             <a href="X33.do?action=init" target="displayarea" class="style5">Dealer Maintenance</a>
  110.                      </li> 
  111.               <li class="style5">
  112.                             <a href="X51.do?action=init" target="displayarea" class="style5">Counterparty Dealer Signatory Limit Maintenance</a>
  113.           </li> 
  114.                          <li class="style5">
  115.                             <a href="X52.do?action=init" target="displayarea" class="style5">Agent Bank Relation Maintenance</a>
  116.                          </li>
  117.                          <li class="style5">
  118.                             <a href="X53.do?action=init" target="displayarea" class="style5">Counterparty Contact Maintenance</a>
  119.                          </li>
  120.                          <li class="style5">
  121.                             <a href="X54.do?action=init" target="displayarea" class="style5">Signatory Maintenance</a>
  122.                          </li>
  123.  
  124.         </ul>
  125.  
  126.  
  127. </ul>
  128.  
  129. <li class="foldheader">Stuff</li>
  130. <ul id="1" class="foldinglist" style="display:none" style=&{head};>
  131. <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
  132. <li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
  133. <li><a href="http://www.freewarejava.com">Freewarejava.com</a></li>
  134. </ul>
  135.  
  136. <li class="foldheader">Link list</li>
  137. <ul id="1" class="foldinglist" style="display:none" style=&{head};>
  138. <li><a href="http://www.dynamicdrive.com">outer 1</a></li>
  139. <li><a href="http://www.dynamicdrive.com">outer 2</a></li>
  140.  
  141. <li class="foldheader">Television</li>
  142. <ul id="2" class="foldinglist" style="display:none" style=&{head};>
  143. <li><a href="http://www.dynamicdrive.com">nested 1</a></li>
  144. <li><a href="http://www.dynamicdrive.com">nested 2</a></li>
  145. </ul>
  146. <li class="foldheader">Video</li>
  147. <ul id="2" class="foldinglist" style="display:none" style=&{head};>
  148. <li><a href="http://www.dynamicdrive.com">nested 1</a></li>
  149. <li><a href="http://www.dynamicdrive.com">nested 2</a></li>
  150. </ul>
  151. <li><a href="http://www.dynamicdrive.com">outer 3</a></li>
  152.  
  153. <li><a href="http://www.dynamicdrive.com">outer 4</a></li>
  154. </ul>
  155.  
  156. </ul>
  157.  
  158.  
  159. </div>
  160.  
  161.  
  162.  
  163. </font>
  164.  
  165.  
  166. </body>
  167. </html>
  168.  
  169.  
Jun 20 '07 #8

acoder
Expert Mod 15k+
P: 16,027
Merged yet another thread.
Jun 20 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.