Support the ongoing development of Laravel.io →
posted 10 years ago
Blade
Last updated 2 years ago.
0

You're going to have to do at least some javascript with that. Any time you want to manipulate the current page without a complete reload, you're looking at using ajax. Fortunately, it isn't very complicated thanks to libs like jQuery. Depending on what you're after, it could be as simple as the following:

$.get(http://some.data.url, function(html) {
    $('#some_div').html(data);
});
Last updated 2 years ago.
0

Or, if the content of the tabs is not very large, it can be done using only CSS ;)
What of course means, that the content of main area of must be loaded at once for all tabs.

Last updated 2 years ago.
0

Cool, yeah I thought it would involve JS. TorchSK, I'd like to avoid loading it all because there is a lot of data/queries involved for each tab.

I've never worked with $.get, I guess I could do something like:

$.get(document.domain/route, function(html) {

The domain shouldn't be changing, it'd just be kinda cool lol. I guess document.domain need to wrap the first param in quotes, like ' " ' + document.domain + ' /route" ' ? I could probably just test that. It's Friday and I'm rambling. :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Meowts meowts Joined 10 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.