Tag:json

  • Ajax, JSON, cross domain JSON summary

    Time:2019-10-21

    Preface: This article summarizes Ajax. The books are all about the introduction of basic knowledge, but there is no example. So I refer to the course on mooc.com and combine with the actual example to summarize. The background of the course is written in PHP, and this article does not introduce it. Role of 1.ajax […]

  • The first and second problems of jsoncpp Library

    Time:2019-10-20

    JSON is a data format commonly used in data exchange. C + + standard library does not contain any implementation of JSON standard, so we need to rely on some third-party libraries, jsoncpp is a common library. Because jsoncpp is often used in work, it is found that there are many problems in this library. […]

  • PHP uses curl to pass JSON data to the other party and display the JSON returned by the other party (JSON format / API concatenation / httprequest)

    Time:2019-10-19

    Introduction to the teaching environmentServer side: Ubuntu 18.04 LTSDatabase: MariaDB 10.1.34 (MySQL)Language version: PHP 7.3Local end: MacOS High Sierra function httpRequest($api, $data_string) { $ch = curl_init($api); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( ‘Content-Type: application/json’, ‘Content-Length: ‘ . strlen($data_string)) ); $result = curl_exec($ch); curl_close($ch); return json_decode($result); } […]

  • Implementation of webgl based on HTML5 JSON and charts of echarts are displayed in the same interface

    Time:2019-10-19

    Suddenly, I have an idea that if I can put some knowledge points that are used in different ways on the same interface and put them in a box, then if I want to see something, it can be displayed directly, and the box must be able to open. I use HT to realize my […]

  • Rapid JSON parsing JSON code instances and common problems of JSON core dump

    Time:2019-10-17

    Rapid JSON parsing JSON code instance Look directly at the code: #include <iostream> #include <stdio.h> #include<unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include<sstream> //Please download the open source rapid JSON yourself #include “rapidjson/prettywriter.h” #include “rapidjson/rapidjson.h” #include “rapidjson/document.h” #include “rapidjson/stringbuffer.h” #include “rapidjson/writer.h” #include “rapidjson/memorystream.h” using namespace std; using rapidjson::Document; using rapidjson::StringBuffer; using rapidjson::Writer; using namespace rapidjson; […]

  • The Method of Using JSON in Go Language

    Time:2019-10-13

    Encode Encoding an object into JSON data, accepting an interface {} object, returning [] byte and error: func Marshal(v interface{}) ([]byte, error) The Marshal function will recursively traverse the entire object, encoding the object according to the member type in turn. The type conversion rules are as follows: Boolean type converted to JSONNumber converted to […]

  • JSON error: Use of overloaded operator [] is ambiguous error resolution

    Time:2019-10-11

    Recently, when using JSON arrays, there was a problem with using 0 as subscript (use of overloaded operator [] is ambiguous), but with 1 as subscript, there was no problem, and I was drunk. After searching all over the internet, I found that there were also netizens. // Note: //int x = a[0].GetInt(); // Error: […]

  • (Ajax) talking about the principle and implementation of JSONP

    Time:2019-10-6

    I. What is it?JSONP 1.1 Homology Strategy If two pages have the sameAgreement,port(if specified), andHostSo these two pages belong to the same pagesource。Homologous strategies can be divided into: DOMHomologous Policy: Prohibit Different Source PagesDOMOperation XMLHttpRequestHomologous Policy: No Launching to Addresses of Different SourcesHTTPrequestThus it can be seen,AjaxCross-border is prohibited. 1.2 JSONPPrinciple JSONPyesJSON with PaddingAbbreviation, commonly […]

  • Conversion between XML and JSON

    Time:2019-10-5

    With xml2js, NPM downloads are high weeklynpm i xml2js -S const xml2js = require(‘xml2js’) let builder = new xml2js.Builder() // json => xml let parser = new xml2js.Parser() // xml => json // In particular, parser. parseString () is a synchronization method… It just looks asynchronous. parser.parseString(fs.readFileSync(filePath, ‘utf-8’), function (err, content) { if (err) { […]

  • Automating tasks with npm-run

    Time:2019-10-5

    There are many good tools for building JavaScript automatically. But few people actually know.npm runCommands do this well and are easy to configure. James Halliday shared his use on his blognpm runSome experience in automation tasks: script NPM will be in the projectpackage.jsonSearching in DocumentsscriptsRegions, includingnpm testandnpm startWait for orders. actuallynpm testandnpm startyesnpm run testandnpm […]

  • Transfer JSON Data by AXIS2

    Time:2019-10-4

    Axis2 is a popular Web Service engine. Web Service is used in many different scenarios. For example, Web Service can be used to publish methods of server-side Java classes for invocation using different clients. This can effectively integrate a variety of different technologies to complete the application system. WebService is also often used in SOA […]

  • Day 23: Use TimelineJS to build a beautiful timeline

    Time:2019-10-3

    Editor’s Note: We found an interesting series of articles, “30 days to learn 30 new technologies”, which are being translated, updated one day, year-end gift packs. The following is the content of the 23rd day. It took me a lot of time to decide on today’s topic. I started to study brain, then went to […]