Welcome Guest, Not a member yet? Register   Sign In
getJSON in CI problem
#12

[eluser]Mitja B.[/eluser]
i make this JS function

Code:
function spremeniVrednost()
{        
    izb = $("#select1").val();

    $.post("http://localhost/btraker/admin/fetchjson/"+izb, { func: "getNameAndTime" },
    function(data){
        //alert(data.gdfgf); // John
        //console.log(data.gdfgf); //  2pm
        $("#select2").removeOption(/./);
        $("#select2").addOption(data);
    }, "json");
}


and

Code:
$drzava = '<select name="select1" id="select1">';
$drzava .= '<option value="">izberi</option>';

    foreach($submenu->result() as $cat):
        $id = $cat->Id;
        $ime = $cat->title;
        $drzava .= "<option value=$id>$ime</option>";
    
    endforeach;  
$drzava .= '</select>';

$mesto = '<select name="select2" id="select2">';
$mesto .= '<option value="">izberi</option>';
$mesto .= "</select>";

but select2 are not filled and is still empty.

what i am doing still worng?


Messages In This Thread
getJSON in CI problem - by El Forum - 09-21-2008, 11:15 AM
getJSON in CI problem - by El Forum - 09-21-2008, 01:55 PM
getJSON in CI problem - by El Forum - 09-22-2008, 12:44 AM
getJSON in CI problem - by El Forum - 09-22-2008, 03:29 PM
getJSON in CI problem - by El Forum - 09-23-2008, 01:02 AM
getJSON in CI problem - by El Forum - 09-30-2008, 01:29 AM
getJSON in CI problem - by El Forum - 09-30-2008, 02:52 AM
getJSON in CI problem - by El Forum - 09-30-2008, 05:02 AM
getJSON in CI problem - by El Forum - 09-30-2008, 10:24 AM
getJSON in CI problem - by El Forum - 10-09-2008, 03:12 PM
getJSON in CI problem - by El Forum - 10-10-2008, 05:45 AM
getJSON in CI problem - by El Forum - 10-10-2008, 08:46 AM
getJSON in CI problem - by El Forum - 10-10-2008, 10:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB