[jQuery] Re: [autocomplete] Repeated AJAX search when selecting a returned value
No, you aren't doing anything wrong. While the implementation may be less then optimal, the additional request is by design. It ensures that the selected value really is a valid match. If you consider that a bug, please file a ticket: http://dev.jquery.com/newticket Jörn On Fri, Aug 29, 2008 at 4:34 PM, Christos Zisopoulos <[EMAIL PROTECTED]> wrote: > > Hi, > > I am using the bassistance.de jQuery Autocomplete 1.0.2 plugin with a > simple server data provider and the following snippet of code: > > $('input.autocompletable').autocomplete('/my_data_source', { > matchContains: true, > mustMatch: true, > minChars: 2, > cacheLength: 1, > extraParams: { kind: 'Address' } > }).result(function(event, data, formatted) { > $(this).next().val(data[1]); > }); > > It all works fine but upon selecting a value (either using the mouse > or hitting the RETURN key) the INPUT is populated with the value > returned by the AJAX search, but then the the AJAX request is repeated > once more this time with the value that just populated the INPUT. > > Any idea why the double GET request? Am I doing something wrong? > > I am on jQuery 1.2.6 and the bassistance.de jQuery Autocomplete 1.0.2 > plugin. Problem occurs across all browsers. >
[jQuery] Autorefreshing DIV
Good morning all, I have a requirement to automaticly refresh a DIV with some content from another URL every couple of seconds and was hoping to get your opinions on how this is best handled. For instance, I have a div which looks like this: I dont need a full blown AJAX call as I simply want to fill this div with the content from a remote file every few seconds, for instance. / some_folder/my_div_content.html. I've currently got a working Spry (sorry for swearing) example on the page but as part of our move over to jQuery (woohoo) I'm looking for your thoughts on how best to achieve this!?! Many thanks for your thoughts guys, Robert
[jQuery] Tabs ui links
Hi everyone, I am using jQuery UI tabs version 3.0. I am calling the tabs content via Ajax, but the links inside the tabs don't open inside the tabs, instead they load into a new page. Is there any way to make my links load via Ajax into the current tab? Thanks, Daniel
[jQuery] Plugin developement
Hi @ all, i have a problem with the understanding of public methods of an plugin. Specialy how to create and link them to the plugin. For example: ;(function($) { $.fn.pluginname = function(options) { var _options = $.extend( { label: "data", debug : false }, options || {}); return this.each(function() { // this works, of course _doSomethingPrivate(); // this too var data = _options.label; }); // private method function _doSomethingPrivate() { } }; // public method $.fn.pluginname.doSomethingPublic = function() { // this won't work _doSomethingPrivate(); // this is not accessible either var data = _options.label; } })(jQuery); Obviously the above code won't work. I've tried several things to get this working, but had no success. So please, can somebody explain me this or point me into the right direction. If this question was aked before (and i'm somehow sure of this, but had not found something jet) please let me know the Url. Sorry for my english, i'm not a native speaker of this language. Regards Martin
[jQuery] enable/disable to text inputs with checkbox
Good afternoon guys, I'm pretty much a jQuery novice and I'm looking for your advice on how to achieve this task. I have two input fields which I want to be disabled by default, with a checkbox which is checked. Then, if a user unchecks the checkbox it will enable the two fields for them to enter data in. In addition to this, if they enter information into the two fields and then recheck the box, I would like it to clear any values they entered and disable them again. Can anyone offer any pointers or code for this? Many thanks guys, Robert
[jQuery] Start page load with collapsed DIV
Hi, Is it possible to have a div collapsed at/before page load so I can neatly unfold it on page load? Currently before my form's submit, I slideToggle the result container, add some "loading" text to it, slideToggle it again and submit the form. All smooth and quick. Now when the page comes back it would be neat if I could start with the same situation as before the submit so the animation seems complete. Any suggestions?
[jQuery] No response with jQuery Form Plugin in Opera
I have a form, that uploads a file. It is initialized by the following code: $(document).ready(function() { $('#image_upload_button').click(function() { $('#imageform_step1').ajaxSubmit({ beforeSubmit: function(formData, jqForm, options) { alert('sending'); }, success: function(responseText, statusText) { alert(responseText); }, dataType: 'html' }); } return false; }); } And the form is simple: Upload image The problem is that in Opera from 9.27 up to the last available stable version success event never comes. In all other browsers (ranging from ie6 and up to firefox 3 and safari) everything is ok. Version of jQuery is 1.2.6, jQuery form plugin is 2.12.
[jQuery] Sorting mixed data
Hi all, Currently i am working on tablesorter plugin with jqery to sort column values in a table. My problem is when there is mixed data in a column like some numbers and "-" (when there is no data to display) its sorting the digits treating as string. e.g. in a column if the values are 7, 12, 9, 15, - then it treats 9 as a highest value. When i sort it it arranges like 9,7,15, 12, -. Thanks, Swaroop
[jQuery] Re: Mouseover /Mouseout div issue
Perfect! Thx for the prompt reply! On Aug 31, 6:35 pm, "Brandon Aaron" <[EMAIL PROTECTED]> wrote: > Try using the mouseenter and mouseleave special events. > $(...).bind('mouseenter mouseleave', function(event) { > if ( event.type == 'mouseenter' ) { > // just entered > } else { > // just left > } > > }); > > You can also use the .hover helper method which uses mouseenter and > mouseleave behind the scenes. > > $(...).hover(fn1, fn2); > > -- > Brandon Aaron > > On Sun, Aug 31, 2008 at 8:26 PM, MikeyJ <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > I'm working on something similar in functionality to the lexus > > website. > > > I've got a nav element that shows a large div on mouseover and hides > > it on mouseout. This div can hold other elements like thumbnails and > > form fields. When I move the mouse into the div all is well until I > > move over any other element in the div and then the div hides. > > > How can I keep the div showing no matter where I move the mouse inside > > of it? > > > Thx, > > Mike
[jQuery] Re: How to retrieve jQuery.query?
> jQuery.fn.find=function( selector ) { > this.query=selector; //this is the only line you have to modify > > var elems = jQuery.map(this, function(elem){ > return jQuery.find( selector, elem ); > }); > return this.pushStack( /[^+>] [^+>]/.test( selector ) || > selector.indexOf("..") > -1 ? > jQuery.unique( elems ) : elems ); > > } > > Now you can get the query string: > $('body .class').prevObject.query //->'body .class' > $('body').find('.class').prevObject.prevObject.query //->'body' > but > $('#id').prevObject.query //->undefined > $().find('#id').prevObject.query //->'#id' here is the final tweak, (after adding this modified find method) query = (this.prevObject && this.prevObject.query) || this[0]; I strongly believe that such property should be added to the main distro of jQuery. After all, the idea of find-and-modify approach - one of jQuery fundamentals.
[jQuery] Re: Cycle plugin: more then elements in slideExpr:
Thanks, That solves it all Will put some examples on http://ddblock.myalbums.biz Philip On Aug 31, 8:33 pm, Mike Alsup <[EMAIL PROTECTED]> wrote: > > Is it also possible to use the CSS selectors to select images in a > > certain class or ID? > > > > > > > > > > > > and use 'img .cycle' asslideExprto show only the images with class > > 'cycle' or > > Yes, but your CSS is not correct. To select only images with a class > of "cycle" you would do: > > slideExpr: 'img.cycle' > > Notice that there is no space between "img" and ".cycle". > > TheslideExproption let you specify any jQuery selector for > identifying slides within the container. > > Mike
[jQuery] Nested Selectors
Hi Guys, Just wondering how many times you can nest selector functions like parent, not, has, etc I tried the following... $ (".someDiv .someSpan:parent(:has(input:checked))").addClass("hasSelectedCB"); and $ (".someDiv .someSpan:parent(:has(input:not(:checked)))").addClass("notSelectedCB"); The first worked, the second returns zero items. Anyone know if there is a limit to nesting these selectors or Is there a better way I should be doing this?
[jQuery] Question about the new jQuery website
Hello all, About the new jQuery website, you noticed that it has 3 blue links: - Lightweight Footprint - CSS3 Compliant - Cross-browser When you hover, it displays a box that stays above the link. I was looking into the code when I found this: //cta tooltips if($.browser.msie){ $('div.jq-checkpointSubhead').hide(); $('#jq-intro li').hover( function(){$(this).find('div.jq-checkpointSubhead').fadeIn(500);}, function(){$(this).find('div.jq-checkpointSubhead').fadeOut(500);} ); }else{ $('div.jq-checkpointSubhead').hide().css({'opacity': 0.0001, 'display': 'block'}); $('#jq-intro li').hover( function(){$(this).find('div.jq-checkpointSubhead').fadeTo(500, 0.);}, function(){$(this).find('div.jq-checkpointSubhead').fadeTo(500, 0.0001);} ); } Now, my question is: why they used a $.browser.msie detection to make the event different in IE? Why not use the same code for all browsers? Is there a bug in fadeIn/fadeOut, or maybe fadeTo?
[jQuery] Access Ajax content with jquery DOM
Hi, Is there any way to access the DOM of ajax result ???... Like ... I want to access $("#mydiv2").html() . where mydiv2 is in html file which is loaded using ajax... (my ajax result is html). I have one more question is it possible to put below code in my ajax file (which I am going to load using ajax). $(document).ready(function(){ // my code here // - }); Thanks in Advance.
[jQuery] XML manipulation
Dear all, is that possible to get a nodevalue including full tags , not merely text.. eg, I have the following xml data, - empire burlesque bob dylan usa columbia 1985 - and if there any way by jQuery, once I input $ (myXML).find("cd").toString(), it returns - empire burlesque bob dylan usa columbia 1985 - cause $(myXML).find("cd").text() only returns below text value.. - empire burlesque, bob dylan, usa, columbia, 1985 - best regards, thx
[jQuery] Re: best techniques to optimize loading of multiple libraries?
Thanks a million Mike! I hated that code but wasn't sure how to make it better... :) So just to clear things up, you prefer using document.write() to insert tags instead of appending the elements to the DOM: var finan = document.createElement('script'); finan.type = 'text/javascript'; finan.src = 'http://www.mydomain.com/js/mts_finan.js'; head.appendChild(finan); i guess its more efficient because you don't have to access the document object, but any other particular reasons? Awesome, one huge problem out of the way! We're currently at a point where our server isn't exactly being overloaded so i think its safe to host jquery.min on google code and the plugin (yet to be minified) and custom code possibly combined in 1 file, since there won't be a lot of custom code to begin with. Also, to satisfy your curiosity, the whole purpose of using the mts_load.js function is because this code is a part of a banner we're planning to distribute and host in numerous websites, so a lot of them won't want scripts other than their own embedded directly, so we found that calling one simple function (mts_load) that would to all the dirty work was acceptable with them :) On Aug 31, 6:59 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote: > Holy moly, that is complicated! No, you don't need to do any of that. > > Even if it were the right approach, it's poorly coded, with the same > ten-line function duplicated three times, and a completely hard-coded, > non-generalized way of handing the load sequencing. (What do you do if you > need to add *another* .js file, or two or three? Add another special load > function for each one, and another nested callback at the end?) > > My apologies to the developer who coded this - it's nothing personal - > please don't shoot the messenger! > > Assuming that you want to keep the mts_loader.js file, then all you need to > do is change it to: > > == mts_loader.js == > > function script( url ) { > document.write( > '