II: Nodejs+express+redis+bootstrap table+jquery UI

Source: Internet
Author: User
Tags readfile

Introduction: Make a real-time system of quantitative investment.

Comprehensive:

Add the record, the order changes, after refresh, can normal refresh? Can be refreshed normally, but in order to change back.

When using FS ReadFile in Express, you need to write the path with Path.join, and if you use a route, you will read out the numbers.
JSON reads and stores, Json.parse (data), becomes a JSON object, json.stringify (data), and JSON into a string, if it is written in the. JSON, there will be no appropriate
The indentation. So you need json.stringify (data, function (key, value) {return value;}, 4). Thanks to my solid basic skills, read the book fortunately did not forget.
But the feeling stringify function has a bit of a bad place, if not write the second argument (function), it will not work, it will not recognize the second is not a function, directly see it as the first
Three parameters?

data.constructor--can see the type of the function. Don't take everything as an object.

Fq on Mac, you have to BLCU. If you use 360WiFi, you will have a problem with the same application.

var item = {};for (var i=0; i<keys.length; i++) {    (function (num) {        console.log (' num: ' +num);        item[' id '] = num;        item[' reqstr '] = Keys[num];        Result_array.push (item);        Console.log (' Result_array: ' +json.stringify (Result_array));    }) (i);}   A similar closure occurs and the item initialization needs to be written in the closure.

Linux under/,win7 is \ \. Represents a path in a different way.

Use $.get, $post * (), to return JSON, or the success method will not be called.

Hget, because the returned value is already there, now. And I added one myself.

jquery UI:

When you use the dialog of the jquery UI, when you open the dialog box and press ENTER on your keyboard, the page refreshes. You need to capture the Enter event in open and cancel the event.

$ (this). Bind ("Keypress.ui-dialog", function (event) {if (Event.keycode = = $.ui.keycode.enter) {        return false;}});

Try to still use jquery, jquery Ui.js,jqeury ui.css CDN, local words, some icons do not load.

Express

When using FS ReadFile in Express, you need to write the path with Path.join, and if you use a route, you will read out the numbers.

PROCESS.CWD () Express project root directory, Linux pwd command can also be seen in the root directory.

Json2.js generally only needs to be used in the client.

II: Nodejs+express+redis+bootstrap table+jquery UI

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.