Outline JS error from Frontpage

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Feb 2008
Posts: 3
Reputation: zipperzz is an unknown quantity at this point 
Solved Threads: 0
zipperzz zipperzz is offline Offline
Newbie Poster

Outline JS error from Frontpage

 
0
  #1
Feb 18th, 2008
Hi everybody, I have been trying to use MS Frontpage 2003 and the feature for allowing a bullet list to be created and then subsequently to be enabled with the collapse ability. I have followed the help in Frontpage and in the MS tech site but keep receiving an error against the javascript created from within the Frontpage web page creation process. I have googled the message ("an error has occurred in this script on this page") which got me to this site. I will include the javascript below that causes the error, BTW, I have registered DLLs, disabled javascript debuggers etc. Nothing has solved this problem and I now get a message prompting me to debug the script. I have narrowed this down to the script itself. Here it is: Hope I do this as prescribed! One last note, this seems to be something with the 1st line of code??

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!--
  2. // See KB article about changing this dynamic HTML
  3. function getControlTag(src)
  4. {
  5. TRok = false
  6. while ("HTML" != src.tagName)
  7. {
  8. if ("IMG" == src.tagName || "FONT" == src.tagName || "A" == src.tagName || "TD" == src.tagName)
  9. TRok = true
  10. if ("LI" == src.tagName)
  11. return src
  12. if ("TR" == src.tagName)
  13. {
  14. if(TRok)
  15. return src
  16. return null
  17. }
  18. src = src.parentElement
  19. }
  20. return null
  21. }
  22. function dynOutlineEnabled(src)
  23. {
  24. while ("BODY" != src.tagName)
  25. {
  26. table = "TABLE" == src.tagName;
  27. if(table && src.getAttribute("border", false) != "0")
  28. return false;
  29. if("OL" == src.tagName || "UL" == src.tagName || table)
  30. {
  31. if(null != src.getAttribute("nodynamicoutline", false))
  32. return false
  33. if(null != src.getAttribute("dynamicoutline", false))
  34. return true
  35. if(mac > 0)
  36. {
  37. var at = src.outerHTML.indexOf("dynamicoutline")
  38. if(at > 0)
  39. {
  40. var gt = src.outerHTML.indexOf(">")
  41. if(at < gt)
  42. return true
  43. }
  44. }
  45. }
  46. src = src.parentElement
  47. }
  48. return false
  49. }
  50. function initCollapse(src)
  51. {
  52. while ("BODY" != src.tagName)
  53. {
  54. table = "TABLE" == src.tagName;
  55. if(table && src.getAttribute("border", false) != "0")
  56. return false;
  57. if("OL" == src.tagName || "UL" == src.tagName || table)
  58. {
  59. if(null != src.getAttribute("initcollapsed", false))
  60. return true
  61. }
  62. src = src.parentElement
  63. }
  64. return false
  65. }
  66. function containedIn(src, dest)
  67. {
  68. if ("!" == src.tagName)
  69. return true
  70. src = getControlTag(src)
  71. if (src == dest)
  72. return true
  73. return false
  74. }
  75. function initOutline()
  76. {
  77. var ms = navigator.appVersion.indexOf("MSIE");
  78. mac = navigator.appVersion.indexOf("Macintosh");
  79. ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
  80. if(!ie4)
  81. return;
  82. listTags = new Array()
  83. listTags[0]="UL"
  84. listTags[1]="OL"
  85. listTags[2]="TABLE"
  86. for(j=0;j<listTags.length;j++)
  87. {
  88. tagName=listTags[j]
  89. coll=document.all.tags(tagName)
  90. for(i=0; i<coll.length; i++)
  91. {
  92. if(dynOutlineEnabled(coll[i].parentElement))
  93. {
  94. if(initCollapse(coll[i]))
  95. coll[i].style.display="none"
  96. }
  97. }
  98. }
  99. }
  100. function dynOutline()
  101. {
  102. var ms = navigator.appVersion.indexOf("MSIE");
  103. ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
  104. if(!ie4)
  105. return;
  106. var src = event.srcElement
  107. src = getControlTag(src)
  108. if (null == src)
  109. return
  110. if (!dynOutlineEnabled(src))
  111. return
  112. var idx = src.sourceIndex+1
  113. while (idx < document.all.length && containedIn(document.all[idx], src))
  114. {
  115. srcTmp = document.all[idx]
  116. tag = srcTmp.tagName
  117. if ("UL" == tag || "OL" == tag || "TABLE" == tag)
  118. srcTmp.style.display = srcTmp.style.display == "none" ? "" : "none"
  119. idx++;
  120. }
  121. }
  122. //-->

Thanks for any help I can receive on this

ZipperZZ
Last edited by MattEvans; Feb 18th, 2008 at 7:02 am. Reason: fixed code end tag
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 483
Reputation: DangerDev has a spectacular aura about DangerDev has a spectacular aura about 
Solved Threads: 58
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Pro in Training

Re: Outline JS error from Frontpage

 
0
  #2
Feb 18th, 2008
[\Code]
use [/code]

can you give complete code along with html code, so that i could understand whats going on ?
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 3
Reputation: zipperzz is an unknown quantity at this point 
Solved Threads: 0
zipperzz zipperzz is offline Offline
Newbie Poster

Re: Outline JS error from Frontpage

 
0
  #3
Feb 18th, 2008
I gave you the complete JS but will give it again along with the html. I will list the HTML first then the JS. Thanks NOTE: The JS was generated by MS Frontpage 2003 when I chose BULLETS AND NUMBERS under the FORMAT menu, then tried both NUMBERS (list) and BULLETS (list) where I checked the box to ENABLE COLLAPSIBLE OUTLINES, I then keyed in a list and when I tried to PREVIEW

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2.  
  3. <head>
  4. <meta http-equiv="Content-Language" content="en-us">
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  6. <script language="JavaScript" fptype="dynamicoutline">
  7. <!--
  8. function dynOutline() {}
  9. //-->
  10. </script>
  11. <script language="JavaScript1.2" fptype="dynamicoutline" src="outline.js">
  12. </script>
  13. <script language="JavaScript1.2" fptype="dynamicoutline" for="document" event="onreadystatechange()">
  14. <!--
  15. initOutline()
  16. //-->
  17. </script>
  18. </head>
  19.  
  20. <body onclick="dynOutline()" language="Javascript1.2">
  21.  
  22. <p><img border="0" src="Ext01.JPG" width="568" height="426"></p>
  23. <ol dynamicoutline>
  24. <li>Description</li>
  25. <li>2004 Ford F150 Lariat Super Crew Cab</li>
  26. <li>Four Wheel Drive</li>
  27. <li>Less than 11,000 original miles</li>
  28. <li>5.4L Triton V8 Motor</li>
  29. <li>Automatic Transmission with Lariat console mounted shifter</li>
  30. </ol>
  31. <p>&nbsp;</p>
  32.  
  33. </body>
  34.  
  35. </html>

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!--
  2. // See KB article about changing this dynamic HTML
  3. function getControlTag(src)
  4. {
  5. TRok = false
  6. while ("HTML" != src.tagName)
  7. {
  8. if ("IMG" == src.tagName || "FONT" == src.tagName || "A" == src.tagName || "TD" == src.tagName)
  9. TRok = true
  10. if ("LI" == src.tagName)
  11. return src
  12. if ("TR" == src.tagName)
  13. {
  14. if(TRok)
  15. return src
  16. return null
  17. }
  18. src = src.parentElement
  19. }
  20. return null
  21. }
  22. function dynOutlineEnabled(src)
  23. {
  24. while ("BODY" != src.tagName)
  25. {
  26. table = "TABLE" == src.tagName;
  27. if(table && src.getAttribute("border", false) != "0")
  28. return false;
  29. if("OL" == src.tagName || "UL" == src.tagName || table)
  30. {
  31. if(null != src.getAttribute("nodynamicoutline", false))
  32. return false
  33. if(null != src.getAttribute("dynamicoutline", false))
  34. return true
  35. if(mac > 0)
  36. {
  37. var at = src.outerHTML.indexOf("dynamicoutline")
  38. if(at > 0)
  39. {
  40. var gt = src.outerHTML.indexOf(">")
  41. if(at < gt)
  42. return true
  43. }
  44. }
  45. }
  46. src = src.parentElement
  47. }
  48. return false
  49. }
  50. function initCollapse(src)
  51. {
  52. while ("BODY" != src.tagName)
  53. {
  54. table = "TABLE" == src.tagName;
  55. if(table && src.getAttribute("border", false) != "0")
  56. return false;
  57. if("OL" == src.tagName || "UL" == src.tagName || table)
  58. {
  59. if(null != src.getAttribute("initcollapsed", false))
  60. return true
  61. }
  62. src = src.parentElement
  63. }
  64. return false
  65. }
  66. function containedIn(src, dest)
  67. {
  68. if ("!" == src.tagName)
  69. return true
  70. src = getControlTag(src)
  71. if (src == dest)
  72. return true
  73. return false
  74. }
  75. function initOutline()
  76. {
  77. var ms = navigator.appVersion.indexOf("MSIE");
  78. mac = navigator.appVersion.indexOf("Macintosh");
  79. ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
  80. if(!ie4)
  81. return;
  82. listTags = new Array()
  83. listTags[0]="UL"
  84. listTags[1]="OL"
  85. listTags[2]="TABLE"
  86. for(j=0;j<listTags.length;j++)
  87. {
  88. tagName=listTags[j]
  89. coll=document.all.tags(tagName)
  90. for(i=0; i<coll.length; i++)
  91. {
  92. if(dynOutlineEnabled(coll[i].parentElement))
  93. {
  94. if(initCollapse(coll[i]))
  95. coll[i].style.display="none"
  96. }
  97. }
  98. }
  99. }
  100. function dynOutline()
  101. {
  102. var ms = navigator.appVersion.indexOf("MSIE");
  103. ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
  104. if(!ie4)
  105. return;
  106. var src = event.srcElement
  107. src = getControlTag(src)
  108. if (null == src)
  109. return
  110. if (!dynOutlineEnabled(src))
  111. return
  112. var idx = src.sourceIndex+1
  113. while (idx < document.all.length && containedIn(document.all[idx], src))
  114. {
  115. srcTmp = document.all[idx]
  116. tag = srcTmp.tagName
  117. if ("UL" == tag || "OL" == tag || "TABLE" == tag)
  118. srcTmp.style.display = srcTmp.style.display == "none" ? "" : "none"
  119. idx++;
  120. }
  121. }
  122. //-->
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 3
Reputation: zipperzz is an unknown quantity at this point 
Solved Threads: 0
zipperzz zipperzz is offline Offline
Newbie Poster

Re: Outline JS error from Frontpage

 
0
  #4
Feb 18th, 2008
Sorry hit wrong key and the post was sent. Anyway when I tried to PREVIEW my list so that I could see if it was collapsible I kept getting the JS errors. I then went to Google and tried what others had posted to try regarding the JS errors. There are other JS's that execute on my machine and seem to do so OK except they now prompt me to RUN DEBUG whenever they run. Again, thanks.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 483
Reputation: DangerDev has a spectacular aura about DangerDev has a spectacular aura about 
Solved Threads: 58
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Pro in Training

Re: Outline JS error from Frontpage

 
0
  #5
Feb 18th, 2008
i am not getting any problem in IE or Firefox
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC