PDA

View Full Version : Ajax Tabs Content script v2.2 problem IE



ssnobben
11-05-2009, 03:18 PM
Hi

I am new here and have a script Ajax Tabs Content script v2.2 that I cant get to work with IE. Everything works fine in Firefox but not IE.

where I get an error with IE on this line..

'document.getElementById(...)' is null or not an object ajaxtabs.js, line 17 character 2

----
this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0;
Message: 'document.getElementById(...)' is null or not an object
Line: 17
Char: 2
Code: 0
URI: /mod_tpajaxtabs/ajaxtabs/ajaxtabs.js


Message: Object doesn't support this property or method
Line: 59
Char: 102
Code: 0
URI:/js/mootools.js


Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0

any help what to do?

rgds

jscheuer1
11-05-2009, 04:53 PM
In future, please post about Dynamic Drive Scripts in the Dynamic Drive Scripts Help section here where I've moved this thread, and:

Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

Sounds like a table might be involved, or you may have initialized inside the target element. But I'd have to see the page to be sure. If that's it though, we can move the initialization (the part like this):


<script type="text/javascript">

var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

</script>

until after the table or target element's closing tag. IE can be finicky about tables that way, and many browsers will even let you write to an open target element, but not IE.

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.

ssnobben
11-07-2009, 08:46 AM
Thanks John thats very kind of you!!

This problem is driving me nuts though I am not a coder, designer or developer really.

But I have this Joomla site I have done and the only thing that stopping it from working correctly is those ajax tabs that breaks in IE...

here is the url: http://www.travelmate.com There is 3 ajax tabs. One in the right column one set up in bread crumb and one in the right column that you cant see in IE bcs it breaks and stops rendering the whole page...

Any tips very much appreciated! :)

Thanks!

jscheuer1
11-07-2009, 10:37 AM
First thing I'd try is following the script's installation instructions, placing the initialization for each set of tabs after its corresponding tab group. Relying upon the:



window.addEvent('domready', fun . . .

construct may not be adequate for all browsers.

ssnobben
11-09-2009, 01:13 PM
Script: DD Tab Menu
http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

So what do you suggest how to solve this? I am not a techie guy but I can copy and paste code anyhow? lol

jscheuer1
11-09-2009, 03:25 PM
Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

That said, the suggestion in my previous post was as regards:


Ajax Tabs Content script v2.2

Which is here:

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

Not as regards:


Script: DD Tab Menu
http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

So I think you should first determine which script you are using. Hint - it looks like the first one - I at least saw code attached to the page for Ajax Tabs Content script v2.2 and the below quoted code appears to reference Ajax Tabs Content script v2.2. Though I could be wrong about that being the script you are having a problem with because there are so many scripts on that page, and I only originally looked for the one you first said that you were using.

However, neither script says to use (from your page's source code):


window.addEvent('domready', function() {var tpat70384049707=new ddajaxtabs("tpajaxtabs70384049707tabs", "tpajaxtabs70384049707divcontainer");tpat70384049707.setpersist(true);tpat70384049707.setselectedClassTarget("link");tpat70384049707.init();});

So my suggestion was to get rid of that, and to use instead the actual initialization method as recommended for whatever script you are using. This information can be found on the script's demo page.

ssnobben
11-10-2009, 07:42 AM
Hi John,

you are correct I see that script there now Ajax Tabs Content script v2.2.

About the usage term I see in the module has already this reference that is there in the file ajaxtabs.js.

//** Ajax Tabs Content script v2.0- Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Updated Oct 21st, 07 to version 2.0. Contains numerous improvements
//** Updated Feb 18th, 08 to version 2.1: Adds a public "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically. Only .js file changed from v2.0.
//** Updated April 8th, 08 to version 2.2:
// -Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0)
// -Modified Ajax routine so testing the script out locally in IE7 now works

How can I make it work with the script tag?

Could I just paste this code below this as you mentioned there for this file ajaxtabs.js and change to <script src="ajaxtabs.js" ?

<script src="countdown.js" type="text/javascript">
/***********************************************
* Dynamic Countdown script- Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
</script>

rgds

jscheuer1
11-10-2009, 04:39 PM
View the source code of the demo.htm file:

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/demo.htm

which is also available in the archive you should have downloaded for this script from its main demo page.

There you will find a perfect example of the credit:



<script type="text/javascript" src="ajaxtabs/ajaxtabs.js">

/***********************************************
* Ajax Tabs Content script v2.2- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

as well as typical on page usage for this script.

ssnobben
11-11-2009, 08:48 AM
Hi John,

I have copy and pasted this now into this ajax module where the ajaxtab.js is. Hope everything is fine..

Seems to work for the site and this is where this ajaxtabs belong in the site.

can you pls check it if correct?

rgds

jscheuer1
11-11-2009, 02:01 PM
The credit is still not showing up in the served source code of page. Probably it is because it is a script and because you are using an 'AJAX module' for this. This probably also accounts for the non-standard initialization I previously mentioned. An ordinary include might be better. Does your package allow for those?

ssnobben
11-12-2009, 10:57 AM
Well its a Joomla module with the ajaxtabs.js file there and I have add this there too.

I attach it so you can see how it looks and if its something wrong in there too..

rgds

jscheuer1
11-12-2009, 12:23 PM
This:

<script type="text/javascript" src="ajaxtabs/ajaxtabs.js">

/***********************************************
* Ajax Tabs Content script v2.2- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

Should not be in the script, it should be in the page's source code in place of this:


<script type="text/javascript" src="http://www.travelmate.com/modules/mod_tpajaxtabs/ajaxtabs/ajaxtabs.js"></script>

so that it looks like so:


<script type="text/javascript" src="http://www.travelmate.com/modules/mod_tpajaxtabs/ajaxtabs/ajaxtabs.js">

/***********************************************
* Ajax Tabs Content script v2.2- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

I also notice that you have otherwise modified the code of the script, it would probably be best to revert to the actual script which may be found here:

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/ajaxtabs/ajaxtabs.js

Except for this line:


ddajaxtabssettings.loadstatustext="<img src='modules/mod_tpajaxtabs/ajaxtabs/loading.gif' /> "

which obviously must remain the same even after you revert to the actual script.

And to repeat, you need to get this out of your source code on the page:


<script type="text/javascript">window.addEvent('domready', function() {var tpat701177655123=new ddajaxtabs("tpajaxtabs701177655123tabs", "tpajaxtabs701177655123divcontainer");tpat701177655123.setpersist(true);tpat701177655123.setselectedClassTarget("link");tpat701177655123.init();});</script>

and instead use the initialization method as described on the demo page:

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

and as demonstrated in the source for:

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/demo.htm