Results 1 to 7 of 7

Thread: Other events disabled, tabcontent v2.2?

  1. #1
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default Other events disabled, tabcontent v2.2?

    1) Script Title: Tab Content V 2.2

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tabcontent.htm

    3) Describe problem: Just started using this to replace my attempt, so I could use the URL parameter function, but I need a few pointers on how to accomplish the following.

    Firstly, here's a link to the test page so you can see for yourself:

    http://www.bombthehills.com/newstuff/guides.html

    I want to add some functions to the onclick part of the tabs, so I can change the header, and also expand the box where they are contained, but it seems that with this script all other commands are ignored or something, as they're not working anymore.

    Also, in firefox it keeps saying "subcontent is null", where did I go wrong?

    Hope you can help,

    Thanks,

    Jack.

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Update - managed to get functions to work by assigning them to the onmouseup event instead of the onclick.

    I still need some help with this weird error I'm getting though, tried linking through a URL but no luck.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's odd. Probably something that you did (perhaps in conjunction with a bug in the code) that makes more this.subcontentids than elements bearing those id designations. However, since the code appears to work even with the error, if you were to add error checking to this (as shown):


    Code:
    expandsubcontent:function(subcontentid){
    		for (var i=0; i<this.subcontentids.length; i++){
    			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
    			if(subcontent)
    			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
    		}
    	},
    That might be all that's required to fix it up.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Schmoopy (12-01-2008)

  5. #4
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Damn your good at all this , thanks very much, since doing that I can now select a tab from the URL.

    Only error I'm getting now is Error: Permission denied to call method Location.toString

    But I'm pretty sure that's because it's on the local host and not on the internet.

    Am I right? Or is this another bug I need to fix?

    Edit: Spoke way too soon, I was just looking at the tab selected, but although the tab selected is correct, the actual content for it does not change, is this to do with the above error?
    Last edited by Schmoopy; 12-01-2008 at 09:30 PM.

  6. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The:

    Error: Permission denied to call method Location.toString
    Which I was also seeing, is probably from one of the other scripts on the page. In my experience it's common with Google added scripts, but it could be something else. If it is from the Google added script(s), it probably isn't causing any real problem. Google code is written for the lowest common denominator (quirksmode). They don't care if it throws errors, as long as it works most of the time.

    Sad as it may be, the only way to definitively diagnose any problems with the tabcontent v2.2 script is to start with only that script. If that works out, then we add, one by one, the other scripts and check at each stage for conflicts. If stripping things down to just the tabcontent v2.2 script still shows an error or errors, that would actually be good news, as we could just deal with that.

    I hope you understand what I'm saying, which is basically that you need to get any given script working on its own before integrating it into an environment with other scripts. Approaching things in this manner will distinguish between a problem or problems with the script itself, and a problem with the script in combination with the other scripts on the page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #6
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Yup, turns out it was the google ad, when I removed it there was no longer an error, but I wonder what about the "?guidetab=0" it doesn't like, as normally the error doesn't happen.

    I fixed the other thing now, but it is annoying having an error on the page, do you know if they have a fix for this?

  8. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't think it's a factor, though it may be. The thing is with Google code, it's not always delivering the same content. So sometimes there can be an error, sometimes not. Generally it has nothing to do with other scripts. Any appearance that it does could be coincidence.

    Of course, you could always test that in various ways. That's been one of my points in this thread. With so many scripts, to track down any particular error requires patient testing.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •