View Full Version : Prototype Framework/Javsascript help..
Hey, I'm currently working on coding a layout I designed recently. I have a featured area where there are 4 tabs and an area for content I've managed to use the prototype framework to bring the content in with ajax and change the selected tab to the select tab css class I'm wanting to change the css class of the tab back to un-selected when another tab is selected but I'm having trouble. Can anyone help me?
My prototype code:
function loadTab(name)
{
new Ajax.Request('?tab=' + name,{
method: 'get',
onSuccess: function(transport)
{
$('feat_tab_' + name).className = 'feat_tab_s';
$('feat_cont').innerHTML = transport.responseText;
}
});
}
It changes to the selected tab class, but i need a way of changing it back when a new tab is selected.
Thanks, Jamie.
MrCraig
09-04-2008, 01:11 PM
Why dont you use Ajax.Updater :S?
Why dont you use Ajax.Updater :S?
Uh, can you explain? hahaha sorry i'm uber crap with javascript and I've only used this framework once, I'll have a look in the documentation tho. Cheers :)
Agnostic Bear
09-04-2008, 04:42 PM
Dojo framework, use that if you're gonna use any framework, prototype is far too bulky.
Invent
09-04-2008, 04:52 PM
Prototype isn't really bad if you either utilize all the functions/features it offers, if you just use a snippet of code from the .js file (Such as to use $()) or if you learn to use it properly.
Prototype itself is the best Javascript framework/library out there (and isn't really that laggy - 60kb or so I think? It starts to get laggy when you throw in scriptaculous, etc), but I do have to say jQuery is also very good ;) I personally haven't checked out the Dojo framework, so I might do so now..
Dojo framework, use that if you're gonna use any framework, prototype is far too bulky.
Might just do that.
I'm not sure if it's my connection or if it's prototype its self but there's a slight 1 second or so delay when changing tabs after the tab is clicked?
Agnostic Bear
10-04-2008, 07:00 AM
Might just do that.
I'm not sure if it's my connection or if it's prototype its self but there's a slight 1 second or so delay when changing tabs after the tab is clicked?
That would be ajax, it still has to load the page then display it to you.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.