CodeIgniter Forums
Problem in Using Ajax - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Problem in Using Ajax (/thread-24106.html)



Problem in Using Ajax - El Forum - 10-30-2009

[eluser]Anes P.A[/eluser]
Hi pal,
I am Anes, I am a newbie in codeIgniter(CI).
I use Scriptaculous and prototype for a sample shopping cart
application. For Delete item from shopping cart I use
Ajax. But When I click on the delete link I got the
message "Not Found The Requested URL /welcome/ajax_cart was not found

on this server". But according to my friend I check same using
Firebug NET panel , in HTML part of response I got the
message "Javascript is not enabled! Please turn on Javascript to use

this site.". But in my Browser Javascript is Enabled already. then
why this meaage Come and what is the problem.

I attach the working page picture of demo shopping cart...

I expect your reply ASAP.

With thanks
Anes P.A


Problem in Using Ajax - El Forum - 10-31-2009

[eluser]Ben Edmunds[/eluser]
Hey Anes,

Please post the method and view associated with welcome/ajax_cart.

Also, it'd be helpful if you post the javascript that is doing this ajax call.


Problem in Using Ajax - El Forum - 10-31-2009

[eluser]John_Betong[/eluser]
 
I am just getting into jQuery, etc and had a similar problem.

Google for more info on the script below.

Code:
// ESSENTIAL: Must FIRST load Prototype then Scriptaculous then jQuery.
  [removed]
    jQuery.noConflict();
    ...
  [removed]
 
 
 


Problem in Using Ajax - El Forum - 10-31-2009

[eluser]Ben Edmunds[/eluser]
Ok going through your code...

I see your reading the book, good job. It was a good book.


First thing, you shouldn't have so many models in your view. Read about php alternative syntax.

And for your problem, I didn't take the time to get it working but from scanning the code I would assume it has something to do with the url.

Usually I create a javascript variable baseurl to reference later, so in your template add

Code:
[removed]
   var baseUrl = "<?php echo base_url();?>";
[removed]

then in your javascript function instead of doing just /welcome/method add the baseUrl in front of it.


If that doesn't fix it I'll get the code running and figure it out but hopefully that's all it is.


Problem in Using Ajax - El Forum - 10-31-2009

[eluser]Anes P.A[/eluser]
Hello Ben, Thanks For Your Apt Reply . I am a newbie in CI. So I attach my
fully Demo project with Database. Pls Download same and Copy in your system
and work it, I don't know what it's problem.

My Demo work can download from link:
http://www.4shared.com/file/145312935/50879a58/shopping.html

Pls Help me I am waiting your Reply.

With Thanks

Anes


Problem in Using Ajax - El Forum - 11-01-2009

[eluser]Anes P.A[/eluser]
Hello Ben,

I try according to you , But Really sorry I don't get it , now i got 404 Page not Found Error. Pls help me I appreciate your good mind. I am really novice .

Pls help me ...

With Tons of thanks

Regards
Anes P.A