Category:WEB Front End

  • Complete example of JS document form form element operation

    Time:2020-7-13

    This paper describes the operation of JS document form form elements. For your reference, the details are as follows: <html> <head> < title > formform operation <meta charset=”UTF-8″/> <script type=”text/javascript”> function testForm(){ //The first way to get the form object is through ID, which is a common method var fm=document.getElementById(“fm”); Alert (FM); // output the […]

  • Implementation of HTML5 video auto crossing from adaptive page and click play function

    Time:2020-7-13

    preface This code is applicable to 1920 * 1080 video. If it is a video of other sizes, you need to change several numbers in JS code to recalculate the video width and height design sketch As shown in the figure, In the long screen mobile phone, the horizontal video is full of height, and […]

  • HTML table table table data to JSON format example code

    Time:2020-7-13

    The JavaScript function for converting table data to JSON format is as follows Copy code The code is as follows: <script> var keysArr = new Array(“key0”, “key1″,”key2”); Function tabletojson (tableid) {/ / tableid is the table name of the table you want to convert. It is a string, such as “example”var rows = document.getElementById (tableid). […]

  • CSS implementation of div Concave Angle Style example code

    Time:2020-7-13

    In normal development, we usually use the rounded corners to be convex, that is, the border radius attribute. If there is a concave angle, there are two ways to realize it. One is to use the background image directly, the other is to use CSS. The attributes used are background or background image combined with […]

  • Ajax asynchronous upload file instance code sharing

    Time:2020-7-13

    I don’t want to say much. I’ll give you some dry goods. I’m sorry for the poor writing. The specific codes are as follows: <!DOCTYPE html> <html> <head> <meta name=”viewport” content=”width=device-width” /> <script src=”~/Scripts/jquery-1.8.2.min.js”></script> <title>Index</title> <script> $(function() { $(‘:button’).click(function () { var formData = new FormData(); var file = $(“input[type=’file’]”)[0].files[0]; formData.append(“files”, file); $.ajax({ url: ‘/Upload/Upload’, […]

  • Classes in TS

    Time:2020-7-13

    In addition to implementing the functions of all classes in ES6, typescript has added some new usages (part ES7). 1、 Main usage of classes in ES6: 1. UseclassDefining classes, usingconstructorDefine the constructor.adoptnewWhen a new instance is generated, the constructor is called automatically. 2. UseextendsKeyword implementation inheritance, subclass usesuperKeyword to call the constructor and method of […]

  • Unveiling webpack plugin

    Time:2020-7-13

    preface Plugins are a key part of the webpack ecosystem. It provides a powerful way for the community to extend and develop the compilation process of webpack. This article will try to explore the webpack plugin, how it works, and how to develop a plugin. 1、 The role of plugin For the role of plugin, […]

  • How to publish NPM packages for projects created with vue-cli3.0

    Time:2020-7-13

    How to publish NPM packages for projects created with vue-cli3.0 in usevueWhen developing a project, if we want to release a package, sometimes we are a bit confused and don’t know how to modify the default settings of scaffolding. Here are some common operations. establish index.js Export the module We need to export the components […]

  • Turn.js Realize the effect of turning books (adaptive single and double page)

    Time:2020-7-11

    Source: https://www.cnblogs.com/hellman/p/10683492.htmlAdd page number display on the basis of the above source, adaptive single and double pagePC side effect: Mobile display: Source code download address: http://www.luanxin.top/index.php/archives/7/

  • JS Baidu map road book — dynamic route

    Time:2020-7-11

    JS Baidu map road book — dynamic route CanvasLayer body, html,#container {width: 100%;height: 100%;overflow: hidden; margin:0;font-family “Microsoft YaHei”;} //Baidu map API function var SMSS={MAP:{}}; var map = new BMap.Map(“container”); var point = new BMap.Point(113.290512, 23.161744); map.centerAndZoom(point, 15); map.enableScrollWheelZoom(); map.enableKeyboard(); map.enableDragging(); map.setMapStyleV2({styleJson: eval(“mapStyleBrown”)}); // var bmap = document.getElementById(‘map’); // var map = new BMap.Map(“map”); map.enableScrollWheelZoom (true); […]

  • Using Vue to realize single selection and multiple selection of check box

    Time:2020-7-11

      Interface style: full name phone number Application time operation {{item.trueName}} {{item.phone}} {{item.addTime}} adopt reject No data available Key parameters: Hasallchecked select all method: //Select all chooseAll(val) { var self = this if (val) { self.applyUserList.forEach(ele => { ele.hasSelected = true }) } else { self.applyUserList.forEach(ele => { ele.hasSelected = false }) } }, Explanation: […]

  • The reason and solution of Ajax internal value cannot be called outside

    Time:2020-7-11

    The reason and solution of Ajax internal value cannot be called outside var id=‘123′; $.ajax({ url:’http://www.xxx.com/ajax’, type:’post’, dataType: “json”, data:{wurl:w_url,murl:m_url}, async : turn, error:function(){ }, success:function(data){ var id= data[‘id’]; console.log (ID) // here comes 100 } }) console.log (ID); // here comes 123 The problem lies in the async synchronization guide option of Ajax. If […]