jquery Programming Glossary: methods
Format numbers in javascript http://stackoverflow.com/questions/1068284/format-numbers-in-javascript to format numbers in Javascript similar to the formatting methods available in C# or VB.NET via ToString format_provider or String.Format..
event.preventDefault() vs. return false http://stackoverflow.com/questions/1357118/event-preventdefault-vs-return-false Is there any significant difference between those two methods of stopping event propagation For me return false is simpler..
Why does jQuery or a DOM method such as `getElementById` not find the element? http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element which implement querySelector and querySelectorAll methods CSS style notation is used to retrieve an element by its id..
jQuery Mobile: Markup Enhancement of dynamically added content http://stackoverflow.com/questions/14550396/jquery-mobile-markup-enhancement-of-dynamically-added-content dynamically jQuery Mobile page I have tried to use these methods ' data role page ' .trigger 'create' and ' data role page '.. a single component widget Important The below enhancement methods are to be used only on current active page. For dynamically.. scratch like listview this error will occur cannot call methods on listview prior to initialization It can be prevented with..
jQuery “Please Wait, Loading…” animation? [duplicate] http://stackoverflow.com/questions/1964839/jquery-please-wait-loading-animation I'm taking below will show you how to accomplish both methods. The Setup Let's start by getting us a nice loading animation..
Get selected element's outer HTML http://stackoverflow.com/questions/2419749/get-selected-elements-outer-html . I've searched around and found a few very ˜hackish type methods of cloning an object adding it to a newly created div etc etc..
jQuery find events handlers registered with an object http://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object If it is not possible on a jQuery object through proper methods is it possible on a plain DOM object jquery events dom share..
How do I select text nodes with jQuery? http://stackoverflow.com/questions/298750/how-do-i-select-text-nodes-with-jquery onwards. This is somewhat inefficient compared to pure DOM methods and has to include an ugly workaround for jQuery's overloading..
Abort Ajax requests using jQuery http://stackoverflow.com/questions/446594/abort-ajax-requests-using-jquery share improve this question Most of the jQuery Ajax methods return an XMLHttpRequest or the equivalent object so you can.. object appears to expose all of the native properties and methods so the above example still works. See The jqXHR Object jQuery..
How to get image size (height & width) using JavaScript? http://stackoverflow.com/questions/623172/how-to-get-image-size-height-width-using-javascript JavaScript Are there any JavaScript or jQuery APIs or methods to get the dimensions of an image on the page javascript jquery..
Turning live() into on() in jQuery http://stackoverflow.com/questions/8021436/turning-live-into-on-in-jquery for equivalent calls for all three event attachment methods selector .live events data handler jQuery 1.3 document .delegate..
What's the difference between `on` and `live` or `bind`? http://stackoverflow.com/questions/8065305/whats-the-difference-between-on-and-live-or-bind with live vs delegate . In future versions of jQuery these methods will be removed and only on and one will be left. Examples Using.. .on click .mySelector fn Internally jQuery maps all these methods and shorthand event handler setters to the on method further.. on method further indicating that you should ignore these methods from now on and just use on bind function types data fn return..
jQuery .live() vs .on() method for adding a click event after loading dynamic html http://stackoverflow.com/questions/8752321/jquery-live-vs-on-method-for-adding-a-click-event-after-loading-dynamic-ht it does not register the event using either of these methods '#parent' .click function ... or according to documentation..
Using jQuery to test if an input has focus http://stackoverflow.com/questions/967096/using-jquery-to-test-if-an-input-has-focus jQuery 1.5 and below Edit As times change we find better methods for testing focus the new favorite is this gist from Ben Alman..
JQuery: Selecting Text in an Element (akin to highlighting with your mouse) http://stackoverflow.com/questions/985272/jquery-selecting-text-in-an-element-akin-to-highlighting-with-your-mouse one I posted one that doesn't rely on deprecated jQuery methods or jQuery at all for that matter. Could you use jQuery to help..
jQuery.Validate Conditional Validation RadioButton and DropDownList http://stackoverflow.com/questions/1084475/jquery-validate-conditional-validation-radiobutton-and-dropdownlist
Get List of jQuery UI themes - from an URL (same-origin-policy) http://stackoverflow.com/questions/12611469/get-list-of-jquery-ui-themes-from-an-url-same-origin-policy xhr.setRequestHeader Access Control Allow Methods POST GET OPTIONS crossDomain true success function data alert..
jQuery Mobile: Markup Enhancement of dynamically added content http://stackoverflow.com/questions/14550396/jquery-mobile-markup-enhancement-of-dynamically-added-content img to full content height img tag has an overhead of 3px. Methods of markup enhancement prevention This can be done in few ways..
preload hidden CSS images http://stackoverflow.com/questions/1787319/preload-hidden-css-images CSS... .hiddenPic height 1px width 1px More JavaScript Methods function preload images if document.images var i 0 var imageArray..
Sending Data to ServiceStack RESTful service, getting 'Access is denied' http://stackoverflow.com/questions/18923930/sending-data-to-servicestack-restful-service-getting-access-is-denied Access Control Allow Origin Access Control Allow Methods GET POST PUT DELETE OPTIONS NOW if I run the same service.. ServiceStack 3.948 Win32NT .NET Access Control Allow Methods POST GET OPTIONS GET POST PUT DELETE OPTIONS Content Type application.. Access Control Allow Origin Access Control Allow Methods GET POST PUT DELETE OPTIONS container.RegisterAutoWired Citation..
What are deferred objects? http://stackoverflow.com/questions/4866721/what-are-deferred-objects of any synchronous or asynchronous function. Deferred Methods deferred.done Add handlers to be called when the Deferred object..
Problem sending JSON data from JQuery to WCF REST method http://stackoverflow.com/questions/4875195/problem-sending-json-data-from-jquery-to-wcf-rest-method Access Control Allow Methods POST WebOperationContext.Current.OutgoingResponse.Headers.Add..
Cross domain POST query using Cross-Origin Resource Sharing getting no data back http://stackoverflow.com/questions/5251689/cross-domain-post-query-using-cross-origin-resource-sharing-getting-no-data-back Control Allow Origin' response 'Access Control Allow Methods' POST GET OPTIONS response 'Access Control Allow Headers' X.. Control Allow Origin' response 'Access Control Allow Methods' POST OPTIONS response 'Access Control Allow Headers' X Requested.. I modified the response originally to include Allow Methods and Allow Headers but according to the exchange in the above..
A CORS POST request works from plain javascript, but why not with jQuery? http://stackoverflow.com/questions/5584923/a-cors-post-request-works-from-plain-javascript-but-why-not-with-jquery getRequestMethod 'OPTIONS' header 'Access Control Allow Methods GET POST PUT DELETE OPTIONS' header 'Access Control Max Age..
How to get a cross-origin resource sharing (CORS) post request working http://stackoverflow.com/questions/5750696/how-to-get-a-cross-origin-resource-sharing-cors-post-request-working 40 29 GMT Access Control Allow Origin Access Control Allow Methods POST GET OPTIONS Content Type text html charset ISO 8859 1 The.. 37 59 GMT Access Control Allow Origin Access Control Allow Methods POST GET OPTIONS Content Type text html charset ISO 8859 1 Request.. 37 59 GMT Access Control Allow Origin Access Control Allow Methods POST GET OPTIONS Content Type application json I can't work..
Call ASP.NET PageMethod/WebMethod with jQuery - returns whole page http://stackoverflow.com/questions/583116/call-asp-net-pagemethod-webmethod-with-jquery-returns-whole-page share improve this question Do you know that Page Methods are working properly If you use the the ScriptManager do they..
jQuery.getJSON - Access-Control-Allow-Origin Issue http://stackoverflow.com/questions/6396623/jquery-getjson-access-control-allow-origin-issue with the Access Control Allow Origin Access Control Allow Methods and Access Control Allow Headers headers with the values it.. Origin corsOrigin set_response_header Access Control Allow Methods corsMethod set_response_header Access Control Allow Headers..
cross-origin 'Authorization'-header with jquery.ajax() http://stackoverflow.com/questions/9559947/cross-origin-authorization-header-with-jquery-ajax headers Access Control Allow Origin Access Control Allow Methods GET POST PUT DELETE Access Control Allow Headers Authorization..
JavaScript: Invoking click-event of an anchor tag from javascript http://stackoverflow.com/questions/980709/javascript-invoking-click-event-of-an-anchor-tag-from-javascript
Format numbers in javascript http://stackoverflow.com/questions/1068284/format-numbers-in-javascript numbers in javascript Is there a simple way to format numbers in Javascript similar to the formatting methods available in C# or VB.NET via ToString format_provider or String.Format javascript jquery format numbers share improve..
event.preventDefault() vs. return false http://stackoverflow.com/questions/1357118/event-preventdefault-vs-return-false false 'a' .click function custom handling here return false Is there any significant difference between those two methods of stopping event propagation For me return false is simpler shorter and probably less error prone than executing a method...
Why does jQuery or a DOM method such as `getElementById` not find the element? http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element the ID. Incidentally in the majority of contemporary browsers which implement querySelector and querySelectorAll methods CSS style notation is used to retrieve an element by its id for example document.querySelector '#elementID' as opposed to..
jQuery Mobile: Markup Enhancement of dynamically added content http://stackoverflow.com/questions/14550396/jquery-mobile-markup-enhancement-of-dynamically-added-content dynamically added content I was wondering how can I enhance dynamically jQuery Mobile page I have tried to use these methods ' data role page ' .trigger 'create' and ' data role page ' .page Also how can I prevent enhancement markup of check boxes.. Enhance a full page content header content footer Enhance a single component widget Important The below enhancement methods are to be used only on current active page. For dynamically inserted pages those pages and their contents will be enhanced.. enhancement problems Sometimes when creating a component from scratch like listview this error will occur cannot call methods on listview prior to initialization It can be prevented with component initialization prior to markup enhancement this is..
jQuery “Please Wait, Loading…” animation? [duplicate] http://stackoverflow.com/questions/1964839/jquery-please-wait-loading-animation graying out the page while the new data is loading. The approach I'm taking below will show you how to accomplish both methods. The Setup Let's start by getting us a nice loading animation from http ajaxload.info I'll be using http i.stack.imgur.com..
Get selected element's outer HTML http://stackoverflow.com/questions/2419749/get-selected-elements-outer-html this case where .html only returns the cells inside the row . I've searched around and found a few very ˜hackish type methods of cloning an object adding it to a newly created div etc etc but this seems really dirty. Is there any better way or does..
jQuery find events handlers registered with an object http://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object to find out that and possibly iterate over the event handlers If it is not possible on a jQuery object through proper methods is it possible on a plain DOM object jquery events dom share improve this question As of jQuery 1.8 the event data..
How do I select text nodes with jQuery? http://stackoverflow.com/questions/298750/how-do-i-select-text-nodes-with-jquery . andSelf is deprecated in favour of addBack from 1.8 onwards. This is somewhat inefficient compared to pure DOM methods and has to include an ugly workaround for jQuery's overloading of its contents function thanks to @rabidsnail in the comments..
Abort Ajax requests using jQuery http://stackoverflow.com/questions/446594/abort-ajax-requests-using-jquery not yet received the response from javascript jquery ajax share improve this question Most of the jQuery Ajax methods return an XMLHttpRequest or the equivalent object so you can just use abort . See the documentation abort Method MSDN ...
How to get image size (height & width) using JavaScript? http://stackoverflow.com/questions/623172/how-to-get-image-size-height-width-using-javascript to get image size height width using JavaScript Are there any JavaScript or jQuery APIs or methods to get the dimensions of an image on the page javascript jquery image jquery plugins share improve this question clientWidth..
Turning live() into on() in jQuery http://stackoverflow.com/questions/8021436/turning-live-into-on-in-jquery in terms of its successors is straightforward these are templates for equivalent calls for all three event attachment methods selector .live events data handler jQuery 1.3 document .delegate selector events data handler jQuery 1.4.3 document .on..
What's the difference between `on` and `live` or `bind`? http://stackoverflow.com/questions/8065305/whats-the-difference-between-on-and-live-or-bind This has the added bonus of tidying up the inefficiencies with live vs delegate . In future versions of jQuery these methods will be removed and only on and one will be left. Examples Using live .mySelector .live click fn Equivalent `on` there isn't.. .delegate .mySelector click fn Equivalent `on` document.body .on click .mySelector fn Internally jQuery maps all these methods and shorthand event handler setters to the on method further indicating that you should ignore these methods from now on.. all these methods and shorthand event handler setters to the on method further indicating that you should ignore these methods from now on and just use on bind function types data fn return this.on types null data fn live function types data fn jQuery..
jQuery .live() vs .on() method for adding a click event after loading dynamic html http://stackoverflow.com/questions/8752321/jquery-live-vs-on-method-for-adding-a-click-event-after-loading-dynamic-ht .load http ... If I try and add a click event afterwards it does not register the event using either of these methods '#parent' .click function ... or according to documentation this should be used instead of .live '#child' .on 'click' function..
Using jQuery to test if an input has focus http://stackoverflow.com/questions/967096/using-jquery-to-test-if-an-input-has-focus we no longer need to add it ourselves. Just use .. .is focus jQuery 1.5 and below Edit As times change we find better methods for testing focus the new favorite is this gist from Ben Alman jQuery.expr ' ' .focus function elem return elem document.activeElement..
JQuery: Selecting Text in an Element (akin to highlighting with your mouse) http://stackoverflow.com/questions/985272/jquery-selecting-text-in-an-element-akin-to-highlighting-with-your-mouse would. I want to provide a better solution than the original one I posted one that doesn't rely on deprecated jQuery methods or jQuery at all for that matter. Could you use jQuery to help you out Sure but if you can achieve the same result without..
jQuery.Validate Conditional Validation RadioButton and DropDownList http://stackoverflow.com/questions/1084475/jquery-validate-conditional-validation-radiobutton-and-dropdownlist
Get List of jQuery UI themes - from an URL (same-origin-policy) http://stackoverflow.com/questions/12611469/get-list-of-jquery-ui-themes-from-an-url-same-origin-policy Access Control Allow Origin 'http jquery ui.googlecode.com' xhr.setRequestHeader Access Control Allow Methods POST GET OPTIONS crossDomain true success function data alert data error function jqXHR textStatus errorThrown alert errorThrown..
jQuery Mobile: Markup Enhancement of dynamically added content http://stackoverflow.com/questions/14550396/jquery-mobile-markup-enhancement-of-dynamically-added-content that same content. Unfortunately it cant be used to stretch img to full content height img tag has an overhead of 3px. Methods of markup enhancement prevention This can be done in few ways sometimes you will need to combine them to achieve a desired..
preload hidden CSS images http://stackoverflow.com/questions/1787319/preload-hidden-css-images or HTML... img src images arrow down.png class hiddenPic ...and CSS... .hiddenPic height 1px width 1px More JavaScript Methods function preload images if document.images var i 0 var imageArray new Array imageArray images.split ' ' var imageObj new..
Sending Data to ServiceStack RESTful service, getting 'Access is denied' http://stackoverflow.com/questions/18923930/sending-data-to-servicestack-restful-service-getting-access-is-denied true WriteErrorsToResponse true GlobalResponseHeaders Access Control Allow Origin Access Control Allow Methods GET POST PUT DELETE OPTIONS NOW if I run the same service call through the REST Console app in Chrome I get a valid response.. Microsoft IIS 6.0 X AspNet Version 4.0.30319 X Powered By ASP.NET ServiceStack 3.948 Win32NT .NET Access Control Allow Methods POST GET OPTIONS GET POST PUT DELETE OPTIONS Content Type application json charset utf 8 Access Control Allow Origin Cache.. types WriteErrorsToResponse true GlobalResponseHeaders Access Control Allow Origin Access Control Allow Methods GET POST PUT DELETE OPTIONS container.RegisterAutoWired Citation container.RegisterAutoWired Driver container.RegisterAutoWired..
What are deferred objects? http://stackoverflow.com/questions/4866721/what-are-deferred-objects queues as appropriate and relay the success or failure state of any synchronous or asynchronous function. Deferred Methods deferred.done Add handlers to be called when the Deferred object is resolved. deferred.fail Add handlers to be called when..
Problem sending JSON data from JQuery to WCF REST method http://stackoverflow.com/questions/4875195/problem-sending-json-data-from-jquery-to-wcf-rest-method Access Control Allow Origin WebOperationContext.Current.OutgoingResponse.Headers.Add Access Control Allow Methods POST WebOperationContext.Current.OutgoingResponse.Headers.Add Access Control Allow Headers Content Type Accept return null..
Cross domain POST query using Cross-Origin Resource Sharing getting no data back http://stackoverflow.com/questions/5251689/cross-domain-post-query-using-cross-origin-resource-sharing-getting-no-data-back request.method OPTIONS response HttpResponse response 'Access Control Allow Origin' response 'Access Control Allow Methods' POST GET OPTIONS response 'Access Control Allow Headers' X Requested With return response In contrast if I set up a complete.. request.method OPTIONS response HttpResponse response 'Access Control Allow Origin' response 'Access Control Allow Methods' POST OPTIONS response 'Access Control Allow Headers' X Requested With response 'Access Control Max Age' 1800 else return.. then goes ahead and makes the POST which was working before. I modified the response originally to include Allow Methods and Allow Headers but according to the exchange in the above linked documentation this isn't needed. This makes sense the..
A CORS POST request works from plain javascript, but why not with jQuery? http://stackoverflow.com/questions/5584923/a-cors-post-request-works-from-plain-javascript-but-why-not-with-jquery etc header 'Access Control Allow Credentials true' if this getRequestMethod 'OPTIONS' header 'Access Control Allow Methods GET POST PUT DELETE OPTIONS' header 'Access Control Max Age 604800' if you need special headers header 'Access Control Allow..
How to get a cross-origin resource sharing (CORS) post request working http://stackoverflow.com/questions/5750696/how-to-get-a-cross-origin-resource-sharing-cors-post-request-working Age 1728000 Server CherryPy 3.2.0 Date Thu 21 Apr 2011 22 40 29 GMT Access Control Allow Origin Access Control Allow Methods POST GET OPTIONS Content Type text html charset ISO 8859 1 The conversation then stops. The browser should in theory issue.. Age 1728000 Server CherryPy 3.2.0 Date Thu 21 Apr 2011 22 37 59 GMT Access Control Allow Origin Access Control Allow Methods POST GET OPTIONS Content Type text html charset ISO 8859 1 Request Header POST Host machineA 8081 User Agent ... Firefox.. Age 1728000 Server CherryPy 3.2.0 Date Thu 21 Apr 2011 22 37 59 GMT Access Control Allow Origin Access Control Allow Methods POST GET OPTIONS Content Type application json I can't work out why the same request would work from one site but not the..
Call ASP.NET PageMethod/WebMethod with jQuery - returns whole page http://stackoverflow.com/questions/583116/call-asp-net-pagemethod-webmethod-with-jquery-returns-whole-page Any suggestions asp.net jquery web services asmx pagemethods share improve this question Do you know that Page Methods are working properly If you use the the ScriptManager do they work It sounds like you might be missing a web.config entry..
jQuery.getJSON - Access-Control-Allow-Origin Issue http://stackoverflow.com/questions/6396623/jquery-getjson-access-control-allow-origin-issue information whether the request is okay and if so responds with the Access Control Allow Origin Access Control Allow Methods and Access Control Allow Headers headers with the values it will allow. You don't send any body page with that response... Allow Origin one set_response_header Access Control Allow Origin corsOrigin set_response_header Access Control Allow Methods corsMethod set_response_header Access Control Allow Headers corsHeaders if the HTTP request method is OPTIONS Done no body..
cross-origin 'Authorization'-header with jquery.ajax() http://stackoverflow.com/questions/9559947/cross-origin-authorization-header-with-jquery-ajax The simplest thing to do is to add the following response headers Access Control Allow Origin Access Control Allow Methods GET POST PUT DELETE Access Control Allow Headers Authorization Your server also needs to be configured to respond to HTTP..
JavaScript: Invoking click-event of an anchor tag from javascript http://stackoverflow.com/questions/980709/javascript-invoking-click-event-of-an-anchor-tag-from-javascript
|