This is the way the world should be!So, in modern browsers, if you remove an element from a DOM tree, the browser automatically binds the event you bind to free up the memory it occupies. You may have guessed that older browsers would not do this,
1. jquery Gets the text value of the currently selected select
var checktext=$ ("#slc1"). Find ("option:selected"). Text ();
2. jquery gets the value value of the currently selected select
var checkvalue=$ ("#slc1"). Val ();
3. jquery Gets
The general is to change their own function name:
More convenient and simple, direct batch replacement can be.
First code:
Copy Code code as follows:
var $= function (ID) {
Return "string" = = typeof ID? document.getElementById (ID):
There is such a table:
Click Delete Execution save and need to perform onclick event SaveItem ("", this);
In JS
Copy Code code as follows:
function SaveItem (id,btn)
{
var tbl = $ (BTN). Parent (). Parent (). Par ENT ();
Today in writing jquery found Slidertoggle in Settimeouter not effective, also reported wrong said is an unexpected error. Read for a long time also did not understand later suddenly found using show (), hide (), you can.
Some of Bootstrap's
IFRAME code, note to write ID
Copy Code code as follows:
jquery Code One:
Copy Code code as follows:
Note: The following code is placed in the test.html call
$ (window.parent.document). Find ("#main"). Load (function ()
var A=false;
!a&&alert ("Hi");
Explain that a is true before proceeding down, so it pops up hi
var a=a| | " Hi ";
Explain that when a is false, it will continue to execute, and when a is true, jump out of the statement, so you can copy the default
Copy Code code as follows:
This is an example of dynamic JavaScript text display
"
Scrolling text in the status bar
Copy Code code as follows:
This is a marquee effect of the JavaScript
The principle is simple:
onmouseover, onmouseout Execute business code when the use of settimeout for delay, the second trigger when the first clear off the front of the settimeout.
principle
Copy Code code as follows:
var timer;
Taobao's search box uses such a design:This design typically uses JavaScript to monitor the focus and blur events of the input box:
Copy Code code as follows:
There are two obvious drawbacks to this piece of code:
Get user Login State Needless to say, judge to leave the words have a little problem, if the user is in accordance with the designer's rules trigger the exit of the event that there is no difficulty, but the user to leave a variety of ways, how the
Because I do not know how to describe this problem, so the title up so pit dad
The main process is this, today I write a similar to Baidu know that there are questions to answer the page, all the data is the first time the page is loaded through
First, add jquery code hint function in MyEclipse (Spket is a plug-in that writes JS)
1, open myeclips-windows-preference find "Spket" click "JavaScript Profiles"
2, click "New" to enter "jquery", and then click "Add Library" to select "jquery"
First look at the code:
Copy Code code as follows:
(Function (window, undefined) {
Building a JQuery Object
var document = Window.document,
Navigator = Window.navigator,
location = window.location;
var jQuery = (function () {
var
Every time you select the operation, always in the online turned down, too cumbersome, the summary of their own here.
Like
1, set the value of "all" item selected
Copy Code code as follows:
$ (". Selector"). Val ("All");
2,
Effect Chart:
Demo Code:
zodiac Search Current position >> Home > Practical Query > Zodiac CheckInquiry ;/tbody> Zodiac Search Born in: year : Of course no one ever forgetsWhat you
Note: When adding a string to Firefox, there is a bug that scrolltop will be equal to 0, of course, but not perfect. If a master has also studied, trouble pointing.
Complete test Code:
Copy Code code as follows:
Requirements Description: The page can be dynamically added data, such as table, click the button can dynamically add rows. or page
The table data is fetched from the background through Ajax at load time. And when we want to get one of those values,
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