Section 133, JavaScript, package library pop-up login box
Javascript, packaging library–pop-up login box Packaging library, two methods added yuan_su_ju_zhong() method, center the obtained block element on the page, chuang_kou_shi_jian() method, browser window Event, trigger function when the size of the window changes /** yuan_su_ju_zhong() method, center the obtained block element on the page. * Note: When using this method, you must first set the target block to (absolute positioning, position: absolute;) in css **/ feng_zhuang_ku.prototype.yuan_su_ju_zhong = function () { if (this.jie_dian.length == 1) { var yan_su = null; for (var i = 0; i <this.jie_dian.length; i++) { yan_su = this.jie_dian[i]; } var style = window.getComputedStyle ? window.getComputedStyle(yan_su, null) : null || yan_su.currentStyle ; var y_style = style.display; if (y_style === “none”) { yan_su.style.display = “block”; } var width = yan_su.offsetWidth; var height = yan_su.offsetHeight; if (y_style === “none”) { yan_su.style.display = “none”; } var top = (document.documentElement.clientHeight – height) / 2; var left = (document.documentElement.clientWidth – width) / 2; for (var ii = 0; ii <this.jie_dian.length; ii++) { this.jie_dian[ii].style.top = top + ‘px‘; this.jie_dian[ii].style.left = left + ‘px‘; } } else { alert(“The block element page is centered. Only one block element can be set. Currently there are multiple elements in the jie_dian array, please check!”) } return…
JavaScript, re-understand Array by analyzing Array.prototype.push
When reading the ECMAScript documentation, I noticed that the push method of an array is not limited to use in arrays, and is reserved as a general method. Does it mean that it can also be used in some array-like places? As for what is very similar to an array, you may immediately think of the Object object. Because Array inherits from Object, you can use [] instanceof Object and you will find that true is returned. Of course everyone knows this and this is nothing new. Then we can try it boldly. What will happen if we apply the push method of the array to the object? We use call to point the value of this to obj, and then push. It can be found that there is an extra ‘0’: ‘zero’ and the ‘length’ attribute of the array in the obj object! We all know that general objects do not have a length attribute, so when we want to know how many attributes an Object has, we generally use for in to iterate the object. You can know that the length attribute is passed in internally by the Array.prototype.push method. To get closer to our idea, we…
jquery, JavaScript, page jump, open new page, return, jump page and pass parameters at the same time
1. Jump window.location.href=”xx.jsp“; window.navigate(“top.jsp”);top.location=’xx.jsp’; self.location=’xx.jsp‘;window.location.assign( “xx.jsp“) ; 2. Return window.history.back(-1); window.location.replace(myurl); Third, jump to the page and pass parameters at the same time var userId=$(“#userId”); var password=$(“#password”); var myurl=”login.do”+”?”+”userId=”+userId+”&password=”+password; window.location.replace(myurl); Four, partially refresh the page Using Ajax
Study notes: C++, JavaScript, Java implementation of bubble sorting
C++, Javascript, Java implementation of bubble sorting Implementation principle: Taking the C++ implementation as an example, the sorting process is completed using a nested for loop. For an array of 10 elements, 9 rounds of comparison are performed, and len-i is performed in each round. comparisons to determine a maximum value. Using the following example, there are a total of 9 rounds of comparison. In the first round, the largest number is selected and placed at the end. In the second round, the largest number is selected from the remaining numbers and placed in the second to last… until the final round. Summary: Bubble sorting is easier to implement, but no matter the situation is good or bad, all rounds of comparisons must be performed, and the running speed is slow. (1) C++ implementation void bubbleSort(int array[], int len) { int temp; for ( int i = 1; i <len; i++) { //Compare len-1 rounds in total for (int j = 0; j <len – i; j++) { //Compare the first to len-ith numbers in each round if (array[j] > array[j + 1]) { //Compare the jth and j+1 numbers, the larger The ones are placed at the back temp…
Remove style, javascript, css code sharing from html in asp
asp function code The code is as follows: <% Function RemoveHTML(str) Dim objRegExp, Match,strHTML if isnull(str) then str=”” end if strHTML =str strHTML=replace(replace(replace(strHTML,vblf,””),vbcr,””),vbcrlf,””) Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True objRegExp.Pattern = “” strHTML = objRegExp.Replace(strHTML,””) objRegExp.Pattern = “” strHTML = objRegExp.Replace(strHTML,””) objRegExp.Pattern = “” strHTML = objRegExp.Replace(strHTML,””) Set objRegExp = Nothing RemoveHTML=strHTML End Function %> %ignore_a_1% code The code is as follows: <?php $search = array (“”si”, // Remove Javascript “”si”, // Remove css “'<[/!]*?[^]*?>’si”, // Remove HTML tags“’]*?> ‘si”, // Remove comment marks“‘([rn])[s]+’”, // Remove whitespace characters“‘&(quot|#34);’i”, //Replace HTML entities“‘&(amp|#38);’i”, “‘&(lt|#60);’i”, “‘&(gt |#62);’i”, “‘&(nbsp|#160);’i”, “‘&(iexcl|#161);’i”, ” ‘&(cent|#162);’i”, “‘&(pound|#163);’i”, “‘&(copy|#169);’i”, “‘&#(d+);’e”); // Run as PHP code $replace = array (“”, “”, “”, “”, “1”, “””, “&”, “<“, “>”, ” “, chr(161), chr(162), chr(163), chr(169), “chr(1)”); //$document is a string that needs to be processed. If the source is a file, $document = file_get_contents (‘http://www.sina.com.cn’); $out = preg_replace($search, $replace, $document); echo $out; ?> Save it as get.php. ——-If you want to know more about Linux-related exception handling, please pay attention to
It seems that you don’t need to know css, javascript, or PHP to use Drupal.
To use Drupal, it seems that you don’t need to know css, Javascript, and PHP?To try Drupal, it seems that you don’t need to know css, Javascript, and PHP? Because modules and views help build and update websites (framework, content) ——Solution——————–Although Drupal has its own syntax, it is also based on PHP. I don’t know how to start with php. ——Solution——————–It’s better to know a little bit. If you don’t know anything about it, it’s really difficult to change it yourself, so you can only Let’s try it out——Solution——————– Not used. . ——Solution——————–I don’t understand you How to change the style? This is what I am more concerned about!
JavaScript
Cross-platform, operated on the client Writing location Event-driven Java Script Common events Demo Java Script events
The relationship between common web front-end technologies html, css, javascript…
I browsed this blog on the Internet. I originally wanted to summarize it myself, but I found that the writing was already quite good. I couldn’t simplify it even if I wanted to, so I just copied and pasted the things I think are the key points. come over. If you are a beginner in web development, then you will inevitably search the Internet for the meaning of words such as HTML, CSS, XML, JS (Javascript), DOM, XSL, etc. However, as your learning deepens. When you mix them together, you are confused again. You will keep asking, what is HTML? What is CSS? What is XML? What is JS? What are they used for? Whether it is an Internet encyclopedia or some IT Special websites, or some talented blogs, will tell you what a single thing is. There are many such articles, but few of them cover what they are combined and what they are used for. I think I wrote this article just to illustrate this issue that they rarely touch upon. The ability to summarize, summarize, and refine is the engine of our progress. This ability can be cultivated consciously. Sun Taoran, chairman and president of Lakala Electronic…
JavaScript
1. Javascript Syntax: case sensitive, weak type (all types are guided and declared with var) Write it in the tag and cannot be placed in the title var num=10; var str=’123a’; var isRight=true; var ch=’c’; ….. Output alert(num); alert(str); –>When the string is in pure JS code, use double quotes, When strings are mixed in an HTML page, use single quotes to avoid conflict with attribute values’ 1. Javascript events —》onclick mouse click event –>onblur loses focus –>onmouseover mouseover –>Since the types in js are weak types, it is very easy to turn into string concatenation when calculating numbers parseint(string); Convert strings into numbers for calculation 2. Anonymous function (similar to the anonymous method of C#’s delegate) Use a method as a variable var func=function(){var sum=0 ;for(var i=1;i<=100;i++){sum+=i;}return sum;}var num= func();alert(num); 3. Object Objects in js can be regarded as constructors When creating an object, you can create object members directly through the object name and member name. As long as they are assigned once, they can be directly used as objects in the future. Use the properties or methods directly function Person(){ this.name=”Zhang San”;this.age=19 ;this.gender=’Male’; this.sayHello=function() {alert(‘Hello, my name is’+this .name+’, this year’+this.age+’years old ,’+’I am’+this. gender+’Classmates.’);//alert(‘Hello, my name…
What is the order of learning HTML, CSS, JavaScript, PHP, and MySQL?
↑ Click above to follow us Let me talk about this issue based on my own experience. It may not be suitable for everyone. Feeling can be divided into the following learning stages. ML&AI Long press to identify the QR code and follow us