Results 1 to 5 of 5

Thread: Contractible Headers Script - Permission Denied Error

  1. #1
    Join Date
    Nov 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Contractible Headers Script - Permission Denied Error

    Script Title: Contractible Headers Script

    Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/navigate2.htm

    Greetings Everyone,

    I am hoping someone can explain or point me in the right direction as to why I am seeing this permission denied error message. This message only appears on the initial page load in a new browser session of IE 6 in XP SP2.

    Trying to rule options out, I checked a W2K computer with IE 6SP1 and there was no issue. I checked another XP SP2 computer running the same version of IE as me. No issue.

    So it appears that the problem is with the browser on my computer.
    I changed around some local security settings, and other options and still the same problem.

    I hope that someone may have a quick answer for me on how to correct this problem.

    The message I see in IE is as follows.

    Line: 102
    Char: 1
    Error: Permissions denied
    Code: 0
    URL: http://internal website....

    Line 102 of the code is:

    uniqueidn=window.location.pathname+"firsttimeload"

    In the section:
    ********************************************************
    function do_onload(){
    uniqueidn=window.location.pathname+"firsttimeload"
    getElementbyClass("vnavsub")
    if (enablepersist=="on" && typeof ccollect!="undefined"){
    document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
    firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
    if (!firsttimeload)
    revivecontent()
    }
    ********************************************************
    }

    The code is an exact copy from the DD website.

    Any help would greatly be appreciated.

    Thanks in advance for your time and help.

    NTSsupport

  2. #2
    Join Date
    Nov 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Contractible Headers Script - Permission Denied Error

    Update:

    When the initial error message displays on the screen and I click ok and proceed to see if the script will still work I get another error message.

    Line: 62
    Char: 1
    Error: 'ccollect' is undefined
    Code: 0
    URL: http://internal site....

    Here is the code around line 62. Line 62 is in bold.

    function expandcontent(curobj, cid){
    var spantags=curobj.getElementsByTagName("SPAN")
    var showstateobj=getElementbyClass(spantags, "showstate")
    if (ccollect.length>0){
    if (collapseprevious=="yes")
    contractcontent(cid)
    document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
    if (showstateobj.length>0){ //if "showstate" span exists in header
    if (collapseprevious=="no")
    showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
    else
    revivestatus()
    }
    }
    }

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's quite likely that the problem will go away once you upload the script to a webserver.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Nov 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Contractible Headers Script - Permission Denied Error

    Update:

    Just for a test I took off my style sheet to the page and now the error is gone. If I reapply the CSS, then the error comes back.

    I see at the beginning of the javascript code that there is the switchcontent set to dispay: none

    Could someone please see if I have some code that would conflict with the javascript or other parts of the code?

    Below is what I am using in the body of the page.
    Below that is the CSS I am using.
    Again, the javascript is exactly copied from the DD website.

    Code:
    <body>
    
    <div onClick="expandcontent(this, 'sc1')" class="vnavhead">Menu 1</div>
    	<div id="sc1" class="switchcontent">
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>							
    	</div>
    
    <div onclick="expandcontent(this, 'sc2')" class="vnavhead">Menu 2</div>
    	<div id="sc2" class="switchcontent">
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>							
    	</div>				
    
    <div onclick="expandcontent(this, 'sc3')" class="vnavhead">Menu 3</div>
    	<div id="sc3" class="switchcontent">
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>
    		<p><a href="#">Test</a></p>							
    	</div>	
    
    
    </body>
    Code:
    .vnavhead {
    	background-color: #006;
    	padding: 5px;
    	margin-bottom: 2px;
    	color: #fff;
    	cursor: pointer;
    	width: 190px;
    }
    
    .switchcontent {
    	border: 1px solid #006;
    	margin-bottom: 2px;
    	padding: 5px 10px;
    }

    Thanks again for the help.

  5. #5
    Join Date
    Nov 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Contractible Headers Script - Permission Denied Error

    Twey,

    Thank you for your reply.

    The pages are just for an internal website. The test pages I am working on have been uploaded.

    It seems that the problem is only see on my computer and no other computer that can view the site on a mix of platforms and same IE version. Again when the CSS is not applied the error goes away when I view it from the server. When I reapply the css the error comes back.

    With the CSS on, others do not see the error. Maybe a combination of things?

    Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •