If you get the "current" domain name host = Window.location.host;
Url=document.domain;
url = window.location.href;
Get full URL path: The following code can be used to fully document the results:
Run as follows:Thisurl:["+ Thisurl +"] "Strwrite + +"Thishref:["+ Thishref +"] "Strwrite + +"Thissloc:["+ Thissloc +"] "Strwrite + +"Thisdloc:["+ Thisdloc +"] "document.write (strwrite); -->thisurl: [http://it.sin
Javascript to get Summary of webpage width and height, javascript to get summary
Document. body. clientWidth-visible area width of the webpageDocument. body. clientHeight-the visible area of the webpage is high.
Document. body. offsetWidth-visible area width of the webpage, including the width of the edge and scroll ba
Examples of the JavaScript get checkbox check box are countless, the following example, pure JS implementation of
var form = document.getElementById ("Form2");
var field = form.elements["Test2"];
var option = dining.getselectedoption (form, field);
var message = ""; for (var i = 0, len = option.length i
JavaScript Gets the event first from a simple example, a simple button control is as follows:then register the event for it, in this case, how to get the event in JavaScript, especially the Firefox situation. Please see:no accident, in IE/FF, the above example will output input, which is the name of the tag that triggered the Click event node, IE's event gets her
There's a problem with writing the calendar control, using JavaScript to get the last month, there's no way to bring it back, it's too backward to write, it's tiring.
Date.getdayofmonth = function (y, Mm) {///
Date.getdateofnextmonth = function (dt) { ///
Suppose the current time is July 24, 2014 morning 12:00:00
//Output Result:
d.tolocalestring ()
"June 24, 2014 morning 12:00:00"
D2.tolocalest
7 Steps to better JavaScriptOriginal: http://www.creativebloq.com/netmag/7-steps-better-javascript-51411781Seven steps to get you to write a better JavaScript codeAs browsers improve performance, new HTML5 APIs are being applied, and JavaScript continues to grow in web usage.However, a bad line of code can affect the e
of our final result.var indexend = Result.indexof (""); if (indexend!=-1) result = Result.slice (0,indexend);This time we are looking for the end of the result, usually the "" symbol as the end of the place. Of course, if it is in string as the last argument, such as "d=5" this, then our previous result is already the correct result, do not need this step.return decodeURI (Result);Finally we return to result as the final outcome. Because if the argument in Chinese words, will be garbl
This article mainly introduces how to get the summary of current date and time and other date operations by js. Interested partners can refer to the examples in this article to share common scenarios of javascript time operations, for your reference, the specific content is as follows:
Var myDate = new Date (); myDate. getYear (); // obtain the current year (2 digits) myDate. getFullYear (); // obtain the
One JavaScript instance every day-get the current height of the element, javascript instance
Element Acquisition in javascript
Id is unique, that is, an id of the same name is not allowed to exist on the same page. Therefore, when an id is used to obtain a webpage element, a single element is obtained, not an array,
(let key in array) {};// 更好的// 但是总是缓存数组大小let i = 0;for (; i written at the end :forFreedom | Knowledge should be open to access, look at the outside world, and it this line, not to go to Google data, finally, Amway a V--PN agent. a red apricot VPN, to Google to check the information is the absolute first choice, the connection speed, the use is also convenient. I bought is 99¥ a year, through this link (http://my.yizhihongxing.com/aff.php?aff=2509) registered after the Member center to lose the
Javascript to get the server time, javascript Server
JS is a script running on the client, rather than running on the server. In general, the time obtained through JS is the time on the guest's local computer, in order to make the time on the webpage not different from the visitor's computer, we need to directly obtain the server time in JS.
The following is the
Use Javascript to get detailed explanation of the sentence where the selected text is located, and use javascript to explain
Preface
I recently received an issue hoping to save both the context and source URL of a word when you draw a word. This feature was actually thought about for a long time ago, but it was not easy to implement and was delayed. It is not com
Javascript to get the size and location of the window code sharing, javascript window
In Javascript, you can use OuterWidth and OuterHeight to obtain the browser size. Use innerWidth and innerHeight to obtain the window size (excluding the browser border ). For IE6 and earlier versions, the standard mode or hybrid mode
Javascript allows you to get different prices per day for a date segment (calculate the total price of your stay) and the total price of javascript
Code example
I recently encountered such a problem when developing a hotel mini-program project.
The price of a hotel room varies by hour or a special date. If you select a house for the next five days, and the price
The ID card can identify a person's information. The following describes how to use JavaScript to obtain the age and gender ID card of the person using the ID card number to identify a person's information, the following describes how to use JavaScript to obtain the age and gender of the client through the ID card number.
Script function IdCard (UUserCard, num) {if (num = 1) {//
This article describes how to use the Baidu map api and html5 features of javascript to obtain the location of a browser.
The Code is as follows:
Click this button to get your location:
Try it
This article describes in detail how to use JavaScript to implement QueryString to obtain GET parameters. The specific implementation is as follows. If you are interested, refer to the following:
The Code is as follows:
Select Enterprise Product
The Code is as follows:
QueryString = {Data :{},Initial: function (){Var aPairs, aTmp;Var queryString = new String (window. location. search );QueryS
This article mainly introduces how to get the object class name using javascript implementation similar to getClass () in java. The example shows how to use the getClass method in java implementation, which has some reference value, for more information about how to use javascript to get the object class name, see the
Javascript to get the current date's lunar date code, javascript lunar calendar
JavaScript code
/* Set the lunar date */var CalendarData = new Array (100); var madd = new Array (12); var numString = "May 80 or 90 "; var monString = ""; var cYear, cMonth, cDay, TheDate; // the lunar calendar month can only be 29 or 30 d
This article mainly introduces the methods for obtaining the prev and next of an element's adjacent sibling nodes in JavaScript, involving JavaScript function-based judgment and techniques for calling previussibling and nextSibling, for more information about how to obtain the prev and next methods of an element, see the example in this article. We will share this with you for your reference. The details ar
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.