English 中文(简体)
JQuery json的西班牙人
原标题:Spanish charecters in JQuery json get

• 在用户选择一种选择时,使用该代码将内容从非行装:

<script type="text/javascript" >
    function setStore(value)
    {
        $.get("getStoreMetaInfo.php", {store_id: value, meta_type : 3},function(data){
                document.getElementById("tvaddedtext").value =  data.tv_lamp;
                document.getElementById("parttvaddedtext").value =  data.tv_part_no;
           }, "json");
    }

</script>  

Info.php • Im从亚洲开发银行中选取,创建联系阵列,并做json_encode :

$meta=mysql_fetch_array($result_meta);
$result = array("tv_lamp"=>$meta[ tv_lamp ],"tv_part_no"=>$meta[ tv_part_no ],      
"projector_lamp"=>$meta[ projector_lamp ],"projector_part_no"=>$meta[ projector_part_no ]);
$out = json_encode($result);
echo $out;

当我从行文中拿到英文时,一切工作都是罚款的,但当我拿到被标语者,例如,阵列的计票人会照此办理(在使用var时):

array(4) {
  ["tv_lamp"]=>
  string(40) "%BRAND_PROJECTOR_MODEL% TV de la L�mpara"
  ["tv_part_no"]=>
  string(32) "%BRAND_PARTNUM% TV de la L�mpara"
  ["projector_lamp"]=>
  string(44) "%BRAND_PROJECTOR_MODEL% Lamparas Proyectores"
  ["projector_part_no"]=>
  string(37) "%BRAND_PARTNUM%  Lamparas Proyectores"
}

和json物体,我看上去(在火力反应中):

{"tv_lamp":null,"tv_part_no":null,"projector_lamp":"%BRAND_PROJECTOR_MODEL% Lamparas Proyectores","projector_part_no":"%BRAND_PARTNUM%  Lamparas Proyectores"}

(前两个参数是空的)

我怎么能够让 j子与这些char子一起工作?

在使用“建筑”功能的Im的网页上,我有:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

页: 1

问题回答

检查贵方档案中的编码应为UTF-8。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签