Edit in JSRUN

function change() {
  var src = jQuery("#content").val();
  jQuery("#content").val(jQuery("#result").val());
  jQuery("#result").val(src);
}
function Escape_encode() {
  jQuery("#result").val(escape(jQuery("#content").val()));
}
function Escape_decode() {
  jQuery("#result").val(unescape(jQuery("#content").val()));
}

function Empty() {
  document.getElementById('content').value = '';
  document.getElementById('result').value = '';
  document.getElementById('content').select();
}

function GetFocus() {
  document.getElementById('content').focus();
}
<div class="panel panel-default">
<div class="panel-heading">
<div class="media">
<div class="media-body">
<h4 class="media-heading">Escape加密、解密.</h4> 
</div>
</div>
</div>
<div class="panel-body">
  <div>
    <textarea id="content" name="RawJson" class="json_input" rows="6" style="width: 100%;"
    spellcheck="false" placeholder="请输入Escape编码字符串"></textarea>
  </div>
  <div class="btn-group" role="group" aria-label="...">
    <button type="button" class="btn btn-primary" onclick="Escape_encode();">
      Escape加密
    </button>
    <button type="button" class="btn btn-primary" onclick="Escape_decode();">
      Escape解密
    </button>
    <button type="button" class="btn btn-primary" onclick="change();">
      内容交换
    </button>
    <button type="button" class="btn btn-danger" onclick="Empty();">
      清空结果
    </button>
  </div>
  <div style="padding-top: 10px;">
    <textarea id="result" name="RawJson" class="json_input" rows="6" style="width: 100%;"
    spellcheck="false" placeholder="加密或解密后的Escape编码字符串"></textarea>
  </div>
</div>
<input type="hidden" id="encode" value="1" />
<div class="panel-footer">
</div>
</div>

            

本项目引用的自定义外部资源