make append()-and-friends create elements like jQuery()
this $("body").append("<p/>", {id:"myP", class:"myClass"}); is better than $("body").append($("<p/>", {id:"myP", class:"myClass"})); seems a trivial and useful addition. thoughts? Leon
how about a no-frills table plugin with fixed header, vertical scrollbar, and pagination?
There are some good non-jquery table scripts out there, such as TinyTable V3 and others. There are also some impressive jQuery grid plugins, and then a handful of plugins for tables that have one useful feature only. What I'm hoping someone builds is a jquery table plugin that does not exert styling control in the way Flexigrid or jqGrid does, and that offers the following: (1) sorting (2) pagination (3) fixed header (4) vertical scrollbar (horizontal not allowed) TinyTable (non-jQuery) by Michael
Fix Remote Validation in JQuery Validation Plugin
Hi, I found a bug inside the JQuery Validation Plugin this happend when you use remote validation like username validation, once you focus out the field the validation run ok, but if you don't change the username entered and then you click again into the field and again make a focusout you will see [Object object] or the url for the validation. The Fix. 1) into the Remote handler you must add the follow. - Before return previous.valid; - After else if( previous.old === value && previous.valid
JQuery.get - Support "binary" type
Hello, For a WebGL application, I need to be able to parse a binary encoded file. The basic Ajax request response is a Unicode string with data loss (multiple byte combinations can produce the same non-valid unicode character). An option is available to the XMLHttpRequest component to allow this binary transfer. We just need to add this line: req.overrideMimeType('text/plain; charset=x-user-defined'); You can read more about this technique at the Mozilla Developer Center: https://developer.mozilla.org/En/Using_XMLHttpRequest#Receiving_binary_data
scriptloader/moduleloader for jQuery 1.5
Is a scriptloader planned for jQuery 1.5? I think a scriptloader in jQuery core or at least an official plugin would be quite usefull. I have written a scriptloader to start a new discussion about the required features. Here some features/options: everything is loaded async and simultaneous (performance) beside a simple callback-function you can also register "loaded"-events and if the eventhandler is bound after the script has loaded, the event handler is called immediatley global but simple FOUC
Form Submission
Form submission seems could use a little more flexibility. Would be nice if: 1. Could decide whether to submit a form using AJAX or HTTP on a form-by-form basis 2. Sometimes when submit a form, may want to go to an arbitrary "page" (i.e. already loaded subpage). But seems can't do this since action determines both the AJAX call and the page you go to next (if i understand things correctly). May be better to separate these things into separate variables. 3. Formally exposing a callback from
$(..).is() could work as $(..).length !== 0
What if $(..).is() would return whether the jQuery collection contains anything. if ($item.is()) { // $item.length !== 0 } What do you think? I think that makes more sense than the code below. if ($item.length !== 0) { // Yes, $item exists }
ability to set encoding for ajax sent data. working solution
hello friends, i'm in love with the jquery way to control the browser. everything may be done quite elegantly, but i wish to ask for yet another parameter to ajax, to cope to non unicode encodings on the server side: a widespread misfeature of all the browsers i know of is not respecting the page encoding when sending data through ajax (while they do respect it when submitting a form). i propose to allow the programmer to choose the encoding, and give my code as example. function unicode_escape is
Making it easier to customize style of buttons in jQuery UI Dialog boxes
I wanted to add some styling and icons to the buttons inside a jquery UI Dialog boxes and this proved to be very difficult to figure out how to do. As far as I can tell there's no good documentation on it, official or unofficial. This post from filament didn't really help at all: http://www.filamentgroup.com/lab/styling_buttons_and_toolbars_with_the_jquery_ui_css_framework/ I put together a solution with some things I found on stackoverflow, but this kind of thing should be much easier, and it should
suggestions on spinner
I had not so much time to look into your spinner control. But so far: use a span-element as a wrapper. this has two advantages over div IE6/IE7 do support display: inline-block on "native" inline elements like span, but not on div span is valid inside other inline elements like input-elements, div is not don't set height - other than auto - on the wrapper-element, let the developer only style the input and the wrapper will automatically adjust his size also add left/right arrow keys to increase/decrease
Proposal for a globalization plugin: jQuery.glob.js
Hi Everyone, I am a developer from the Microsoft ASP.NET team. We’ve put together an open source prototype of a jQuery Globalization/Localization plugin, and would love your feedback. The complete prototype, extensive details of the API and its motivation, and demos are available on GitHub: jQuery.glob.js on GitHub And here is another post from Scott Guthrie introducing some of its features with some more examples: http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx
why not make list items collapsible ?
Just a thought - list items http://jquerymobile.com/demos/1.0a2/#docs/lists/index.html already offer so many styling options, including thumbnails, sub text, chevrons at right, inset etc. Instead of having a less-stylable, always indented collapsible http://jquerymobile.com/demos/1.0a2/#docs/content/content-collapsible.html, why not allow the general list items to optionally have a collapsible section ? I think that would be simpler and at the same time more general than having a separate collapsible
Switch between nomal and modal $.mobile.pageLoading()
When we use $.mobile.pageLoading() a nice loading spinner appears. Unfortunately there is no option to make this a modal spinner i.e. a spinner which disabled everything on the background like a modal window does. This can be handy to avoid clicking twice on a button.
Code coverage results
It would be a good idea to include a summary of code coverage within any files or script tags that have had tests run against them, that are reported with the test results summary. Tom
SplitView
What about SplitView for larger displays like pads?
Grouped buttons in header bar
It could be nice to have the possibility to group buttons in the header.
Shortcut for .offset().top/left.
Hello! Sometimes I need get offset top and left, I need do: var offset = $(...).offset(); alert(offset.top); alert(offset.left); But it is strange, maybe I can do, simply: alert($(...).top()); alert($(...).left()); It can help to get offset or relative position, or set. $(...).top(50); // eq. .css('top', 50); A boolean can represents "get relative": alert($(...).top(true)); // eq. $(...).position().top Bye.
Toggle edit mode function
When you have a list with items it could be that you want to add a delete button to every row when in edit mode. It could be nice if there was some kind of "edit-mode" flag for a <li/> item which can be toggled by a button. Just a mockup: <ul id="lstItems"> <li>Item 1</li> <li data-role="edit-mode">Item 1 <a href="#">delete</a></li> <li>Item 2</li> <li data-role="edit-mode">Item 2 <a href="#">delete</a></li> .... </ul> <a href="$('#lstItems').toggleEditMode()">Toggle
new setClass effect (with use cases)
Input fields in ajax forms often have multiple visual states, usually stored in css classes such as .default, .invalid, .modified, etc. I could not find an easy way to animate those input fields from their current state to any new class. addClassdoes not remove the current classes. switchClass requires knowledge of the other classes (introducing code duplication). Doing $(elem).attr('class','').addClass('myClass'); transitions from the default style rather than from the current style. With the patch
Addition to Number Textbox
Hi, My self Ankur Raiyani. I posses 4 yrs of experience as J2EE developer. Here i have tried to develop a small addition to plugin. This functions identify the number text box using an attribute and apply 2 functionality. (1) it will only allow numbers. (2) it will automatically apply given format while typing. Please refer attached example. Change the extension to ".html" Waiting for positive feedback. Thanks, Ankur Raiyani
Listview accordion plugin
Just add a <div class="ui-li-accordion"></div> to a <li> and it turns the list item into an accordion fold. https://github.com/borismus/jquery-mobile/tree/master/experiments/listview-accordion/
Listview discrete category filter
Discrete filter plugin for listviews implemented as a dropdown at the top of the list, which selects only <li> with a certain data-category attribute. https://github.com/borismus/jquery-mobile/tree/master/experiments/listview-category/
javascript culture
I know that every language has its own culture, the culture of JavaScript is definitely unique. I am a big fan of jQuery, but I have mixed feeling in the implementation of jQuery core. The passed in parameters get reused and overloaded for semantics in many places, is it part of javascript culture. I know this might help to improve performance, but I don't know the actual performance gain, but the cost of maintenance will definitely increase. I have changed dataAttr function in data module of
Behaviors - simple jQuery extension.
Behaviors as an entity is a declarative way to assign/bind scripting methods to DOM elements. We can think that browsers have following declarations in their default CSS declarations: input[type=text] { binding: TextEditorImpl; } input[type=button] { binding: ButtonImpl; } select { binding: SelectImpl; } ... So when we define <input type="text" /> in our markup we declare that the element will behave as a text editor - it will have set of all needed methods and will generate all associated events.
accordion: validation stop flow - move changestart from_toggle to _clickHandler
Hello Jquery/UI developers and users. I'd like to thank you for all the great work as both the core and UI widgets are a pleasure to work with. While I'm new to using the UI aspects and widgets I encountered an item which many people elsewhere have discussed but I didn't think the work-arounds were appropriate. Many times when using an accordion, the user wants to validate data before the _toggle performs. I've found by moving the changestart to _clickHandler it's easy to control the state of
Relative animation with multiplication
I posted this idea in the jQuery Core forums; but now that I think about it, it might be better to propose the idea here since the UI adds more animation features/effects. I'm not sure how the UI core would make these changes to jQuery (I haven't looked at the UI core yet), but here is my idea. I was trying to use the core animation to reduce a set of elements in size and I think it would be nice to have a token that does multiplication. For example: $(selector).animate({ width : '*=0.8',
Refactoring dialog.overlay in preparation for Modal & better keyboard accessibility
Hi, we - that is, I and my team - need to improve the keyboard accessibility & modality of the Dialog widget in order to use it. I was originally thinking of binding the "focus" event as it bubbles up to the document - which would remove a lot of the expense of trying to get all "focusables" in the page or any technique like that. Weirdly, this seems to only work for focus() events triggered by jQuery, rather than native ones. That aside, would you be able to accept a patch that kept (or improved)
New Apple Dock menu: should I turn it into a plugin?
I have written a script with jQuery for a sliding menu that resembles the Apple Dock menu. See this demo (the little menu attached to the bottom of the browser) and the source code. It works on a <div> with <img>'s. You can use it as a menu, for displaying social bookmarks or as an alternative for an image slideshow. An Apple Dock style menu plugin already exists, but my menu has different functionality. Extending the existing plugin was not possible. Is this menu useful and should I turn it into
HTML5 @ api.jquery.com
Adding a cache-manifest and caching all resources required to use the jQuery API documentation offline would be a great benefit for everyone that does jQuery development and has no permanent internet connection(on the train for example). For details see http://www.w3.org/TR/html5/offline.html
Please, we are beggin you
Hello there, We(Brazilians) are using Meetups channel like a forum , cuz we dont have space for answer in our language, and we have a lot of user's doing all kind of questions, we love to use jquery and we really want to improve our capabilities on the library, but we need more and more user's knowing about how to use it. I'm trying create a podcast here in brasil about jquery in portuguese and i'm translating by my self the reference for 1.4.2 , we appreciate all the effort that u guys could do
Several Improvements and Changes to JQueryUI Autocomplete
Several weeks ago I made several changes to the jqueryui autocomplete control that we need for using it in a collaboration platform (it's call "Tricia", see http://www.infoasset.de/). I expected I would want to change so many things that I have to maintain a separate fork independent of the official release anyway. However, now I saw that the new release contains one bugfix I already made (and several more I'd like to have in my version) and I'm wondering if my changes are general enough to be worth
elem.ownerDocument.defaultView breaks when elem == (iframe) document
in the core function curCSS (around line 4691 in jquery-1.4.2.js) jQuery attempts to access the defaultView attribute from elem.ownerDocument. This is fine and well, except for the relatively complex case where you are loading jQuery outside of an iframe, and then are trying to use jQuery from within the iframe without reloading it. There is a good reason for having a setup like this (in short, to enable an "load once - always on" connection to a server, and then using hashchanges to navigate the
modify accordion css styles via options
by default when you create an accordion, you have all those classes applied to the header"ui-accordion-header ui-helper-reset ui-state-default ui-state-active ui-corner-top" in some accordions on my site I do not want rounded corners, and I would love to disable them by simply doing something like $( ".selector" ) .accordion({ styles: { 'header': 'ui-accordion-header ui-state-default ui-state-active'} }); So that if I do not apply some default classes I simply override the default on the accordion()
Drop official support for Firefox 2, Safari 3, Opera 9, Chrome 4?
Hi everyone, I just wanted to briefly take the temperature of the group in seeing whether or not we should drop official support for some of these older browsers. There a few outstanding bugs in the bug tracker related to these browsers, some of which have been sitting for over two years without any action. Either jQuery supports these browsers, which means these bugs should be fixed…or jQuery doesn’t really support these browsers, in which case it should not say it does. (Crashes and broken document.ready
jQuery Plugin Pattern 2.0
Hi everyone, After a long time I've finally written up my latest plugin pattern that allows to namespace your plugin, use traditional OOP method conventions, as well as maintaining full backward compatibility with jQuery's traditional plugin convention. This means now you can write plugins that can be used like $(selector).pluginName.object.method() or even as $(selector).pluginName(args) or even as $(selector).pluginName(args).method() and of course you can pass arguments to your methods as well
The jquery.namespace.js plugin
jquery.namespace.js Use this plugin when you want to create a plugin that is in a namespace not immediately attached to the $.fn namespace. For example, let's say you work for acme.com and all plugins must be in the reverse-domain namespace of com.acme. Simply writing $.fn.com.acme.myplugin = function(){ ... } will not work for a number of reasons. The intermediate objects com and com.acme don't yet exist. Even if you created them, calling $('p').com.acme.myplugin() still will not work because the
Slideshow with jQuery Cycle
Hi! I used the jQuery Cycle plugin again to make a blog-style photo slideshow. It's very straightforward, but it demos many of the Cycle plugin's essential functions. If anybody wants to borrow my code… http://elricoshow.com/deplayer/ Congrats again to M.Alsup for an excellent, very flexible plugin. Rico _______________________ It became clear that the answer I was looking for was in fact a question
add a visible filter that evaluates whether an element is visible on the screen.
Ran into a problem where I needed to get a list of headers that were visible in a scrollable div. I did this to solve the issue but it seems like a useful kind of filter or something to be incorporated into the jQuery core. Thoughts? (function ($) { j = jQuery; $.fn.visible = function () { /// <summary>Filter that checks if the item(s) is visible within the page. Returns set of visible elements</summary> /// <returns type="jQuery" /> // sanity check aborts when no elements visible
How to trigger a function on resize
I found the following script here: http://css-tricks.com/resolution-specific-stylesheets/ It's a script to change a stylesheet based on the browser width. My problem is that when you resize the browser window, the stylesheet doesn't change. It works if you reload, but not on resize. I'm using the script as part of a Wordpress theme. jQuery(document).ready(function($){ $(function() { adjustStyle($(this).width()); $(window).resize(function() { adjustStyle($(this).width());
Datepicker: only certain days are selectable
To make only certain days of the datepicker selectable, I have to the file jquery.ui.datepicker.js made some minor changes. Using a function, it is possible to provide some days with the tag "ui-state-disabled". Example usage: $('input[name="_date"]').datepicker({ disable_date: function(date, month, year) { return day % 2 == 0; } });In the Annex you will find the modified file and the modifications listed individually.
Next Page