JqueryUI tabs

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

JqueryUI tabs

Post by hallsofvallhalla »

When the page is loaded I noticed all the PHP code inside of the tabs are run. So when you switch back and forth between them the data is there. Is this also true for Ajax? How would run ajax only when the tab is selected and rerun every time I click the tab.
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: JqueryUI tabs

Post by hallsofvallhalla »

to add to that does it only load data like images when the tab is selected?

What I am getting at is I am building a site with little to no refresh whatsoever. 100% Ajax. Will be heavy loading each page into a tab. I can use Ajax to pull the data so as long as it does not run the ajax function it will have little as far as queries. Just each page worth of code and images.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: JqueryUI tabs

Post by Jackolantern »

While admittedly I have not used jQueryUI much, I have made a similar (although more than likely, much more simple) tabs system in jQuery before. All of the tabs are technically on the same page, so of course it must all be evaluated by PHP as the entire page is generated. What you can do for the AJAX is set up click events on the tabs themselves so when they are clicked, the AJAX is run that is needed to initialize the tab. Of course the speed of AJAX will mean that players will see the uninitialized tab for a moment before the data is loaded in.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: JqueryUI tabs

Post by hallsofvallhalla »

Yeah looking into that now. It will be far faster though than loading the whole page over again.
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: JqueryUI tabs

Post by Nexus »

For tabs I generally use Spry with Dreamweaver and it doesn't give me any problems, never got to using AJAX with the tabs nor JQuery.
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: JqueryUI tabs

Post by Xaleph »

Spry is not good, it`s a proprietary.

Anyway, using AJAX means you are not loading the page/PHP directly. The data ( processed ) html is only run once the page has been called for. Which is a good thing, because it means less servertime. It`s only processed if needed.

You could, however, using static tabs, preprocess the page and then use jquery tabs to display and hide it, that way it`s loaded beforehand. But you can ajax/dynamically load it, which is better, if you ask me. Load times are minimal ( since you are only accessing and processing 1 specific part of something )
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: JqueryUI tabs

Post by hallsofvallhalla »

I am not pleased with JqueryUI at all. Couple features that i am not looking for. I am not going to use it for this certain project. Its features are nice! But not what I need.
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: JqueryUI tabs

Post by Xaleph »

I totally agree. jQuery UI sucks. It`s bloated ( load times go way up.. ) it has enormous overhead overall.

Anyway, the thing I DO like is you can download specific items from the UI. Like, i you only need to efects and the datepicker, you can select those. That way, the compressed code is way smaller.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: JqueryUI tabs

Post by Jackolantern »

jQuery UI was designed to compete directly against Flex's UI elements, and when you specifically need one of its components, you really need it. I think we will see much more uses for it once HTML5 becomes more mature and supported and JS-based RIAs really take hold. I have only had one instance where I ever really needed it, but for that one time, it was a life-saver.

And I don't personally believe it is bloated. Considering the fact that you create your own source file with only the features you want, it would seem to be the exact opposite of bloated (which means to me it has tons of stuff you don't need). If you only need 1 part of it, it is actually rather small and lightweight.

EDIT: Oh wow, it has actually changed a lot since I last used it. Nearly 2 years ago one feature and the core was about 100kb, and now it is over 300kb if you count the supporting CSS and images. Ok, maybe it has become bloated lol. But I still do think it is going to be an important piece of the puzzle for HTML5, preventing people from having to make custom rich elements from scratch.
The indelible lord of tl;dr
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: JqueryUI tabs

Post by Xaleph »

Despite that argument there`s no real need for it. Because even if you use juery UI as a fall back if the browser does not support certain things, you still have older browsers who don`t support jquery UI or Javascript for that matter. Really, if you want to use it as an enhancement, be my guest, just don`t rely on it. And it really has become bloat. Then again, the usage of jquery UI is totally wrong too. People use it to enhance their pages but forget what it aims to do, be the front/visual for a RIA. Something it can do pretty OK. But, most people use it for stuff like a date picker, and still load the whole library on every single other page. So in the end, it`s usage is not OK.

And, one other MAJOR argument I have against the UI is the fact it`s not as customizable as you think. You can change colors, fonts et cetera, but you cannot change it`s appearance. It will always look like jquery UI. I hate it. Really, hate it. I don`t like the interface.

You know what I do like though? GWT! It`s pretty much the same as jquery UI, except you are forced to create a RIA because you cannot do front-end pages. It`s all Java baby :) Styling is all up to you, all GWT does is draw the elements. Styling is up to you. That is to my personal opinion, a real javascript UI.

Anyway, GWT > jquery UI. True, GWT is forcing you to use Java and yes, you NEED javascript in your browser, but that`s cool. Because you dont get the overhead to checktype every single page over and over again to see if javascript is enabled. With GWT you know if it works or not. If not > fall back to same lame crappy IE6 old school interface.

That to my opinion is good usage of javascript UI elements or RIA.

Oh another cool aspect of GWT is there`s several interfaces for it. EXT js is one of my favourites. True, it can be used as a standalone JS library too,
but the thing with it is the same as jquery UI. The bloat. Every single page has to reload the resources over and over again.
Post Reply

Return to “Advanced Help and Support”