0
$.ajax({
    type: "POST",
    url: <?php echo base_url().'index.php/user_management/manage_users/ViewProfile/'?>"+JSON.parse(item.UserID),
    success: function(output_string){
        $('.second_column_content_container').html(output_string);
    }
});

我希望 url 的结果用单引号或双引号括起来;例如

'url: <?php echo base_url().'index.php/user_management/manage_users/ViewProfile/'?>"+JSON.parse(item.UserID)' or 
"url: <?php echo base_url().'index.php/user_management/manage_users/ViewProfile/'?>"+JSON.parse(item.UserID)"
4

2 回答 2

0

尝试这个

url: "<?php echo base_url().'index.php/user_management/manage_users/ViewProfile/'?>"+JSON.parse(item.UserID),
//---^^--here

或者

url: "<?php echo base_url() ?>"+'index.php/user_management/manage_users/ViewProfile/'+JSON.parse(item.UserID),
于 2013-03-22T18:21:19.393 回答
0

尝试这个:

$.ajax({
    type: "POST",
    url: '<?php echo base_url(); ?>'+'index.php/user_management/manage_users/ViewProfile/'+JSON.parse(item.UserID),
    success: function(output_string){
       $('.second_column_content_container').html(output_string);
    }
});

代替 php 连接.使用 javascript 连接+

于 2013-03-22T18:21:42.950 回答