Welcome Guest, Not a member yet? Register   Sign In
JQuery and Ajax Issue
#21

[eluser]alboyd[/eluser]
I would do it like this:

In View:
Code:
[removed]

var base_url = "<?php echo $base_url; ?>";

[removed]

...
...

<a href="#" id="view_all">Test</a>

Then in the Javascript script section or included file:
Code:
$("a#view_all").click(function() {
    
    var series{};
    series['id'] = 1;
    var url = base_url + "controller/viewAll";    
    $("#content").load( url, series, function(){} );

    return false;
});

And your controller function can stay the same. try that and let me know...

EDIT: [removed] should be the open and close tags of javascript script
EDITEDIT: obviously $base_url is passed to the view and is basically base_url(); which I guess you could also use in the view rather than the variable... Smile

LASTLY: show me your $config['base_url']


Messages In This Thread
JQuery and Ajax Issue - by El Forum - 12-07-2009, 06:51 AM
JQuery and Ajax Issue - by El Forum - 12-07-2009, 07:15 AM
JQuery and Ajax Issue - by El Forum - 12-07-2009, 12:30 PM
JQuery and Ajax Issue - by El Forum - 12-07-2009, 06:10 PM
JQuery and Ajax Issue - by El Forum - 12-08-2009, 08:05 AM
JQuery and Ajax Issue - by El Forum - 12-08-2009, 06:10 PM
JQuery and Ajax Issue - by El Forum - 12-08-2009, 06:41 PM
JQuery and Ajax Issue - by El Forum - 12-08-2009, 06:47 PM
JQuery and Ajax Issue - by El Forum - 12-08-2009, 06:57 PM
JQuery and Ajax Issue - by El Forum - 12-08-2009, 07:02 PM
JQuery and Ajax Issue - by El Forum - 12-08-2009, 07:05 PM
JQuery and Ajax Issue - by El Forum - 12-09-2009, 09:33 PM
JQuery and Ajax Issue - by El Forum - 12-09-2009, 09:46 PM
JQuery and Ajax Issue - by El Forum - 12-09-2009, 09:48 PM
JQuery and Ajax Issue - by El Forum - 12-09-2009, 09:53 PM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 12:10 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 12:19 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 12:23 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 12:40 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 12:49 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:01 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:13 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:14 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:15 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:16 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:17 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:19 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:24 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:25 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:26 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 01:27 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 03:00 AM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 08:15 PM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 08:22 PM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 08:36 PM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 08:51 PM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 09:18 PM
JQuery and Ajax Issue - by El Forum - 12-10-2009, 09:39 PM
JQuery and Ajax Issue - by El Forum - 12-11-2009, 12:48 AM
JQuery and Ajax Issue - by El Forum - 12-11-2009, 01:05 AM
JQuery and Ajax Issue - by El Forum - 12-11-2009, 01:11 AM
JQuery and Ajax Issue - by El Forum - 12-11-2009, 01:39 AM
JQuery and Ajax Issue - by El Forum - 12-11-2009, 01:41 AM
JQuery and Ajax Issue - by El Forum - 12-11-2009, 01:41 AM
JQuery and Ajax Issue - by El Forum - 12-17-2009, 01:09 PM
JQuery and Ajax Issue - by El Forum - 12-17-2009, 05:57 PM
JQuery and Ajax Issue - by El Forum - 12-17-2009, 10:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB