Results 1 to 6 of 6

Thread: abref has no properties

  1. #1
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default abref has no properties

    1) Script Title: Ajax Tabs Content v2.2

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

    3) Describe problem:

    I'm getting this error when using the FireBug console on Mac and PC:

    Code:
    tabref has no properties
    [Break on this error] var relattrvalue=tabref.getAttribute("rel")
    It's in ajaxtabs.js line 137

    I haven't modified anything in the js file it's as standard.
    Any suggestions..

  2. #2
    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

    Which script are you using? You say you are using Ajax Tabs Content v2.2, but you link to Tab Content Script (v 2.2).

    In either case, if the rel attribute has no corresponding element at the time it is processed by the script, there will be an error.

    If you want more help:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    Last edited by jscheuer1; 04-12-2009 at 01:51 PM.
    - John
    ________________________

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

  3. #3
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the prompt reply John - appreciated!

    The error is showing in most pages that contains the Ajax Tabs Content script, ie:
    http://www.myhooligans.com/index.php?t=home_index

  4. #4
    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

    Well, you have:

    Code:
    <script type="text/javascript">
    var playt=new ddajaxtabs("playtab", "playdiv")
    playt.setpersist(false)
    playt.setselectedClassTarget("link") //"link" or "linkparent"
    playt.init()
    </script>
    and:

    Code:
    <script type="text/javascript">
    var centert=new ddajaxtabs("centertab", "centerdiv")
    centert.setpersist(false)
    centert.setselectedClassTarget("link") //"link" or "linkparent"
    centert.init()
    But there are no links with rel=playdiv or rel=centerdiv. But the script is looking for those to see which one should be selected.

    Now, I can't really tell if you even need to have those two script blocks or not. From what I can see, they're not being used, so you should just get rid of them. If that causes a problem, there is probably some way to get around it - to achieve what they achieve without the error. But, if you can just get rid of them, that would probably be the best solution, as I think they may be left over from an earlier version of the page that had links with those rels, or that they were setup in anticipation of such links that were never added.
    Last edited by jscheuer1; 04-12-2009 at 06:33 PM. Reason: spelling
    - John
    ________________________

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

  5. #5
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes the "playdiv" and "centerdiv" are being used for instance if you look at the "centerdiv" container you can see the sort orders there "Newest, Most Played etc.." which pull in pages into the div AFTER it initially loads the gallery, demo here: http://mediapro.oinkba.com/index.php?t=_djs

    I'm just wondering if there was a way for the script to not detect the lack of a tab link and give out an error, here's what the code I'm using looks like using Smarty PHP to initially pull in the gallery into the "centerdiv".

    Code:
    <!-- Center Ajax Box -->
    <ul id="centertab" class="no-shadetabs">
    </ul>
    <div id="centerdiv" style="margin-bottom: 20px;">
    <!-- Ajax Gallery -->
    	{jr_ranking mode="artist" order="3" pagebreak="21" quota_id=$smarty.config.producers_id header_template="_producers_gallery_header.tpl" row_template="_producers_gallery_row.tpl" footer_template="_producers_gallery_footer.tpl" require_image=$smarty.config.require_images replace_0=1}
    </div>
    <script type="text/javascript">
    var centert=new ddajaxtabs("centertab", "centerdiv")
    centert.setpersist(false)
    centert.setselectedClassTarget("link") //"link" or "linkparent"
    centert.init()
    </script>
    Any suggestions..

    Thanks
    Huw

  6. #6
    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

    OK, here's what I'd try - In ajaxtabs.js add the highlighted line to the expandtab function:

    Code:
    	expandtab:function(tabref){
    		if(!tabref) return;
    		var relattrvalue=tabref.getAttribute("rel")
    		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easy searching through
    		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
    		if (relattrvalue=="#default")
    			document.getElementById(this.contentdivid).innerHTML=this.defaultHTML
    		else if (relattrvalue=="#iframe")
    			this.iframedisplay(tabref.getAttribute("href"), this.contentdivid)
    		else
    			ddajaxtabs.connect(tabref.getAttribute("href"), this)
    		this.expandrevcontent(associatedrevids)
    		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
    			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("href")==tabref.getAttribute("href"))? "selected" : ""
    		}
    		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
    			ddajaxtabs.setCookie(this.tabinterfaceid, tabref.tabposition)
    		this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
    	},
    - 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
  •