Javasciprt jquery function $.post to perform unresponsive solutions

Source: Internet
Author: User

This article mainly introduced the javasciprt jquery function $.post to perform the unresponsive solution, the need friend may refer to under

In the process of writing JAVASCIRPT program, the $.post method is used to send the data, if the characters contain ' < ', it will cause the $.post to be executed successfully.  The code is as follows: Var jsonstr= ' {' value ': ' ABCD<EFG '} ';    $.post (URL, {"Jsonstr": Jsonstr}, function (data, status) {});    It needs to be escaped and reused, after escaping with the following Transferredchars function, then passing the data $.post can be performed.  This function replaces ' < ' and ' > ' respectively with ' < ' and ' > '.  The code is as follows: Transferredchars=function (Htmlchars) {var TCS = Htmlchars.replace (/</g, "<");  TCS = Tcs.replace (/>/g, ">");  return TCS;  The code is as follows: Var jsonstr= ' {' value ': ' ABCD<EFG '} ';  Jsonstr=transferredchars (JSONSTR);    $.post (URL, {"Jsonstr": Jsonstr}, function (data, status) {}); The jquery version used is 1.7.1.min

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.