M
M
Mr1is2018-11-09 16:40:34
JavaScript
Mr1is, 2018-11-09 16:40:34

How to pull from json on the server to the console value?

There is such json

{
  "document": {
    "data": {
      "docType": 122,
      "name": "Серийный номер",
      "fiscprops": [
        {
          "caption": "ЗН ККТ",
          "printable": "ЗН ККТ\t123456789012",
          "tag": 1013,
          "value": "123456789012"
        }
      ]
    },
    "result": 0
  },
  "protocol": 1,
  "version": "1.0"
}

At localhost:8888/get_serial.json
You need to get these values ​​from it 123456789012
--------------------------------- ---------------------------------
so far I think so, but in theory it should display all json
$( ".sev_al request_service" ).click(function() {
   var rawbase = 'http://localhost:8888/get_serial.json'
 $.getJSON(rawbase, function( data )) {
 console.log(data);});
}

throws an error SyntaxError: missing { before function body request.js:3:36

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question