我想显示图片而不是显示网址

时间:2018-09-20 05:54:47

标签: php codeigniter

   //

<!-- begin snippet: js hide: false console: true babel: false -->

这是我的html

<td width="60" ><a class="btn btn-primary" onclick="viewList('<?php echo $record->reimId;?>','<?php echo $this->common_model->getEmployeeById($record->empId);  ?>','<?php echo base_url('uploads/reimbrush') . '/' . $record->reimImage; ?>');" name="viewList" id="viewList" data-toggle="modal" data-target="#viewListData">View</a></td>

如何在Codeigniter中停止访问重定向URL

这是显示网址的我的代码...

<script type="text/javascript">

		function viewList(reimId,name,docurl)
		{
			//alert("Yes!!!...");
			save_method = 'update';
			$('#form')[0].reset(); // reset form on modals
			$('.help-block').empty(); // clear error string
		 
			//Ajax Load data from ajax
			$.ajax({
				url : "<?php echo base_url('reimbursement/reimbView/')?>/" + reimId,
				type: "POST",
				dataType: "JSON",
				success: function(data)
                
				{
                    
					$('#empName').text(name);
                    $('#applidDate').text(data[0].currentDate);
                    $('#reimDate').text(data[0].reimbrushDate);
					$('#reimAmount').text(data[0].totalAmount);
                    $('#reimType').text(data[0].reimbursementtype);
                    $('#member').text(data[0].reimbursementtype);
					$('#reimDescription').text(data[0].reimbursement);
                    $('#billUrl').html('<a href="'+docurl+'" style="color:#062bb3;" target="_blank">'+docurl+'</a>'); 
				},
				
				error: function (jqXHR, textStatus, errorThrown)
				{
					alert('Error get data from ajax');
				}/*,
				complete : function(){
					alert(this.url);
				}*/
			});
		}
	
</script>

<script type="text/javascript">

        function viewList(reimId,name,docurl)
        {
            //alert("Yes!!!...");
            save_method = 'update';
            $('#form')[0].reset(); // reset form on modals
            $('.help-block').empty(); // clear error string

            //Ajax Load data from ajax
            $.ajax({
                url : "<?php echo base_url('reimbursement/reimbView/')?>/" + reimId,
                type: "POST",
                dataType: "JSON",
                success: function(data)

                {

                    $('#empName').text(name);
                    $('#applidDate').text(data[0].currentDate);
                    $('#reimDate').text(data[0].reimbrushDate);
                    $('#reimAmount').text(data[0].totalAmount);
                    $('#reimType').text(data[0].reimbursementtype);
                    $('#member').text(data[0].reimbursementtype);
                    $('#reimDescription').text(data[0].reimbursement);
                    $('#billUrl').html('<a href="'+docurl+'" style="color:#062bb3;" target="_blank">'+docurl+'</a>'); 
                },

                error: function (jqXHR, textStatus, errorThrown)
                {
                    alert('Error get data from ajax');
                }/*,
                complete : function(){
                    alert(this.url);
                }*/
            });
        }

</script>

0 个答案:

没有答案