Welcome Guest, Not a member yet? Register   Sign In
can't seem to get jquery to work
#1

[eluser]Haskabab[/eluser]
Hey,

I've been trying to get jquery to load my (partial) views in my $(#content) container when a link is clicked. But so far i've not been succesful and i'm completely stuck..

my jquery (this works so far..)

Code:
$(window).load(function() {

$('#menu a').live('click', function(){
                        
    var uri = $(this).attr('href'); // Get url to load
    return false; // Stop link from reloading page
            
});
        
});

My controller

Code:
public function index($type = null)
    {
        $this->template->write('title', 'Welcome');
        $this->template->write_view('content', 'templates/splash/welcome');
        $this->template->render();
    }
    
    public function updates()
    {
        
        $this->template->write('title', 'Updates');
        $this->template->write_view('content', 'templates/splash/welcome');
        $this->template->render();
        
    }

I've searched the forums and google'd the shit out of this but nothing usefull/working out there.. I remember getting it to work a while ago on another project and it had a fallback system so if there was no jquery or javascript enabled it would just load the page like it would normally..

If anyone knows how to do this, please share.

Thanks in advance,
Nick




Theme © iAndrew 2016 - Forum software by © MyBB