jquery post |
[eluser]marjune[/eluser]
ei pipz, my script in jquery using post didn't work!! my jq script Code: $(".topicans").click(function(){
[eluser]eric cumbee[/eluser]
ive found that using base_url() in your .post url works alot better, some times it worked for me with it other times it didnt.
[eluser]marjune[/eluser]
i already try this but nothing's happen Code: $.post("<?php base_url().'furoms/viewthread' ?>", {topic: topic_id});
[eluser]Ben Edmunds[/eluser]
Try this: Code: $.post("<?php echo base_url();?>furoms/viewthread", {topic: topic_id}); You have to echo the base_url() function as it doesn't output automatically.
[eluser]marjune[/eluser]
i try but nothing Code: $.post("<?php echo base_url();?>furoms/viewthread", {topic: topic_id});
[eluser]Ben Edmunds[/eluser]
What is the error your getting? No response? Please post your controller that this posts to. Thanks,
[eluser]marjune[/eluser]
no response ! my controller Code: function viewthread(){
[eluser]Ben Edmunds[/eluser]
Alright, So your doing: Code: $(".topicans").click(function(){ and then what do you want to happen? You need to add the data callback on your post function if you want to display something. For example: Code: $(".topicans").click(function(){ Also note, your posting id but your controller is expecting topic_id.
[eluser]marjune[/eluser]
i dont want a call back! what i want to happen is after posting the data from jquery, i let the the controller to do the thing here Code: function viewthread(){ to the next view('thread');
[eluser]Ben Edmunds[/eluser]
Well the post function is doing an ajax request so I think one of us is misunderstanding something... Are you wanting to load a different page when topicans is clicked? If so, why not just use a link like href="controller/viewthread/1"? For reference, http://docs.jquery.com/Ajax/jQuery.post |
Welcome Guest, Not a member yet? Register Sign In |