PDA

View Full Version : Ajax Content Tabs



Carl
06-29-2006, 05:54 AM
Ajax Content Tabs
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/

What variable would I need to use to include the aforementioned script in an "body onload" command?

I ask because there does not seem to be any "window onload" command in the script.

I would appreciate any advice that you could give.

jscheuer1
06-29-2006, 06:00 AM
There is no onload event required for this script.

Carl
06-29-2006, 06:03 AM
Is it possible to use one?

jscheuer1
06-29-2006, 06:15 AM
Yes but, why? What for?

Carl
06-29-2006, 06:31 AM
I have a website that I have created using a third-party AJAX script (to save bandwidth) which I know you don't support, but after some research, I have discovered that I can use the onload function to load two or more javascripts in the same page.

I have tested it over the past few hours with a variety of scripts (dynamic images replacement/content/gallery/poll/etc), and all have worked by taking the window onload command and adding it to a body onload command, all except this script because I can't figure an onload command for the script.

jscheuer1
06-29-2006, 06:40 AM
Well, as I said, it has no onload command. This is what happens as the page loads (not onload) though:


<script type="text/javascript">
//Start Ajax tabs script for UL with id="maintab" Separate multiple ids each with a comma.
startajaxtabs("maintab")
</script>

As long as you have that below the the HTML markup for the tabs, the script should work on any page as long as there is no conflict with another script(s).

I think what may have you confused is that there can be other conflicts between two scripts. The onload conflict is a common one but shared function names, variable names and other things can also cause conflicts between two scripts.

Either that, or you are looking to resolve a conflict that doesn't exist.

Carl
06-29-2006, 06:48 AM
I have checked for conflicts within my limited knowledge, (still a learner) and the functions all have different names other than a couple of loadobj commands, could that be the conflict?

Or is it more likely to be because the actual content is in one file containing only the content of a specific div, while I have tried the js meta tag in the main page?

I'll try fiddling with it a little more because it's a beautiful script and perfect for what I want, the other alternative is to replicate the script I already use for the main file system with a few changes, which to be honest, is probably way beyond my level at the moment.

Thanks for the input though, it's appreciated, it's given me something to play/experiment with.

jscheuer1
06-29-2006, 06:56 AM
It is hard to say for sure without a link to your page, even then it would be hard but, hopefully not impossible to tell. If two scripts both use loadobjs(), that is a function and each script will have its own version, whichever version is read (parsed) by the browser last, will be the active version. I don't understand the other thing you mentioned. Not enough information.

Carl
06-29-2006, 07:08 AM
The direct link to the test site is http://livetest.ourbloody.com, though I have fiddled with it to oblivion at the moment...(click stille nacht)

As you'll see, I have managed to mangle the two styles together by adding the css to the styles, but when you click a tab in the script from here it loads the actual page rather than loading it in the correct div specified by the script.

For a better example of the pages I am trying to integrate it into simply http://ourbloody.com would be better, that's the unaltered original script