Solutions to ie bug and string truncation of substr

I haven't paid attention to this problem all the time. I wanted to do this today: Copy codeThe Code is as follows:Var str = 'Hello world 8024 '; Str. substr (-4, 4 ); A negative number is counted from the end. Should Return: 8024 But found the

JS template Implementation Method

Overview When we use JS to render the DOM, we generally use a string to create the DOM and then attach it to the parent element. If the appended DOM is dynamically changeable, We need to write a lot of logic in the function. If the control is

JavaScript processing Iframe adaptive height (same as or under different domain names)

1. Handling Iframe adaptive height under the same domain name Copy codeThe Code is as follows: Of course, here I use Asp. Net MVC. Here src is set as the routing structure.Copy codeThe Code is as follows: When an iframe nested page is loaded, the

Remove the default enter key from the form to submit and bind the js method implementation code.

Copy codeThe Code is as follows:Onkeydown = "javascript: if (event. keyCode = 13) return false ;"Onkeyup = "javascript: if (event. keyCode = 13) dosearch ();"Class = "swap_value"/>Src = "$

Javascript to Disable IE Toolbar, navigation bar, and other implementation code

If you encounter problems during troubleshooting, record them by the way,Copy codeThe Code is as follows:Function OnOpenWin (){If (window. name! = "OAopenWindow "){Win = window. open ("login. aspx "," OAopenWindow "," toolbar = no, menubar = no,

Preview image instances before JS upload

Js Code of the preview image: Copy codeThe Code is as follows: The fileupload control and the image used to preview the image: Copy codeThe Code is as follows: The function is very simple, and the code is easy to understand. I believe you can

Js navigation menu (self-writing) is simple and generous

Recently, the project requires a simple multi-level drop-down menu, but due to business and style requirements, it is not suitable to find many navigation menu controls on the Internet for simplicity, so I want to write it myself ~ Do it now ~HTML

Javascript disables the selected text implementation code of the document element Object

Copy codeThe Code is as follows:// Parameter obj: Specifies the jquery object of the element of the selected text to be disabled.// Parameter enabled: true, optional; false, not selectedFunction setSelectable (obj, enabled ){If (enabled ){Obj.

Code for implementing DIV + CSS + JS continuous horizontal scrolling

DIV + CSS + JS implements uninterrupted horizontal scrolling codeCopy codeThe Code is as follows: div css code scrolling horizontally without interruption-DIVCSS5 DIVCSS5 demo Description: Scroll left

Automatic match of input box (native code)

Today, I saw some people in the group initiate some interview questions before renrenren. I have reposted some questions before. I am just idle and choose one question to do it and practice it.This question has the following requirements::1. Use

Four Methods for registering and removing events in javascript

There are many ways to register events for some elements in html.First:Copy codeThe Code is as follows: test Second:Copy codeThe Code is as follows: test Third (W3C model ):Copy codeThe Code is as follows: test Among the three parameters,

How does jquery implement the ajax interaction box (2)

Another form of linkage box, the linkage box on the right is generated using jquery This is based on the js method modified in the previous article.Let's take a look at the code on the page:Copy codeThe Code is as follows: event region: & Lt; td

Code for switching the cursor through the upper/lower left key and the Return key

When creating a project, the customer puts forward this requirement. When entering data in the text box in the list, you must be able to switch the cursor by pressing the up or down key, and press the Enter key to move the cursor to the next text

Js pop-up mode dialog box, and receive the return value method

A: Copy codeThe Code is as follows: Mode dialog box js: Copy codeThe Code is as follows:

Execute the func method to implement code when submitting the form

Copy codeThe Code is as follows: User Registration User Registration Bgcolor = ""> $ {error} User name: * (Required) User Password: * (Required) duplicate password: * (Required) Email: * (Required) Tel: QQ:

Small Example of Adding options to dropdownlist by js

Copy codeThe Code is as follows:  ? Js Code background Code return the id string of the directory you just inserted

How JavaScript implements its own DOM selector principle and code

Interpreter mode (Interpreter): defines a syntax format, implements it through program interpretation and completes the corresponding task. In front-end programming scenarios, you can apply the interpreter mode to interpret the CSS selector for DOM

Three solutions for js asynchronous loading

By default, javascript is loaded synchronously, that is, it is blocked during javascript loading. The subsequent elements can be loaded only after javascript loading is complete. For some javascript that is not very significant, if it is placed in

Implementation of JS chained call

Chain callChained call is actually just a syntax trick. It allows you to reuse an initial operation to express complex operations with a small amount of code. This technology includes two parts: A factory that creates an object that represents an

How to query DBpedia small application instances using Javascript

Query small applications of DBpedia using JavascriptIn the previous article, we learned about SPARQL and SPARQL Endpoint, and made a simple SPARQLWrapper. js to query some data from DBpedia.This article tries to use SPARQLWrapper. js to read the

Total Pages: 5378 1 .... 4167 4168 4169 4170 4171 .... 5378 Go to: GO

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.