Jquery Q & A Knowledge sorting

Source: Internet
Author: User
Tags file upload progress bar html header

Get ID: $ (this). attr ("id ");
: Not usage
1. List usage
Copy codeThe Code is as follows:
Var notList = [];
NotList. push ("# <% = txtSuggest. ClientID %> ");
Var textElements = $ ("input [type = text]: not (" + notList + ")");
Var firstFocusItem = null;
// Traverse elements with Type = Text
TextElements. each (function (I ){
// TODO
});

2. arrange its usage
Copy codeThe Code is as follows:
$ ("Table [id ^ = tb]: not ([id = tbBasicInfo])"). each (function (){
Alert ($ (this). attr ("id "));
});

If [] is not added, $ ("table [id ^ = tb]: not (tbBasicInfo)") will not work.
At this time, not is performed based on the tb of the former id ^ = tb: not operation
Restore BackGround-Color to original Color
Background-color: transparent
Remove the Href underline and the accessed Style
A, a: visited {text-decoration: none ;}
Remove the Li vertex Style
Li {margin: 0; padding: 0; list-sytle: none}
Obtains a Style in the Style of the current object.
$ ("# DivDept" ).css ("display ")
CSS BackGround Url not displayed
For the difference between the iebrowser and the ffserver, the code for modifying boxy.css in ieis as follows.
Copy codeThe Code is as follows:
. Boxy-wrapper. top-left {background: url ('images/boxy-nw.png ');}
. Boxy-wrapper. top-right {background: url ('images/boxy-ne.png ');}
. Boxy-wrapper. bottom-right {background: url ('images/boxy-se.png ');}
. Boxy-wrapper. bottom-left {background: url ('images/boxy-sw.png ');}
/* IE6 + 7 hacks for the border. IE7 shocould support this natively but fails in conjuction with modal blackout bg .*/
/* NB: these must be absolute paths or URLs to your images */
. Boxy-wrapper. top-left {# background: none; # filter: progid: DXImageTransform. Microsoft. AlphaImageLoader (src = 'images/boxy-nw.png ');}
. Boxy-wrapper. top-right {# background: none; # filter: progid: DXImageTransform. Microsoft. AlphaImageLoader (src = 'images/boxy-ne.png ');}
. Boxy-wrapper. bottom-right {# background: none; # filter: progid: DXImageTransform. Microsoft. AlphaImageLoader (src = 'images/boxy-se.png ');}
. Boxy-wrapper. bottom-left {# background: none; # filter: progid: DXImageTransform. Microsoft. AlphaImageLoader (src = 'images/boxy-sw.png ');}

In this way, it will be displayed normally under IE.
Get Table object
$ ("Table [id = tableID]") or $ ("# tableID") CountDown usage
Copy codeThe Code is as follows:
$. GetJSON (

LoginServiceUrl, {method: "Logout "},

Function (result ){

If (result. Url! = Null ){

$ ("# Transfer"). countdown ({
Until: "+ 5 s ",
ExpiryUrl: result. Url,
OnTick: function (periods ){
$ (This). text (periods [6]);
}
});
}
});

The value of text () in Google Chrome is incorrect. Change it to val ()
Windows maximization in Google Chrome
The following js Code is available in FF and IE.
Copy codeThe Code is as follows:
If (window. screen ){
Var myw = screen. availWidth;
Var myh = screen. availHeight;
Window. resizeTo (400,400 );
Window. moveTo (0, 0 );
}

  • In Chrome, resizeTo and resize are ineffective.

Issue 2091: window. resizeTo () doesn't have any effect

  • By Design we don't support resize/move for tabs, only constrained windows.

Http://www.cnblogs.com/lonz/articles/381022.html

  • Javascript resizeTo bug

Http://code.google.com/p/chromium/issues/detail? Id = 11523

  • In google chrome/safari, textbox can be stretched freely by default. Why can't it be stretched freely.


Solution:

CSS to disable resizingtextarea {resize: none;}<textarea name="foo">textarea[name=foo] {resize: none;}HTML is <textarea id="foo">)#foo {resize: none;}

 

  • JS compression Tool

Http://www.brainjar.com/js/crunch/demo.html

Disadvantages:

Will remove the regular expression like */

Sample:

Value = s. replace (/^ 0 */,'');

After Compress:

Value = s. replace (/^ 0 ,'');

  • What are the differences between parseInt () and Number () functions?

Http://hi.baidu.com/iloverobot/blog/item/bd3ed651ffd362868c5430bf.html

  • JSON Problems

Http://blog.csdn.net/chinaontology/archive/2007/12/30/2004871.aspx

  • Prompt box for CSS background setting

  • Large File Upload progress bar (similar to the csdn resource upload effect)

Http://www.cnblogs.com/zengxiangzhan/archive/2010/01/14/1647866.html

  • Editable Input

Http://acme.com/javascript/

  • Jquery sets html header information

Http://home.phpchina.com/space.php? Uid = 155537 & do = blog & id = 182698

  • Solution to conflicts between jQuery and prototype (ajaxpro)

Http://www.cnblogs.com/sxlfybb/archive/2009/06/04/1495995.html

  • Use jQuery + Handler (ashx) + LINQ to implement Autocomplete

Http://www.dotblogs.com.tw/puma/archive/2009/03/10/7426.aspx

  • Jquery ajax Chinese garbled characters

Http://phpxiaoxin.javaeye.com/blog/350544

  • Cause Analysis and Solution of Ajax Chinese garbled characters

Http://hi.baidu.com/sihillver/blog/item/4d6f32f592920325bc3109d7.html

  • Create a jQuery-based high-performance TreeView

Http://kb.cnblogs.com/page/50337/

Http://kb.cnblogs.com/page/53517/

  • Use jQuery to implement simpler Ajax cross-origin requests

Http://kb.cnblogs.com/page/53433/

  • Jquery. Ajax reads XML
first of all sorry about my english, it's not my native lengauge...i have a xml file that i'm reading with the sample code above... 
but when i try to read it from a service web page (http://www.google.com/ig/api?weather=Buenos%20A...), 
it doesn't show anything... and if i write the same content of this page in a xml file in my pc, 
it works perfectly... i dont know what am i doing wrongi let u the code that i'm using maybe u could help mefunction clima(){$.ajax({  type: "GET",  url: 'http://www.google.com/ig/api?weather=Buenos%20Aires',  dataType: "xml",  success: function(data){  var $weather = $(data).find('current_conditions')   console.log($weather);  } });}function clima() {$.ajax({  type: "GET",  dataType: "xml",  url: 'http://www.google.com/ig/api?weather=Buenos%20Aires',  success: function(xml) {  var weather = $(xml).find("current_conditions").find("temp_c").attr("data");   alert("Prognostico para hoy: " + weather + " grados");  } });}

 

  • FullSize: A New IMG Tag attribute (with JQuery implementation)

Http://css9.net/img-fullsize/

Http://css9.net/wp-content/uploads/2009/04/fullsize/example.html

Questions about $. ajaxSetup and $. get

Use in Common. js

  $.ajaxSetup({    url: "…..",    type: "POST",    cache: true,    dataType: "json"  });  $.ajax({    data: { cityCode: cityCode, flag: flag },    success: function(areaList) { …}  });

Introduce Common. js on the PageA page

Then use$. Get (url );

Here, the url calls An aspx page and the result is no data loading! (Normal: data is loaded .)

After Trace Error is performed using the developer tool of IE8, the cause Error information is found (as follows)

"Invalid JSON: <form name ="Form1"Method ="Post"Action ="Ajax_select

How can this problem be solved?

Cause:

Is there a problem with the request data type?

Solution:

1. Script section on Page$. Get (url, "html ");

Because the Data in $. get is optional, after determining the cause, we will define DataType.

Result: OK.

Analysis Source:

Because $. ajaxSetup uses global settings, DataType: JSON has been set globally.

The $. get () of Page A must be affected.

Final Solution:

Change Common. js and remove the global settings of ajaxSetup.

$. Ajax ({url :".....", Type :"POST", Cache:True, DataType :"Json", Data: {cityCode: cityCode, flag: flag}, success:Function(AreaList ){...} });

Result: OK.

Related Article

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.