imitating firebug Net tab

蓝咒 提交于 2019-12-12 03:46:56

问题


In Firebug net tab, in Response\Json tabs, I can see the value returned from CGI, using ajax:

I want to verify the exact characters values, so I can translate it into readable characters (and in the next step, store my values in the same encoding.)

How can I get this value in Javascript?

I tried to use encodeURI() on the ajax returned response, but I only got some [%EF%BF%BD] (the black-diamond-question-mark)

my JS code:
  var jqxhr = $.ajax({
        type: "GET",
        url: AJAX_CGI_URL,
        dataType : 'json',
        cache: false,
        data: { name: AJAX_PARAMS }
        })

    . . .

    case "P_D":
      for(var j = 0; j < varVal.length; j++) {
        jj=j+1;
        updateWidget("d" + jj, varVal[j]);
        var res = encodeURI(varVal[j]);
        console.log(jj + ": " + res);
    } break;


  =>
  console log:
  GET http://.../cgi-bin/xjgetvar.cgi ...
  1: %EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%20%EF%BF%BD%EF%BF%BD%EF%BF%BD
   which is actually => %EF%BF%BD %EF%BF%BD %EF%BF%BD %EF%BF%BD %20 %EF%BF%BD %EF%BF%BD %EF%BF%BD

[relates to my previous question - JavaScript encodes Hebrew string I thought it will be easy to get the values Firebug shows. but it is not trivial :( ]

so my question now is - How can I get the same values Firebug gets ?!

来源:https://stackoverflow.com/questions/37700122/imitating-firebug-net-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!