[eluser]starbuck[/eluser]
Hi,
İ am fresh in Codeigniter. While i'm developing a facebook, i got a trouble.
In default controller derby->method index->view page:
<a href="nextcontroller/index/id/2">
When i clicked link,new page loads. In new view pagei i have another link. It's href part is empty. When i click it, jquery works.
$(function() {
$(".vote").click(function()
{
var id = $(this).attr("id");
var name = $(this).attr("name");
var derby_team = $(this).attr("rev");
var dataString = 'id='+ id + '&derby;_team=' + derby_team ;
var parent = $(this);
if(name=='up')
{
$(this).fadeIn(200).html('<img src="img/dot.gif" align="absmiddle">');
$.ajax({
type: "POST",
dataType: 'json',
url: "<? echo base_url(); ?>nextcontroller/votehome",
data: dataString,
cache: false,
success: function(html)
{
var vote_home = html.home;
parent.html(vote_home);
var vote_away = 100 - vote_home;
$("#away").text(vote_away);
}
});
}
My problem is: exampe.com/nextcontroller/method2 (I wanted that)
but i have that exampe.com/nextcontroller/index/id/2/nextcontroller/votehome
It adds previous url to new.