jQuery properties that mimic DOM properties
One of the most common errors I see among new jQuery programmers is trying to access or assign DOM properties on jQuery objects. For instance, today on StackOverflow I saw this: $('input', this).checked = true; Except in the cases where the DOM property has the same name as a jQuery method, it seems like it should be possible to implement this using Javascript getters and setters.
.attr should allow function that returns multiple attributes
.attr should allow the following type of use: $(selector).attr(function() { return { attr1: value1, attr2: value2, ... }); Currently a function can only be used with the two-argument form, to compute a single attribute.
jQuery 1.x and 2.x detecting browser with PHP
<!doctype html> <html> <head> <meta charset="utf-8"> <?php // JQuery 1.x and 2.x URLs $jQuery1 = 'jquery-1.11.2.min.js'; $jQuery2 = 'jquery-2.1.1.min.js'; // Default $jQuery = $jQuery2; // User Agent $arr = explode(' ',mb_strtolower(str_replace(array('.','/'),' ',$_SERVER['HTTP_USER_AGENT']), 'UTF-8')); for($i=0; $i < count($arr); $i++){ if($arr[$i] == "msie"){ // Internet Explorer ? if($arr[$i+1] <= 8){ // <= 8 version ? $jQuery = $jQuery1; // Jquery 1.x } } } // Print echo '<script src="'.$jQuery.'"><script>';
Animated scrolling with elaborate test console
Hi y'all, First post here. After coming across a lot of jQuery while googling and realising it's potential, I was completely converted to using it. That wasn't too long ago but I've been reading up and experimenting... After creating a few parallax images, I started looking for a good smooth scrolling solution. Not finding a satisfying answer, I went ahead and wrote something myself : $(document).ready(function() { $(window).resize(function() {edge = ($(document).height()-$(window).height())}); var
.data() Optionally Update HTML5 Attribute
As it is now, the .data() function retrieves the data from HTML5 data-* attributes when the page loads. When data is set using the function, the DOM attribute is not updated, for efficiency. If you want the attribute to be updated as well, you have to then pass the same data to .attr() . .data( key, value, updateAttr ) What I am proposing is an optional third argument (second in the .data( obj ) signature), updateAttr . It would be a Boolean (defaulting to false ). When true , .data() would also
Regarding Date Picker
Hi All, Is any one having solution. I have HTML code where i implemented the row add and delete using JQUERY( jquery/1.7/jquery.min.js and bootstrap.min.js) and also the date Picker by using (jquery-1.9.1.js and jquery-ui.js) while i will disable the jquery.min.js the date picker is working . But i need the jquery/1.7/jquery.min.js to add and delete row in the table.So How i can fix this please any one can help on the same. Thanks, Snehasish
This is ours side project
hi all I'm pleasure to have had a chance to contribute the code width my team, this is my project implement in my work last two years, only the close project, not release, thank for my team help, I had a chance to share my son and possessed the web. This project names component, it is client side MVC design with ajax and single page, reference for all, thank you http://jqcomp.org/
jQMobile re-positions popup every time when Android opens own virtual keyboard - I can't input anything
Actually this is a problem. But it can be a new idea. I could be wrong but I think there should be an option to disable handleWindowResize or it can run manually. Through this way, we can allow to overlap the popup with the virtual keyboard. So we can use popup like a simple div. _handleWindowResize: function(/* theEvent */) { if ( this._isOpen && this._ignoreResizeTo === 0 ) { if ( ( this._expectResizeEvent() || this._orientationchangeInProgress ) && !this._ui.container.hasClass( "ui-popup-hidden"
Method to retrieve the request headers about to be sent
The native XMLHttpRequest API doesn't have methods to get request headers. It would be useful to add one to the jqXHR object, to facilitate debugging and test automation. User requests dating back from 2011: http://stackoverflow.com/questions/7564007/get-sent-headers-in-an-xmlhttprequest http://stackoverflow.com/questions/9102279/is-there-a-way-to-get-all-the-request-headers-in-a-jquery-ajax-call ... and "request headers" showing up in Google's autocomplete when searching for "jqXHR get".
Internet Explorer 9, jQuery and DivX
Hi all, Just to let you all know that when you are using IE9 and having problem with javascript execution (in this case jQuery) try to uninstall DivX and see if that help. I hope this help everyone.
ClodZoom method not working
Hi, In my Asp.net Application i use Cloud-zoom.1.0.2(js) jquery file. In jquery ready function is call CloudZoom method it is working. function ($) { $(document).ready(function () { $('.cloud-zoom, .cloud-zoom-gallery').CloudZoom(); // It is working }); function CloudZoom(jWin, opts) { // some code here } })(jQuery); But In our client side javascript function it call same method it don't work. How to solve this problem function ImageChange(src) {
Finally a way to track/debug jQuery events in most browsers.
There is a new project that provides a way to track triggering of events and event handlers. https://github.com/intervalia/triggerTracker Use triggerTracker to see what is being triggered and what function is handling the event.
The resizeend event
Hi guys, I was irritated how Firefox and Chrome fire the resize event multiple times while the user resizes the browser window, so I wrote a little script to deal with that... The issues... Firefox = if you resize the browser window using the "resize area" at the bottom right corner of the window, then the resize event will be fired every ~20ms for as long as you drag the corner of the window. Chrome = if you resize the browser window, the resize event will be fired twice !! Since I want to run some
Add firefox search engine for jquery doc
I'm using Firefox every day for devloping. Firefox has the feature to directly search into some website. Here the Firefox doc: https://developer.mozilla.org/en-US/Add-ons/Creating_OpenSearch_plugins_for_Firefox I think could be usefull to have a "open search" for the jquery doc. It could be done in half an hour. what do you think ?
html5 WebSockets
Saw rarely information about this feature on the internet, either missing or non-working. I think it is best to implement into the already great jQuery.
Please provide versioned documentation
I hope this is the right place since I can't find anything else that seems like the right spot for an improvement request for the site. Please direct me to the proper place if there is one. Sometimes I need to use older versions of jQuery. It would be really nice if I could go to the documentation page and select the version to get that version's documentation. It's really hard to figure out how things have changed with the current method, which is to try to trace the history though whatever commentary
Using JQuery? Try VJET JavaScript IDE!
Hi JQuery Javascript community! I am a lead for a JavaScript IDE named VJET. The project is hosted on ebayopensource.org: https://www.ebayopensource.org/index.php/VJET/. I welcome members of this Using JQuery forum to download and try out this JavaScript IDE. We hope this tool will make using JQuery easier. It was made for JavaScript developers by JavaScript developers. This tool provides code assist, hover documentation, and semantic validation of well known JavaScript APIs and JavaScript syntax.
jQuery and UI reference in chm format, always latest
I dump the raw xml API and parse it into html with DISQUS comments integration. If some one know how to dump the xml API of UI reference, please let me know. I'll pack it with jQuery API reference. Thanks Edit: I have added the UI api reference and fixed some minus bug, user experience enhances! The latest compiled chm would be here https://github.com/Yahasana/jqdoc-parser
SSN Masking and Formatting
/* --------------------------------------------------------------------------------------------- * myPass v1.0 - jQuery password-hiding iPhone-Style * * Copyright (c) 2009 Oliver Storm, Stefan Huissel( http://www.mysrc.de ) * Feel free to redistribute the script/modify it, as * long as you leave my infos at the top. * * * Date Thu, 30 Jun 2009 * * Defaults: charReplace -> Unicode for the symbol that will be displayed * instead of the character. You can find a good overview here: * http://www.fileformat.info/format/w3c/entitytest.htm?sort=Unicode+Character
a tracelog that bridges across setTimeout(), setInterval(), callbacks, recursive functions - done - needs polishing, but how?
My javascript framework http://fancywebapps.com does a lot of things asynchronously, and is designed to process at the same time multiple user requests for calculations on sometimes large datasets (delivered always in JSON in my case). I was facing the problem (time and time again) that I could not keep track of which "userAction" (page load, click somewhere, hover over something, etc) was responsible for any given still-buggy function's execution in the debugger, due to the fact that "the default
Dynamic progress loading instead of differed
I was assuming to create a function to register with only one site. Capable of monitoring the AJAX requests either using $.ajax, $.post, XMLHTTPRequest, AjaxObject etc... when URI call starts/complete single or stack, capable to executes a callback function. No matter if progress functions are defined or not. Thanks, Smoke
.val() on <select multiple> when no options are selected
When .val() is used on a <select multiple> element, it returns an array of all the selected options. However, if no elements are selected, it returns null. It seems more appropriate for it to return an empty array, so that the limiting case is not treated specially.
Fix jQuery.ajax() errors in IE
Hi all, I thought it might be worth spreading the word about the solution of a strange problem in IE: All my jQuery.ajax() requests were kind of ignored in IE and didn't return any data. After debugging them I got a "parseerror" and a strange "Error c00ce56e" in my IE. This error code is related to an encoding error if using the UTF-8 charset. If you got a similar problem with your AJAX requests not returning any data, try out the following code to see if you also get the c00ce56e error code: $(document).ready(function()
The future of web development. !!!
Please watch till the end !!! http://youtu.be/hPZpEIh4ooo Watch this guy's other videos !!! Put these ideas in JQUERY and change the web !!
Animation feature
Hello all, As we all know...human eye can see only 24 frames per second. But when i create some animation with jquery, i see that in one second are executed around 64 steps...could this number be editable? or to add a new config parameter to change it? in most of cases i think it is useless to execute more than 24 callbacks/animations per second. Here is an example http://jsfiddle.net/KfwMa/ This configuration will get a big role if website will execute a lot of animations on the same time...This
exercises together with arrows
Hello friends! I would make an educational website with exercises together with arrows. What I do is something like this but in html5 http://www.juegos.educ.ar/matematica/165-unir-con-flechas.html I'm a little lost and a little rusty with javascript. Anyone can help me to address this issue with jquery or any book that can help me with these concepts. thank you very much friends! PD: Sorry for my English.
Trying to parse xml
Im trying to parse the xml within the <def> tag. I would like to deal with the contents of the <def> tag line by line as it is layed out below, however, each line is has several tags that are not wrapped in some kind of "line" tag. Any suggestions? Please comment <def> <sn>1</sn><dt>:<ref-link>mouth</ref-link></dt> <sn>2</sn><svr><va>boca arriba</va></svr> <dt>:face up, on one's back</dt> <sn>3</sn> <svr><va>boca abajo</va></svr> <dt>:face down, <ref-link>prone</ref-link></dt> <sn>4</sn> <svr><va>boca
Making accessible the original URL used in a $.load() call.
Simply, either: make the original URL of a Div's .load() call available for future use. Perhaps as something like ("#myselector").url and/or create a .reload() method or similar to facilitate the primary objective of #1. Thanks in advance for consideration, - Pete
Simple file download for generated output
Hi all, Posted this as an idea proposal, not sure if that's right, basically it's a solution to a problem I had so I'm giving the code away. I found I needed to interrogate a database and save the output as a text file on the users PC. Now I could have dumped the output into a temporary file and given the user a link, but I'm lazy and didn't want the housekeeping work of tidying server files up later. If I just submitted a form and the server generated an error instead of a download then handling
more options for dialog
hi, I 'd like an option like "title-bar: false" for dialog, is that possible? Regards.
Bind to all namespaces of custom jquery event
I would like a way to bind to all namespaces of an event or effectively ignore that the event is namespaced. $('#test').on('custom', function(){ ... }); $('#test').trigger('custom.namespace1'); $('#test').trigger('custom.namespace2'); The fired event of 'custom' will not be caught because it is namespaced. Something like binding to custom.* would be very useful in order to bind to all events of type custom, regardless of namespace. Stackoverflow thread that prompted this post: http://stackoverflow.com/questions/12590231/bind-to-all-namespaces-of-custom-jquery-event
Syncronize the order of variables returned by $.ajax.fail(), $.ajax.done(), and $.ajax.always()
1) Syncronize the order of variables returned by $.ajax.fail(), $.ajax.done(), and $.ajax.always(). - the reason for this is mostly to do with using the .always() callback. It's hard to tell when to treat it as a success vs a failure. There should always be a variable that contains the response from the server because even in a failure the response is useful for debugging. 2) The jqXHR object should contain a Boolean property that shows weather the response would invoke fail() vs done(). This
jQuery Watermark (light text hint over input fields)
What is Watermark? You have seen it in many websites! A watermark typically appears as light text within an input or textarea element whenever the element is empty and does not have focus. This provides a hint to the user as to what the input or textarea element is used for, or the type of input that is required. (Some watermarks such as this one can show the watermark as long as the first character is not entered). Those gray tips in below example are called watermarks This plugin is designed to
Have a JQuery Validation, Flexible for any fields, message display and validations
Hi All, I was looking for a validation with following options and as i couldn't find one with having all of them. i developed one and now sharing it with you guys. Lite Extendable and easy to add more validation rules Showing messages the way I want So I developed one which 2,5 k (Yes damn lite) can be extended using data-validate-whatever='whatevs' attr (HTML 5 format) and as it is not embedding any specific error popup/show system. You can show messages the way you like "Popup, Tooltip, inline,
Building a Simple Game
Hello, all! I am working on a very simple 'game' concept — for now called '2-Player, Left and Right Game.' It's actually for an online art project, but I want 'interactive game' to be the medium. I'm pretty sure it should be a fairly simple project, but could be completely wrong — I can read and make some edits to jQuery, but writing it from scratch is something I'm still learning. Here is the layout of the game: Page 1 — Static HTML/CSS landing page w/game title, directions and 'click to play.'
callback for final iteration of .each
I am using .each to iterate over an object and add elements to my page that corresponding to each property in my iterated object. Once I have added all the elements to my page, I want to do something like - $('.addedElements').draggable(); Unfortunately, .each does not allow me to provide a callback to execute after the final iteration. One suggestion in the comments of the .each help page was to check indexInArray against collection.length. But, of course, indexInArray isn't really an index if
JOOT
Hi all. jQuery is the N1 library for te DOM and Ajax. And I like it a lot. But it has not any tools to compensate for the lack of some OOP mechanism in JavaScript, like classes and inheritance. For that and some other reasons I have developed a small JavaScipt library - JOOT. JOOT provides convenient and simple API designed for sole purpose: to simplify creation of the object-oriented code. I found it very effective to use jQuery in conjunction with JOOT. This combination allows to build high
Easy Fixed Header and Column Table
I spent the better part of the last couple of days trying to find a good plugin that supports fixed header and column in a table. There are several out there that look like they have gone stale (no recent updates). Most of them are reliant on a fixed table size and/or fixed column widths. Without a lot of work, none were perfect in lining up columns and headers for scrolling and all made use of multiple cropped tables to fix the columns and headers. All of this was too much work for a small
Gather form data into JS object
I'd like to know if there's any method to gather form data into a JS object, just as form POST would have sent it to the server. I think such method would be helpful to tweak the parameters a bit, before submitting it to server. Although I could do that via modifying 'value' of 'input' elements, I think it'd be helpful if jQuery can gather the post data in a JS object and return it (so that, for example, I don't have to traverse the form and deal with selection and radio button input elements) Maybe
Animate using CSS3 instead of JavaScript
I'm converting a jQuery-based web application for use on mobile and need to make use of the hardware-accelerated performance of CSS3 animations. Ideally I'd like a plugin which overrides some of the basic animation (i.e. fade) functions to make use of CSS3. I've searched around but can't find anyone that has tackled this problem, so I'm considering writing a plugin myself. Any pointers appreciated. Thanks N
Next Page