JQuery and Ajax Issue |
[eluser]alboyd[/eluser]
mate.. I've replicated your code on my machine and I had major problems with your declaration of the array variable in javascript. But works when you do it like this: Code: var series = new Array(); And I get Hello returned to content just fine. Can't see how there would be a problem if i loaded it onto my web host. How on earth did your var series{}; work in any location is beyond me..
[eluser]Bendude[/eluser]
I was using var series = {}; Thought that was short hand for initialising an array. I have changed it like you said and now I receive a 404 on this function with the base url Code: <?php $base = base_url(); ?> And your version of the function does not trigger a Http request Code: function viewAll()
[eluser]alboyd[/eluser]
No... that's not what my version looks like... it's not a javascript function... Inside your script should have something like this: Code: var base_url = "<?php echo $base_url; ?>";
[eluser]Bendude[/eluser]
Ok I just used your method exactly as shown and it works locally even though it seems rather slow, but still I get no response or error on the server. It is like JQuery is not attaching the event handler to the link as it still adds the hash to the URL?
[eluser]alboyd[/eluser]
You link should not be doing any on_click things right? Should just be the link like i put in my prev example. If it's not binding then is the link appearing through ajax as well? If so you will need to use it live. Code: $("a#view_all").live("click", function() {
[eluser]Bendude[/eluser]
well think im about back where i started, works fine locally with your code but on the server i just keep getting 404 not found. Thats for both relative and absolute urls. Do you think it could be my .htaccess messing it up?
[eluser]alboyd[/eluser]
Could be mate.. Try this one: Don't forget to change the Code: <IfModule mod_rewrite.c> You need to change RewriteBase to your base url. EG: Locally my base is http://localhost/sitename so rewritebase is "/site/" On my web host it's just "/"
[eluser]Bendude[/eluser]
Nope same difference, I wonder what else could be wrong, I can not see the results of the controller method if i try to access the URL manually either. I still get the 404 Yet locally it works fine, and obviously I know it exists
[eluser]alboyd[/eluser]
Your server probably doesn't like you using htaccess - you will need to turn it on somehow... google it... prove this by putting in index.php/controller/function |
Welcome Guest, Not a member yet? Register Sign In |