javaScript, PHP connection to takeaway ticket machine printer solution (calling Jiabo, Xinye, etc.)
Foreword: Current development requires a computer to directly connect to a takeout receipt machine to print receipts and access various information. Using HttpPrinter finally solved this problem. Effect: PHP and Javascript directly connect to the ticket machine and automatically issue tickets. Supported small ticket machines: The ones currently tested include: computer A4 printer, Jiabo GP58MBIII (USB direct connection), Xinye xp-58IIL (USB). In principle, it can support all USB-connected ticket machines. The current template is set according to 58MM. // Print POS Ticket Begin Function Print (ARR) { var ip = $ (“#ip”). Val (); VAR PORT = $(“#port”).val(); if(ip==””||port==””){alert(“ip,port cannot be empty”); return false;}<br /// Treatment of food data var Foodsjson = & # 39; & # 39; for (var I = 0; i { Foodsjson = Foodsjsjson + & # 39; {“” shangpname”:'+arr.foods[i].name +',”shuliang”:'+ arr.foods[i].count+', “je”:& #39;+ arr.foods[i].price+'},'; } var msg = '{' '”method”:”' + 'printreport' +'”' /*Report type gridreport fastreport reportmachine If empty, it will default to gridreport */ +',”ReportType”:”' + 'fastreport' +'”' /*Report type gridreport fastreport reportmachine If empty, it will default to gridreport */ +& # 39;, “Reportname”: “& # 39; +& # 39; AAALQS.FR3 &…
css web page layout positioning flow, JavaScript
day55 1. Positioning flow 1. Relative positioning 1.1 Points to note in relative positioning 1.2 Application scenarios of relative alignment 2. Absolute positioning 2.1 Reference point of absolute positioning 2.2 Notes on absolute positioning 2.3 Horizontal centering of absolute positioning 2.4 Application scenarios of absolute positioning 3. Fixed positioning 4. Static positioning 5.z-index 2. Javascript 1. Introduction to Javascript 1.1Composition of javasc 2. How to introduce Javascript li> 3. Javascript syntax specifications 4. Variables 4.1 Syntax for declaring variables 4.2 Variable name naming specifications 4.3 let in ES6 5. Data types and built-in methods 5.1 Value (number ) 5.2 String (string) 5.3 Boolean value (Boolean) 5.4null and undefined 5.5 Commonly used built-in objects 1. Positioning flow 1. Relative positioning Relative positioning means moving relative to its previous position in the standard stream Format: position:relativeNeed to match the following Use 4 attributes together top:20px;left:30px;right:40px;bottom:50px; Code Demo 1.1 Notes on relative positioning 1 In relative positioning, only one top/bottom and one left/right can be used for the positioning attributes in the same direction. Only one can be used2 Relative positioning does not break away from the standard flow, and will continue to occupy a space in the standard flow3 Since relative positioning…
How to use multi-layer single quotation marks and double quotation mark nesting when spelling HTML in ASP, VB, JAVASCRIPT, practical (reprinted)
Single quotation mark, Double quotation mark in s and html and their escaping use (conversion) Collection Judge or get the value of related characters in js , or these are used in many cases when assigning HTML values. This is also the problem I just encountered. By referring to the article below, everything was solved. I will excerpt it and take notes! Haha… —— When writing the onclick event processing code for a button on a web page, I accidentally wrote it as follows: After IE prompts an error, then casually change it to: Result Still error. At this time, I couldn’t figure it out, although I knew the most direct solution was to write it like this: But why does the escape character \ in Javascript have no effect? Later I found a normal piece of code: Only then did I understand that at this time, It still falls under the jurisdiction of HTML, so the escape characters should be HTML, not Javascript. The method of using two double quotes is Vbscript, \” is used by Javascript, and HTML uses “. In addition, you can also use: “, '. The various expression methods are listed below: <input value="Outerdouble quotesInnerdouble…
JavaScript, only you can’t think of it
2012-07-11 10:38 justjavac iteye I want to comment (1) Font size: T | T Over the past few years, my attitude towards Javascript has completely changed. Javascript has “grown up”. I can guarantee that many Javascript developers will not agree with my previous statement. They will say that Javascript has always been a very powerful, mature and popular language. AD: For a long time, Javascript was a second-class citizen among programming languages in my eyes. In the past, it was often the source of many security problems. Like glue, it could stick HTML applications and styles together, but no one used it to write programs formally; this situation was too common. Java, Ruby, and Python are the languages that can actually be used to write programs. Over the past few years, my attitude towards Javascript has completely changed. Javascript has “grown up”. I guarantee that many Javascript developers will not agree with my previous statement. They will say that Javascript has always been a very powerful, mature and popular language. Maybe they are right. In fact, as long as it is a complete programming language, it can be used to write programs, including nonsense things like BASIC. For a language…
Introduction to JSF2, Part 3: Event handling, JavaScript
js java ip ajax future include server char Map Write your review! Come on, watch it all Member login | User registration Recommended reading (adsbygoogle = window.adsbygoogle || []).push({}); <!– –> .syntaxhighlighter{ width: 740px; padding-top:40px;padding-bottom:20px; border: 1px solid #333; background: url(“/style/SyntaxHighlighter/top_bg.svg”); background-size: 43px; background-repeat: no-repeat; margin-bottom: -7px; border-radius: 15px; background-position: 16px 12px; padding-left: 10px; } .gutter{ display: none; }
JavaScript, positioning, floating, tips, tooltips, FixedTips, Tip
JavaScript, positioning, floating, prompts, tooltips, FixedTips, Tip Program Description [Tip Object] The Tip object is a container used to display prompt information, and the program is represented by the Tip attribute. There are no requirements for this, some settings will be made to it when the program is initialized. First make the following settings: Codethis._cssTip.margin0;this._cssTip.position"absolute";this._cssTip.visibility"hidden
javascript,javascript translation
List of contents of this article: 1. What does Javascript mean 2. What does Javascript do 3. What does Javascript mean 4. What is Javascript? 5. What is Javascript and what are its characteristics? What does Javascript mean? Javascript is an object-based and Event-driven and secure scripting language. Javascript scripting language, like other languages, has its own basic data types, expressions and arithmetic operators, and the basic program framework of the program. Javascript provides four basic data types and two special data types for processing data and text. Variables provide a place to store information, and expressions can complete more complex information processing. The difference between Javascript and Java Java code must be compiled to be executed, while Javascript does not need to be compiled and only needs to be interpreted and executed by the browser. Although both Java and Javascript can be executed on the server and the client, Java mostly runs on the server, while Javascript mostly runs on the client. Javascript uses loose data types, while Java uses strict data types. What does Javascript do? Javascript (“JS” for short) is a lightweight, interpreted or just-in-time compiled programming language with function priority. . Although it is famous as…
javascript&&,javascript variable naming rules
What does Javascript do? Javascript (“JS” for short) is a lightweight, interpreted or just-in-time compiled programming language with function priority. Although it is famous as a scripting language for developing Web pages, it is also used in many non-browser environments. Javascript is based on prototype programming, a multi-paradigm dynamic scripting language, and supports object-oriented, imperative, declarative, and functional programming paradigm. Javascript is an interpreted language, which is different from c++ and c languages (compiled first and then executed). Each line must be interpreted during the running of the program. Javascript is not only an object-based scripting language, it can both create objects and use existing objects directly. Javascript is an event-driven scripting language. For example, when a user visits a web page, the mouse clicks, moves, etc. Javascript can respond directly to these times and does not need to respond to user behavior through the web server. Javascript features: 1. Simplicity Javascript is a weakly typed variable type and has no strict requirements for data types. Its design is simple and compact. 2. Cross-platform Javascript does not need to rely on the operating system. As long as the browser supports it, it can be directly brought to any script language…
PHPrestful cross-domain, restful, jquery_RESTful under IIS7.5 cannot cross-domain PUT and POST, restful, jquery, javascript, cross-domain phpStudy…
RESTful under IIS7.5 cannot cross-domain PUT and POST The test with Postman was successful,but the test failed in the jQuery code written by myself Get&# xff0c;But PUT and POST cannot be performed The following settings have been made for web.config in IIS7.5 jQuery code $.ajax({ url: 'http://xxx.xxx.xxx.xxx:nnnn/api/apps/791', type: 'PUT' , data: '{“Name”: “Tom”}', dataType: 'json', contentType: 'application/json', crossDomain: true, beforeSend: function( xhr ) { xhr. setRequestHeader('X-Requested-With', 'jQuery'); }, success: function(response) { } p> console.log('ok'); } }); Browser Chrome 53 General Request URL:http://XXX.XXX.XXX.XXX:10088/api/apps/791 Request Method:OPTIONS Status Code:405 Method Not Allowed Remote Address:XXX.XXX.XXX.XXX:10088 Response Headers Access-Control-Allow -Headers:X-Requested-With Access-Control-Allow-Methods:GET, PUT, POST, DELETE, OPTIONS Access-Control-Allow-Origin:* Allow:PUT,GET Cache-Control:no-cache Content-Length:66 Content-Type: application/json ; charset=utf-8 Date:Tue, 13 Sep 2016 02:00:41 GMT Expires:-1 Pragma:no- cache Server:Microsoft-IIS/7.5 X-AspNet-Version:4.0.30319 X-Powered-By:ASP.NET Request Headers Accept:*/* Accept-Encoding:gzip, deflate, sdch Accept-Language:zh-CN,zh ;q=0.8,en;q=0.6,ja;q=0.4,zh-TW;q=0.2 Access-Control-Request-Headers:content-type , x-requested-with Access-Control-Request-Method:POST Connection:keep-alive Host:XXX.XXX.XXX.XXX :10088 Origin:http://XXX.XXX.XXX.YYY:7788 Referer:http://XXX.XXX.XXX.YYY:7788/jqdebug.html User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36 Related reading: Webuploader plug-in ie9 error reporting problem fs.createReadStream(filepath).pipe(response); What does this sentence mean? Input under IOS The keyboard cannot be evoked after the element is focused Vue2.0 brother component communication ,data transfer is successful,but the data of the component cannot be changed ajax velocity front-end uses velocity in Is there…
LeetCode problem solution: The sword points to Offer40. The smallest k number, binary heap, JavaScript, detailed comments
Original title link: https:/ /leetcode-cn.com/problems/zui-xiao-de-kge-shu-lcof/ Problem-solving ideas: Heap can be used for this problem The solution is to take advantage of the fact that the heap can quickly insert and remove elements, and can always be sorted as required. Use Javascript to implement a binary heap, store the array elements into the heap in sequence, and then take out k elements in sequence. /** * @param {number[]} arr * @param {number} k * @return {number[]} */var getLeastNumbers = function(arr, k) { let result = []; // Store the result let heap = new BinaryHeap((a , b) => a – b); // Create a heap, sort the elements from small to large // Insert all array elements into the heap for (let i = 0; i heap.insert(arr[ i]); } // Remove k elements from the heap in order for (let j = 0; j <k; j++) { result.push(heap.deleteHead( )); } return result;};class BinaryHeap { constructor(compare) { this.data = []; // Use array to store heap this.compare = compare; // Sorting function of heap elements } // Insert elements into heap insert(value) { this.insertAt(this.data.length, value) ; } // Insert the element at the index position insertAt(index, value) { // Insert the element…