PHP/JSON错误,不显示值 [英] Php/JSON ERROR, value doesnt display

查看:91
本文介绍了PHP/JSON错误,不显示值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.

我有一个jquery函数,它从php函数接收一个值,现在它只是将Object输出到屏幕上,而不是实际值

这是我的jQuery函数

Hi.

I have a jquery function that receives a value from a php function now it just prints Object out to the screen instead of the actual value

this is my jquery function

function loadRep(){
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '{$ajaxUrl}' + '&act=loadRep',
                        data: 'storeId={$storeId}',
                        success: function(data){
							 $('#rep_name').html('<span id="rep_name">' + data['html'] + '</span>');
                        }
					});
            }


这是我的php控制器功能


this is my php controller function

public function loadRep($dealerId,$userType=null){
        $app = Wow_Application::getInstance();
		$output= false;
        $dealerId = Wow_Utility::getGPValue('storeId');
        if($dealerId){
			$dealer = new Wow_Dealerstore_Model;
			$dealer->load($dealerId);
			$rep = $dealer->loadRep($dealerId,$userType);
			$output['html'] = $rep;
		}
		
		$this->document->loadJson(Zend_Json::encode($output));
	}


我只想显示值而不是单词对象.

谢谢


I would just like it to display the value instead of the word object.

Thanks

推荐答案

.ajax({ 类型:" , dataType:" , 网址:' {
.ajax({ type: "POST", dataType: "json", url: '{


ajaxUrl}' + ' & act = loadRep', 数据:' storeId = {
ajaxUrl}' + '&act=loadRep', data: 'storeId={


storeId}', 成功:功能(数据){
storeId}', success: function(data){


这篇关于PHP/JSON错误,不显示值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆