SyntaxError:JSON.parse:意外字符(仅在Firefox中)

时间:2013-07-04 14:29:29

标签: jquery ajax json firefox

我正在尝试将参数中的数据解析到数据库中。在IE中,Opera,chrome一切正常。在Mozilla中不起作用,写错误SyntaxError:JSON.parse:意外字符

这是代码解析:

$.getJSON("<?php echo JURI::base()?>ajax.php?get=1&param="+param,function(data){
                    if(data)
                    {

                buildPopup(data.member_from,data.member_amount);
                            //$("body #scorepopup").fadeIn("slow");
                        var ww = $(window).width();
                        var wh = $(window).height();
                        var spw = $("body #scorepopup").width();
                        var sph = $("body #scorepopup").height();
                        var spt = Math.round(wh/2-sph/2);
                        var spl =  Math.round(ww/2-spw/2);
                        $("body #scorepopup").css("top",0);
                        $("body #scorepopup").css("left",spl);
                        $("body #scorepopup").show();
                        $("body #scorepopup").animate({top:spt+"px"},600, 'easeOutBounce'); 

                    }
                }
)

功能BuildPopup

function buildPopup(member_from,member_amount){
            if($("body #scorepopup").length) {
                $("body #scorepopup").remove();
            }
            $("body").append('<div id="scorepopup"><div class="ds-point">'
                    +'<?php echo JText::_('STAN') ?>'
                    +'&nbsp;<b>'
                    +member_from
                    +'</b><br/>'
                    +'<?php echo JText::_('POINT') ?>'
                    +':&nbsp;<b>'
                    +member_amount
                    +'</b></div><div id="closescorepopup"></div></div>'
            );
        };

Google Chrome的ResponseText:

{"id":"89095","member_no":"89095","username_m":"00047","group_id":"1","dsgid":"31","user_id":"0","member_amount":"91","title":"\u041a\u043b\u0456\u0454\u043d\u0442 dsuser89095","first_name":"dsuser89095","last_name":"\u041a\u043b\u0456\u0454\u043d\u0442","address":"","zip_code":null,"city":null,"county":null,"country":null,"telephone1":"","telephone2":null,"fax":null,"email":"89095ds@ds.com.ua","website":null,"profession":null,"birth_date":"0000-00-00","additional_info":"\u041a\u043b\u0456\u0454\u043d\u0442","member_from":"2013-07-04","member_until":"0000-00-00","committee_info":null,"images":"","last_payment_date":"0000-00-00 00:00:00","suspended":"0","published":"1"}

来自Firefox的ResponseText:

п»ї{"id":"89095","member_no":"89095","username_m":"00047","group_id":"1","dsgid":"31","user_id":"0","member_amount":"91","title":"\u041a\u043b\u0456\u0454\u043d\u0442 dsuser89095","first_name":"dsuser89095","last_name":"\u041a\u043b\u0456\u0454\u043d\u0442","address":"","zip_code":null,"city":null,"county":null,"country":null,"telephone1":"","telephone2":null,"fax":null,"email":"89095ds@ds.com.ua","website":null,"profession":null,"birth_date":"0000-00-00","additional_info":"\u041a\u043b\u0456\u0454\u043d\u0442","member_from":"2013-07-04","member_until":"0000-00-00","committee_info":null,"images":"","last_payment_date":"0000-00-00 00:00:00","suspended":"0","published":"1"}

在Firefox的回应中,有一些不可读的字符:п»ї

他们来自哪里?可能通过它们在Firefox中不起作用。 我会很高兴得到任何帮助

0 个答案:

没有答案