C # JSON conversion and encoding conversion
I. C # Json Conversion
Download and install Newtonsoft. Json. dll and add using Newtonsoft. Json; using Newtonsoft. Json. Converters.
Convert String to JSON
String json = JsonConvert. SerializeObject (str )
the above example seems simple, but the result is not easy to understand, so it is easy to think about it. -- ". isn't x pointing to object? Why is log (a. x) undefined ?" "Shouldn't B. x be the same as a. x? There are actually two objects for log
JavaScript determines that the input content cannot be all spaces. It is used to avoid entering all spaces in the content of the input box:Copy codeThe Code is as follows:
How to specify the div area on a JavaScript page: Use window. open () open a new page (window) in the browser, and use expose Doc ument. write () writes the content of the specified div area to the new window document, document. close () close the
Query wait: the query is in progress. Please wait...
Copy codeThe Code is as follows: query in progress. Please wait...
querying, please wait...
Jquery code
Copy codeThe Code is as follows: querying, please wait...
Formpanel can be used as follows:Copy codeThe Code is as follows:Var panel = Ext. create ('ext. form. Panel ',{Title: 'simple Form ',BodyPadding: 5,Width: 350,// The URL will be submitted through the AJAX request// Url: 'save-form. php ',// The form
For some reason, you need to create a checkboxgroup that controls the display of grid columns. Although the gridpanel in EXTJS4 can bring its own list to control the hidden display of columns, there is such a need (to be clear at a glance)Below
Js allows you to quickly convert pages in simplified and traditional Chinese characters and retain the current status using cookies. This is a very good result. I have tried it all the time and did not dare to share it with you! Download the
Some website content pages usually display controlled texts in three ways: large, medium, and small. Next we will record this small function, it is helpful to improve the user experience of the website!
javascript control text display a
Javascript is used to integer decimal places. It mainly uses three js functions (Math. ceil, Math. round, Math. floor). The usage and introduction are as follows:
/* Math. ceil returns the smallest integer but not smaller than itself. Math. round
The JavaScript built-in object Math allows you to execute general mathematical tasks (some mathematical operations ).
Use the attributes and method Syntax of Math:
Var pi_value = Math. PI; // use the Math property var sqrt_value = Math. sqrt (15); //
Functions related to cookie operations in JavaScript.
// Set the cookie function. There are three parameters: cookie name, value, and cookie retention time. Unit: Day function SetCookie (name, value, days) {var days = arguments [2]? Arguments [2]: 30
The JavaScript method to remove string spaces is a perfect summary.
Remove all spaces (two spaces contain spaces in the middle of the string ]:
str = str.replace(/\s+/g,'');
Remove two spaces:
str = str.replace(/^\s+|\s+$/g,'');
Remove the left
Use JavaScript to verify whether the website address is correct, whether the email format is correct, whether it is the range of numbers and numbers, the length of passwords or characters, and whether it is equal and the required minimum String
This article summarizes three methods to use Javascript to intercept strings, and also summarizes the two methods to intercept Chinese strings.
1. substring Method
Definition and usageThe substring method is used to extract characters of a string
Today, in a project that used to use AJAX to automatically narrow down the selected content, it is suddenly found that when the name is entered, if there are special characters in the input, the selected content will not change, that is to say, the
A code that uses Javascript to check the strength of passwords entered by users. The following code mainly checks the strength of passwords entered by users in the following four aspects, if you are interested, you can add or modify it to the
We will share two ways to verify date and time in javascript. For more information, see the following code.
// | Date validity verification // | format: YYYY-MM-DD or YYYY/MM/DD function IsValidDate (DateStr) {var sDate = DateStr. replace (/(^ \ s +
Use JavaScript to calculate the number of characters currently entered by the user. Function Code:
JavaScript count 0 Articles you may be interested in
Php calculates the number of weeks in a year or January.
Js restrictions: Only
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