JavaScript, jQuery, HTML5, Node.

There are many techniques and examples, so you have to learn them slowly and practice them slowly! ! The book I am studying now is [JavaScriptPractical–—Ja vaScript, jQue span>ry, HTML5, Node.jsLarge examplesComplete] Chapter Chapter 3 Photo Display Using Javascript There are two ways to build a software design: one is to make the software so simple that no obvious defects can be found; the other is to make it so complex that no obvious defects can be found. ——C.A.R. Hoare, winner of the Turing Award in 1980 In this age of selfie narcissism, photos are meant to be shown. The binding of events has been explained in the previous chapters. This chapter mainly uses the previous knowledge to create a photo display function. The main content of this chapter: Loading of photos Mouse response Keyboard response 3.1 Functional design Function It may need to be revised repeatedly during design. What should be the standard? Should you listen to your boss or your users? Although this is an era where the customer is God, there are still some design principles to follow, because sometimes “God” makes mistakes, and more often than not “God” is fickle. (1) The principle of avoiding duplication…

JavaScript,iterateclassandonclickshowhiddentr – JavaScript,iterateclassandonclickshowhiddentr

No jQuery. I want to loop through unknown amount of table rows with the same class and add a click event that will change the class of hidden table row that is right bellow the one i clicked. All i managed to do is open all hidden rows on click.. No jQuery. I want to loop through an unknown number of table rows with the same class and add a click event that will change the class of the hidden table row that is right after the row I clicked on. What I’ve managed to do is open all hidden rows on click. Here is a fiddle with my current progres: jsfiddle.net This is my current progress fiddle: jsfiddle.net An my js code, that obviously doesn’t work… My js code obviously doesn’t work… var x = document.querySelectorAll(‘.table’); var y = document.querySelectorAll(“.content”); for (var i = 0; i <x.length; i++) { x[i].addEventListener('click', function(event) { for (var j = 0; j <y.length; j++) { if (i === j) { y[j].style.display = "block"; } } }); } EDIT: Also i saw that it is bad to make functions inside loops. Would appreciate some feedback on that as well… EDIT: I also see that…

Recommended ASP.NET English technical articles [02/17-02/23]: AJAX, History, jQuery, best practices, LINQ, Visual Studio, JavaScript, IIS

Recommended ASP.NET English technical articles [02/17-02/23]: AJAX, History, jQuery, best practices, LINQ, Visual Studio, JavaScript, IIS

Abstract Continue to recommend. There are 7 articles in this issue: 10 Best Practices for ASP.NET Applications in Production Environments Introduction to the use of ASP.NET AJAX History control Enable jQuery to support IntelliSense in Visual Studio 2008 LINQ to JSON beta Visual Studio theme style collection Embedding ASP.NET server-side variables in client-side Javascript Part 2 Use Visual Studio 2008 to remotely debug web applications in IIS [1] Top 10 Best Practices for Production ASP.NET Applications (10 Best Practices for ASP.NET Applications in Production Environments) The article introduces the so-called “10 best practices for ASP.NET applications in production environments”, but it feels like a bit of a headline… Generate new encryption keys Encrypt sensitive sections of your web.config Use trusted SQL connections Set retail=”true” in your machine.config Create a new application pool for your site Set the memory limit for your application pool Create and appropriately use an app_Offline.htm file Develop a repeatable deployment process and automate it Build and reference release versions of all assemblies Load test [2] ASP.NET AJAX History Tutorials (Introduction to the use of ASP.NET AJAX History control) The newly introduced History control of ASP.NET AJAX can help us maintain the “history” record of the page…

JavaScript, replace multiple numbers in a string with changed numbers using regular expressions

For example var s = “123aaa345bbb999ddd’ Now there is a number var a = [111,222,333] The numbers in s are not necessarily 123, 345 and 999. Now I want to replace the first number that appears in the middle with 111, the second 222 and the third 333. How to do it? Among them, I can use match to extract 123, 345 and 999, but I just don’t know how to replace them. ​ In actual situation, the number in string s is not necessarily three, nor does it necessarily match the number of replacement numbers in a, so it cannot be hard-coded. Nor can you write like this: var r = /[^\d]/g; var old = s.match(r); for(var i=0; i { s.replace(old[i], a[i]); } Because there is a bug in this, the added string is “1a2b3c” and needs to be replaced with (2,5,6), then After the first round of looping, the string becomes “2a2b3c” In the second round, the 2 between a and b was supposed to be replaced, but the result was that the first 2 was replaced with 5. 4 solutions #1 What if the numeric part has four or more numeric fields? 123aaa345bbb999ddd666bbb So the first 3…

Wu Yuxiong’s artificial intelligence java, javascript, HTML5, python, oracle – implementation of a concise version of the WEB side review code of the intelligent medical system

Wu Yuxiong’s artificial intelligence java, javascript, HTML5, python, oracle – implementation of a concise version of the WEB side review code of the intelligent medical system

import sys import os import time importoperator import cx_Oracle import numpy as np import pandas as pd import tensorflow as tf conn=cx_Oracle.connect(‘doctor/admin@localhost:1521/tszr’) cursor = conn.cursor() def printHistory(userid): sql = “select username,sex,age,province,area,bumen,ke,result,chufang,jianyi,yiyuaan,yisheng,jianchaxiang,zhenduanriqi from zhenduanjilutable where userid= ‘%d'” % userid cursor.execute(sql) rows = cursor.fetchall() zhenduanjilu = [] for row in rows: temp = [] temp.append(row[0]) temp.append(row[1]) temp.append(row[2]) temp.append(row[3]) temp.append(row[4]) temp.append(row[5]) temp.append(row[6]) temp.append(row[7]) temp.append(row[8]) temp.append(row[9]) temp.append(row[10]) temp.append(row[11]) temp.append(row[12]) temp.append(row[13]) zhenduanjilu.append(temp) print(“====================Print diagnostic history=== ==================”) for i in range(len(zhenduanjilu)): print(“————–>>No.: ” +str(i+1)+”Diagnosis<<——————- “) print(” Name: “+zhenduanjilu[i][0]) print(” Gender: “+zhenduanjilu[i][1]) print(” Age: “+str(zhenduanjilu[i][2 ])) print(” Province: “+zhenduanjilu[i][3]) print(” Urban area: “+zhenduanjilu[i][4] ) print(” Outpatient department: “+zhenduanjilu[i][5] ) print(” Outpatient subjects: “+zhenduanjilu[i][6] ) print(” Diagnosis result: “+zhenduanjilu[i][7] ) print(” Medical prescription: “+zhenduanjilu[i][8] ) print(” Health advice: “+zhenduanjilu[i][9] ) print(” Recommended hospital: “+zhenduanjilu[i][10] ) print(” Recommended doctor: “+zhenduanjilu[i][11] ) print(” Suggested check items: “+zhenduanjilu[i][12 ]) print(” Diagnosis date: “+str(zhenduanjilu[i][13])) # printHistory(6) <%– Document: ALSelectHistory Created on : 2018-10-9, 21:28:13 Author: acer –%> <%@page import=”java.util.Iterator “%> <%@page import=”java.util.ArrayList “%> <%@page import=”java.util.List “%> <%@page import=”java.io.InputStreamReader “%> <%@page import=”java.io.Bpan >> <h2>Please enter the number of the follow-up record you need: <input type=”text” name=”hisid” value= “”/></h2> <input type=”hidden” name=”userid” value=””/> <input type=”hidden” name=”username” value=””/> <input type=”hidden” name=”province” value=””/> <input type=”hidden” name=”administr”…

Scripting language Scripting language: Shell, JavaScript, VBScript, Perl, PHP, Python, Ruby, Lua

Today I have been studying issues such as scripting languages, and I just have the opportunity to share it with you this morning. Scripting language: Shell, Javascript, Vbscript, Perl, PHP, Python, Ruby, Lua ​ ​ Job control language and shell Shell script Such scripts are used for automated job control, i.e. starting and controlling the behavior of system programs. Most scripting language interpreters are also command line interfaces, such as Unix shell and MS-DOS command. Others, such as AppleScript, can add a scripting environment to the system, but there is no command line interface. Detailed categories include: 1.4NT 2.AppleScript 3.ARexx(Amiga Rexx) 4. bash 5.csh 6. DCL 7. JCL 8.ksh 9.Cmd.exe batch(Windows, OS/2) 10.command batch(DOS) 11. REXX 12. tcsh 13.sh 14.Winbatch 15. Windows PowerShell 16.Windows Script Host 17. zsh GUI script GUI emergence brings a professional scripting language for controlling computers. It interacts between the user and the graphical interface, menus, buttons, etc. It is often used to automate repetitive actions, or to set a standard state. In theory it can be used to control all applications running on a GUI-based computer, but in fact whether these languages ​​are supported depends on the application and the operating system itself. When interacting…

Django Chinese-style static files (css, javascript)

Django Chinese-style static files (css, javascript)

Using css, Javascript in Django templates Test environment (r’^css/(?P.*)$’, ‘django.views.static.serve’, {‘document_root’: ‘/var/www/django-demo/css ‘}),(r’^js/(?P.*)$’, ‘django.views.static.serve’, {‘document_root’: ‘/var/www/ django-demo/js’}),(r’^images/(?P.*)$’, ‘django.views.static.serve’, {‘document_root’: ‘ /var/www/django-demo/images’}), Use the following method in the template: Note: os. path.dirname(globals()[“__file__”]) to get the path of the current file, such as (r’^css/(?P.*)$’, ‘django.views .static.serve’, {‘document_root’: os.path.dirname(globals()[“__file__”])+’/css’}), You can use os.path.abspath() The function returns the absolute path of this path. ============== To reference static files such as css, js, gif, etc. in django’s template file, first create a setting.py The DEBUG switch is turned on. 1. Create a directory to store static files in the project directory, such as: medias2. Add a line to url.py patterns: (r’^site_media/(?P. *)$’,’django.views.static.serve’,{‘document_root’:settings.STATIC_PATH}), Also from django.conf import setting3. Add a line to setting.py: STATIC_PATH=’./medias’ After setting this, you can reference the static files stored in media in the template file, such as: Online environment The use of css cannot be avoided in web projects developed with Django , Javascript, js and other static files. As for the processing of these static files, Django’s official website writes: Django itself doesn’t serve static (media) files, such as images, style sheets, or video. It leaves that job to whichever Web server you choose. That is to say, Django itself…

Chapter 131, JavaScript, encapsulation library CSS

Javascript, packaging library–CSS Change the method in the package library to the prototype adding method Add 4 methods tian_jia_class() method adds a class attribute to the obtained element. The parameter is the class attribute value, which can be concatenated with 1 The yi_chu_class() method removes the class attribute from the obtained element. The parameter is the value of the class attribute to be removed, which can be concatenated with 2 she_zhi_link_css() method, set CSS style 3 in link connection, or style inline yi_chu_link_css() method, remove link connection, or style embedded, CSS style 4 Package library code 5 /** *feng_zhuang_ku_1.0 version, js packaging library, 2016/12/29: Lin Guixiu **/ /** Foreground call * Each call to $ creates a library object so that each call is an independent object. **/ var $ = function () { return new feng_zhuang_ku(); }; /** *Define package library constructor, class library **/ function feng_zhuang_ku() { /** jie_dian attribute, create array, initialize, save the obtained element node, return array **/ this.jie_dian = []; } /**Object description: * this represents the object itself * To use the library, first $() create the object * Then call methods or properties under the created object * *Outline: * Get the…

Dark Horse Programmer—A summary of basic knowledge points of Html, Css, JavaScript, and DOM

Html, Css, Javascript, DOM 1. Html html is a hypertext markup language code that starts and ends Some of the more commonly used tags: Represents the attribute that marks a line The header tag part is executed first. General styles are defined in the header to ensure they are executed first; is the standard way of writing line breaks. Mark a horizontal line General tag attributes are connected with “=”, which can be either double quotes or single quotes. You can also use it without it. Title: First-level title. Second-level title Comment format in HTML Represents the range of the encapsulation list represents the upper directory represents the lower directory Ordered Unordered packaging For example: …… …… …… Image tag: The bold and centered tag is Encapsulation area tag: or Form tags: reset clear submit submit hidden Note: If you want to submit data to the server, the components in the form must have name and value attributes. It is convenient to obtain data from the server. Onclick=””Click effect Drop-down menu      Three ways to interact with the server: 1. Enter the url address in the address bar. Use the GET method 2. Use GET method for hyperlinks 3.…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索