[jQuery] Issues in JCarousel scroller
Hi there We are facing an issue with JCarousel scroller while loading dynamic data. The scenario is like we have a set of images loaded on to the scroller initially. Later upon a click event on one of the links on the page, we are loading a fresh set of images (via AJAX) to the scroller. We referred the following example to achieve the same.http:// sorgalla.com/projects/jcarousel/examples/dynamic_ajax.html To an extent we achieved what was required. i.e. loading the dynamic data to the scroller. But the issue is say the first set had 5 images and the new set had only 2 images, the remaining 3 from the first set of images were still there on the scroller. Can any one suggest a workaround for this? Regards Thomas
[jQuery] warning: jquery in firefox 3
hello everyone, i just want to ask anybody about this warning that always show whenever my page load with the jquery.js file. Warning: test for equality (==) mistyped as assignment (=)? Source File: http://localhost:2008/jquery.js Line: 1161, Column: 32 Source Code: while ( elem = second[ i++ ] ) anonymous function does not always return a value Source File: http://localhost:2008/jquery.js Line: 1859, Column: 71 Source Code: }); anonymous function does not always return a value Source File: http://localhost:2008/jquery.js Line: 3524, Column: 20 Source Code: this[0][ method ]; though this warning show, it does not affect my entire program. i hope that all of you can make me understand about this or maybe solve this stuff. Thank you very much. Codz
[jQuery] error option for jQuery.ajax
Hi, I have the following code below where I'm trying to dynamically check if an AJAX request error occurs. If an error occurs, do something; otherwise, do something else (if it's a success). But according to jQuery.com, they say You can never have both an error and a success callback with a request. And that's why I'm getting an error when running the code below. Is there a way to solve this? $(document).ready(function() { $.ajax({ type: GET, url: SomeProcessPage.cfm, data: FirstName=JerryLastName=Young, success: function(data) { $(data).appendTo(#myDivId); } error: function(XMLHttpRequest, textStatus, errorThrown){ $(#msg).ajaxError(function(event, request, settings){ $(this).append(liError requesting page + settings.url + /li); }); } }); }); -- View this message in context: http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p20711274.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: error option for jQuery.ajax
Your getting an error in that code because you need a comma after the success:function(){}, Also, make sure there is no comma after the last method in the object or IE throws an error. Josh Powell On Nov 26, 11:51 pm, WebAppDeveloper [EMAIL PROTECTED] wrote: Hi, I have the following code below where I'm trying to dynamically check if an AJAX request error occurs. If an error occurs, do something; otherwise, do something else (if it's a success). But according to jQuery.com, they say You can never have both an error and a success callback with a request. And that's why I'm getting an error when running the code below. Is there a way to solve this? $(document).ready(function() { $.ajax({ type: GET, url: SomeProcessPage.cfm, data: FirstName=JerryLastName=Young, success: function(data) { $(data).appendTo(#myDivId); } error: function(XMLHttpRequest, textStatus, errorThrown){ $(#msg).ajaxError(function(event, request, settings){ $(this).append(liError requesting page + settings.url + /li); }); } });}); -- View this message in context:http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p2... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Doing Ajax call to a page that requires authentication
Thanks for your reply. Sorry that my question wasn't clear enough; I already tried using the username/password options for ajax() method, however, I'm getting 'Permission denied to call method XMLHttpRequest.open' kind of message. I don't know if there is something else need to be done or not. By the way, the credentials I'm using are correct. On Nov 25, 4:24 pm, Pierre Bellan [EMAIL PROTECTED] wrote: Hi, If the authentification is form-based, then the login credentials is passed by GET or POST. So you just have to add it to your ajax request see the data option. $.ajax({ type: POST, url: some.php, data: name=Johnlocation=Boston, success: function(msg){ alert( Data Saved: + msg ); } }); If the authentification is based on .htaccess, you can use username/password option Pierre W. C. Fields - I cook with wine, sometimes I even add it to the food. 2008/11/25 TheBlueSky [EMAIL PROTECTED] Hi everyone, How can I send login credentials with jQuery Ajax request (get(), post () or ajax()) when the page I'm requesting is asking for them before permitting the access. Note here that I'm not talking here about form-based authentication. Thanks in advance.- Hide quoted text - - Show quoted text -
[jQuery] Re: Doing Ajax call to a page that requires authentication
Is the page/resource in another domain? That would obviously not work. That's the only thing I can think of. Karl Rudd On Thu, Nov 27, 2008 at 9:20 PM, TheBlueSky [EMAIL PROTECTED] wrote: Thanks for your reply. Sorry that my question wasn't clear enough; I already tried using the username/password options for ajax() method, however, I'm getting 'Permission denied to call method XMLHttpRequest.open' kind of message. I don't know if there is something else need to be done or not. By the way, the credentials I'm using are correct. On Nov 25, 4:24 pm, Pierre Bellan [EMAIL PROTECTED] wrote: Hi, If the authentification is form-based, then the login credentials is passed by GET or POST. So you just have to add it to your ajax request see the data option. $.ajax({ type: POST, url: some.php, data: name=Johnlocation=Boston, success: function(msg){ alert( Data Saved: + msg ); } }); If the authentification is based on .htaccess, you can use username/password option Pierre W. C. Fields - I cook with wine, sometimes I even add it to the food. 2008/11/25 TheBlueSky [EMAIL PROTECTED] Hi everyone, How can I send login credentials with jQuery Ajax request (get(), post () or ajax()) when the page I'm requesting is asking for them before permitting the access. Note here that I'm not talking here about form-based authentication. Thanks in advance.- Hide quoted text - - Show quoted text -
[jQuery] Re: remote validation with additional parameter
Thats test code, nothing useful for an application. The code I posted is what you'll want to use: $(#myform).validate({ rules: { username: { required: true, remote: { url: checkusername.php, type: post data: { email: function() { return $(#email).val() } } } } } }); Just put any option you need into that object literal and add additional data to the data property. You need the latest js file for it to work: http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.validate.js Jörn On Thu, Nov 27, 2008 at 12:29 PM, hcvitto [EMAIL PROTECTED] wrote: hi i just needed that option today!! for the moment i just found a not-very-good way out which works for me. Among the pages you suggested i found this: test(remote, customized ajax options, function() { expect(2); stop(); var v = $(#userForm).validate({ rules: { username: { required: true, remote: { url: users.php, type: post, beforeSend: function(request, settings) { same(settings.type, post); same(settings.data, username=asdfemail=email.com); }, data: { email: function() { return email.com; } }, complete: function() { start(); } } } } }); $(#username).val(asdf); $(#userForm).valid(); }); but i'm not sure how to use it..any help? Thanks Vitto On 25 Nov, 20:15, Jörn Zaefferer [EMAIL PROTECTED] wrote: With the 1.5 release you will be able to use this instead: $(#myform).validate({ rules: { username: { required: true, remote: { url: checkusername.php, type: post data: { email: function() { return $(#email).val() } } } } } }); In other words, you can override all settings that $.ajax supports by replacing the currentremote: url withremote: {url:url} and add whatever you need. You can try it out now (http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/) or wait for the next release. Feedback is welcome! Jörn On Thu, Nov 20, 2008 at 8:28 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote: The current workaround I recommend is to use ajaxSend: $().ajaxSend(function(e, xml, settings) { $.extend(settings.data, { field2: $(#field2).val() }); }); With the drawback that it gets applied to all ajax requests. Depends on your application if thats a problem and how to avoid it. Jörn On Thu, Nov 20, 2008 at 5:17 PM, SMaDeP [EMAIL PROTECTED] wrote: I want to make a duplicate check withremotevalidation, but I need an additional parameter like the parent key (no duplicate article numbers within one order)! does addMethod support async validation? can I add an additional parameter to theremote-url? How? Thanks in advance, Stefan
[jQuery] Re: remote validation with additional parameter
hi i just needed that option today!! for the moment i just found a not-very-good way out which works for me. Among the pages you suggested i found this: test(remote, customized ajax options, function() { expect(2); stop(); var v = $(#userForm).validate({ rules: { username: { required: true, remote: { url: users.php, type: post, beforeSend: function(request, settings) { same(settings.type, post); same(settings.data, username=asdfemail=email.com); }, data: { email: function() { return email.com; } }, complete: function() { start(); } } } } }); $(#username).val(asdf); $(#userForm).valid(); }); but i'm not sure how to use it..any help? Thanks Vitto On 25 Nov, 20:15, Jörn Zaefferer [EMAIL PROTECTED] wrote: With the 1.5 release you will be able to use this instead: $(#myform).validate({ rules: { username: { required: true, remote: { url: checkusername.php, type: post data: { email: function() { return $(#email).val() } } } } } }); In other words, you can override all settings that $.ajax supports by replacing the currentremote: url withremote: {url:url} and add whatever you need. You can try it out now (http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/) or wait for the next release. Feedback is welcome! Jörn On Thu, Nov 20, 2008 at 8:28 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote: The current workaround I recommend is to use ajaxSend: $().ajaxSend(function(e, xml, settings) { $.extend(settings.data, { field2: $(#field2).val() }); }); With the drawback that it gets applied to all ajax requests. Depends on your application if thats a problem and how to avoid it. Jörn On Thu, Nov 20, 2008 at 5:17 PM, SMaDeP [EMAIL PROTECTED] wrote: I want to make a duplicate check withremotevalidation, but I need an additional parameter like the parent key (no duplicate article numbers within one order)! does addMethod support async validation? can I add an additional parameter to theremote-url? How? Thanks in advance, Stefan
[jQuery] trying to style thickbox
hi there im trying to style thickbox so it looks a little better howerev im lost. i have seen some places on the web where its styled real nice but i cant see how it is done can anyone offer me pointers ? one example is on biocompare.com (click signin or register!) tnx sean -- View this message in context: http://www.nabble.com/trying-to-style-thickbox-tp20716471s27240p20716471.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: trying to act on certain DIV's and not others
David, Seasoup, Ricardo, thank you all so very much for taking the time, lots to go on, many thanks again. On Nov 27, 6:32 am, ricardobeat [EMAIL PROTECTED] wrote: Use the attribute selector for this: $('something').click(function(){ $('[id*=contact').hide(); // *= means 'contains' }); see Attribute Filters athttp://docs.jquery.com/Selectors But as seasoup said, there are better ways to structure your app. - ricardo On Nov 26, 2:18 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi folks, apologies if this is a completely noob question. I wish to close (hide) and number of div's whilst leaving others open. I considered the possibility that it might be feasible in Jquery to act on div's with a certain pattern in the id name. Not sure if this is true tho; for example div id-=contact_blah div id=contact_yak div id=nothanks so that the first two div's would be subject to being hidden, and the third left alone. I wish essentially to have a series of links toggle the visibility of some div's, but when a link is clicked and a div is unhidden, - all other divs to hide. Any ideas? best wishes and thanks Steve / Nibb
[jQuery] Re: remote validation with additional parameter
Wow..Jörn you're just great!! Thanks a lot! It works in chrome, firefox and ie6... On 27 Nov, 13:16, Jörn Zaefferer [EMAIL PROTECTED] wrote: Thats test code, nothing useful for an application. The code I posted is what you'll want to use: $(#myform).validate({ rules: { username: { required: true, remote: { url: checkusername.php, type: post data: { email: function() { return $(#email).val() } } } } } }); Just put any option you need into that object literal and add additional data to the data property. You need the latest js file for it to work:http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.vali... Jörn On Thu, Nov 27, 2008 at 12:29 PM, hcvitto [EMAIL PROTECTED] wrote: hi i just needed that option today!! for the moment i just found a not-very-good way out which works for me. Among the pages you suggested i found this: test(remote, customized ajax options, function() { expect(2); stop(); var v = $(#userForm).validate({ rules: { username: { required: true, remote: { url: users.php, type: post, beforeSend: function(request, settings) { same(settings.type, post); same(settings.data, username=asdfemail=email.com); }, data: { email: function() { return email.com; } }, complete: function() { start(); } } } } }); $(#username).val(asdf); $(#userForm).valid(); }); but i'm not sure how to use it..any help? Thanks Vitto On 25 Nov, 20:15, Jörn Zaefferer [EMAIL PROTECTED] wrote: With the 1.5 release you will be able to use this instead: $(#myform).validate({ rules: { username: { required: true, remote: { url: checkusername.php, type: post data: { email: function() { return $(#email).val() } } } } } }); In other words, you can override all settings that $.ajax supports by replacing the currentremote: url withremote: {url:url} and add whatever you need. You can try it out now (http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/) or wait for the next release. Feedback is welcome! Jörn On Thu, Nov 20, 2008 at 8:28 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote: The current workaround I recommend is to use ajaxSend: $().ajaxSend(function(e, xml, settings) { $.extend(settings.data, { field2: $(#field2).val() }); }); With the drawback that it gets applied to all ajax requests. Depends on your application if thats a problem and how to avoid it. Jörn On Thu, Nov 20, 2008 at 5:17 PM, SMaDeP [EMAIL PROTECTED] wrote: I want to make a duplicate check withremotevalidation, but I need an additional parameter like the parent key (no duplicate article numbers within one order)! does addMethod support async validation? can I add an additional parameter to theremote-url? How? Thanks in advance, Stefan
[jQuery] Re: animate problem with IE7
The answer for the ticket is: That's a matter of css. Different browser have different whims when it comes to scrolling. Try adding height and width to the containing UL. I tried adding width and height to the UL but nothing changes... to the div wrapping the UL but again, nothing is changed. The LI elements are already fixed... :-| Any other idea?!? On Nov 25, 11:42 pm, ^AndreA^ [EMAIL PROTECTED] wrote: Ticket opened...http://dev.jquery.com/ticket/3650 bye, Andrea On Nov 24, 11:35 pm, ^AndreA^ [EMAIL PROTECTED] wrote: Yesterday I tried to open a ticket but the server (onhttp://dev.jquery.com/) was not responding as it should so I posted a thread also in the jQuery development google group. http://groups.google.com/group/jquery-dev/browse_thread/thread/945f3c... Nobody has replied so far... I wait a couple of days to see if somebody knows something about it and then I'll report it. BTW, Jeffrey, thank you very much for your time!!! Andrea On Nov 24, 6:20 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: Regardless, it is possible that the actual bug may be in the core animate function as regards to animating relative percentages. Don't forget to open a ticket on it (dev.jquery.com) JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Monday, November 24, 2008 3:06 AM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 jQuery cycle plugin is very nice but I have had bad experiences with plugins... Usually they do a lot of things but not exactly what I need, therefore I have to start tweaking them and 'often' it would take less time doing it from scratch... often... ;-) On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote: why don´t you use Jquery Cycle plugin? On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I'm not an expert in the animation sytem -- you should open a ticket (dev.jquery.com) and get some others to take a look at it. When I stepped through the code, I found a potential problem here, line 3043 of jquery.js // We need to compute starting value if ( unit != px ) { self.style[ name ] = (end || 1) + unit; start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } The div in question has a starting position of: left:-50%; The value of end is 50, unit is %. All of the other divs that had a positive percentage were handled correctly. While processing this div the starting position was somehow altered to -4%, leaving the ending position at 46% (-4 + 50). I'm not that familiar with the animation plumbing, so I'm not sure why this is occurring. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 4:26 PM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 Hi Jeffrey, thanks. I deleted the float: left;, i didn't know was useless with position:absolute; Anyway, I noted the strange behaviour of the li elements too. I uploaded jQuery unpacked... if you still want to have a look... ;-) BTW, there could be something wrong with animate('left','+=50%'); but that would mean a bug... :-| Thanks, Andrea On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I watched the animation with the IE developer toolbar, and noticed a couple of oddities. Firstly, the CSS for the divs are set to both position:absolute and float:left. This is not the source of the problem (I overwrite to float:none and tried it), but float:left is unnecessary if with absolute positioning. Anyway, then I monitored the left: position as the animations happened. While going to the right, everything went as usual. Div#0 0% to -50% Div#1 25% to -25% Div#2 50% to 0% Div#3 75% to 25% Div#4 100% to 50% Div#5 125% to 75% All good. Then I refreshed and tried going to the left. Div#0 0% to 50% Div#1 25% to 75% Div#2 50% to 100% Div#3 75% to 125% Div#4 100% to 45% Div#5 125% to 48% As you can see, divs 0-3 were fine. Divs 4 and 5 got WEIRD settings. Now, I tried stepping through the code, but your jQuery is minified. My guess is there is something wrong with the animate('left','+=50%'); Cheers, JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 3:29 PM To: jQuery (English) Subject: [jQuery] animate problem with IE7 Hi all, I'm working
[jQuery] [jCarousel] Question about weird autoscrolling
Hello everyone, I am using jcaousel autoscoll autoscrolling based on this example: http://sorgalla.com/projects/jcarousel/examples/static_auto.html. In stead of pictures I am using just plain text: div style=padding-bottom:10px ul id=mycarousel class =jcarousel-skin-tango li p class=kopKlein style=width:120pxArtikel 1/p p class=tekstVak style=width:120px bLees alles over onze nieuwe content rotator/b a href=http://mbalance/news/news_item/7;read moregt;/a /p /li li p class=kopKlein style=width:120pxArtikel 2/p p class=tekstVak style=width:120px bBlaat je /b a href=http://mbalance/news/news_item/5;read moregt;/a /p /li li p class=kopKlein style=width:120pxArtikel 3/p p class=tekstVak style=width:120px bDit gaat nergens over /b a href=http://mbalance/news/news_item/6;read moregt;/a /p /li li p class=kopKlein style=width:120pxArtikel 4/p p class=tekstVak style=width:120px btest head/b a href=http://mbalance/news/news_item/4;read moregt;/a /p /li li p class=kopKlein style=width:120pxArtikel 5/p p class=tekstVak style=width:120px bInteresting subhead/b a href=http://mbalance/news/news_item/2;read moregt;/a /p /li /ul /div I got it all working but there is one weird thing. When the page loads it starts by Artikel 1, then it jumps to artikel 4 en goes to artikel 5. Than it jumps back to artikel 1 and starts over again. These are my settings: function mycarousel_initCallback(carousel) { // Disable autoscrolling if the user clicks the prev or next button. carousel.buttonNext.bind('click', function() { carousel.startAuto(0); }); carousel.buttonPrev.bind('click', function() { carousel.startAuto(0); }); // Pause autoscrolling if the user moves with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); }; jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ auto: 2, wrap: 'last', initCallback: mycarousel_initCallback }); }); Can anyone tell me what I'm doing wrong?
[jQuery] Lightbox/ThickBox/ui.dialog etc
Hi there, Does anyone have an opinion on what they think is the best lightbox implementation to use? It's not going to be used to display images, it's mainly form interaction. My only caveat's are: - Must be draggable - Must (unfortunately) work in IE6 - Must be modal I've been playing with ui.dialog and really like it. However I seem to be having some issues in IE6 - using the same theme as displayed on this page: http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog The close image on the title bar is causing some layout issues and also select elements from the underlying content are appearing through into the content of the dialog. A quick search brought back this: http://jquery.com/demo/thickbox/. Appears to do everything required except be draggable. Can anyone point me in the right direction? Cheers, Lee
[jQuery] Selecting elements based on exact content
Hi all The :contains(text) selector will select any element that contains the specified text (similar to a like '%stuff%' database query). How can I find only exact matches? i.e. if I'm searching for 'ants', to find only elements containing the text 'ants', and not elements containing the text 'pants' or 'antsy'? Thanks David
[jQuery] Can't get appropriate elements from server response.
Here is JS my code where I intend to get 2 DIVs and use there content. $.post( someAction, $.param(outData), onUpdatePostSuccess ); function onUpdatePostSuccess(data) { alert(data); var newTitleHTML = $(#newTopicTitle, data).html(); var newContentHTML = $(#newTopicMessage, data).html(); if (newTitleHTML newContentHTML) { $(#topicTitle).html(newTitleHTML); divMsg.html(newContentHTML); } else { divMsg.html(data); } } The alert(data); code line returns the following HTML code: div id=newToticTitleNew Topic Title/div div id=newTopicMessageNew Topic Message/div BUT, the code is always goes to else section in if conditional. Where can be the problem? I've used the same code in other section of the script and it works fine. Have spend a day struggling the problem but no luck :( Seems that I can't make any actions like $(expr, context) in onUpdatePostSuccess function.
[jQuery] Disable/Enable jQuery Added Events
Something I would like to do is to add several events handlers to an element and control the firing by enabling disabling it. For example: jQuery(.sample).click(function() { // do something }).disable(); Clicking should not fire the event until jQuery(.sample).enable() has been called. Have anyone done something similar?
[jQuery] Block UI
Hi, please fix problem with submit and image butons on block. Right now if focus left in form user can resubmit form by Enter even if I block form/window by .block()/.blockUI().
[jQuery] [validate] remote checking and apache rewrite problem
Hi i have a problem with remote checking. I have two identical scripts, both of them return 'true' or 'false': 1. /something.php 2. /script/something When i use the first PHP script in remote, javascript sends data to the PHP script and PHP sends data to javascript. Everything is working OK. But when i use the second PHP script in remote, which is executed the same way as the first, but the difference is, that this second script is handled through Apache's rewrite function, this second script sends data to PHP correctly but receives NO ANSWER. Although the script itself displays 'true' or 'false' when you call it directly from the browser. Is there any way that remote checking in jquery's validate will work with apache's rewrite ? Or am I doing something wrong ?
[jQuery] how to call a function at outside object in jQuery's click function?
I met a small problem that an outside 'example' object does not be got in a 'click' function. would you tell me how to do that? == example code: == var Example = function(){}; Example.prototype = { i_want_to_call_this_function: function(){ alert('Hi!'); }, execute: function(){ $('#any_button').click(function(){ // How to call 'i_want_to_call_this_function' from here? // this.i_want_to_call_this_function(); // - Unknown. i know a 'this' object pointed to html object. }); } }; var example = new Example(); example.execute();
[jQuery] registering a callback on an jcarousel image
Hey guys, I have the following code to to something, when an image in the carousel gets clicked: $(document).ready(function(){ jQuery('#mycarousel').jcarousel({ itemLoadCallback: mycarousel_itemLoadCallback, initCallback: test }); }); function test (a, b) { $('li.jcarousel-item img').click(function () { console.log(dit it); }); } But unfortunately nothing gets logged to the Firebug console, so nothing happens when I click an image. What am I doing wrong here? Regards, Samy
[jQuery] jquery form plugin: fieldValue vs. val
Greetings! I've seen http://docs.jquery.com/JQuery_1.2_Roadmap#Form.2FField_Serialization http://docs.jquery.com/Release:jQuery_1.2/Attributes. Is fieldValue() still better then standard val()?
[jQuery] Re: superfish + bgiframe problem on IE6
I'm having the same issue of the drop down pushing the content below it further down: http://tinyurl.com/6qczuv. It would be great if someone could point me to where the issue might be. Joel Birch wrote: Hi Bob, You seem to be missing some very important CSS. The submenu ul elements must be position absolute. Also, I don't see any 'top' or 'left' values or hover rules for them. Please refer to the original demo CSS files for further clues. Joel Birch On 23/10/2008, Bob Sawyer [EMAIL PROTECTED] wrote: So, the problem I'm having with IE6/Superfish is that the dropdown menus push all other content down, rather than displaying on top of the other content. My superFish code is fairly straightforward: $(document).ready(function() { //superFish $('ul#menu').superfish({ animation : { opacity:show,height:show}, pathClass: current, speed: fast }); $('ul#menu').superfish().find('ul').bgIframe({opacity:false}); }); Removing either line makes no difference -- the result is the same, and obviously having both in there is probably overkill. My menu is pretty lightweight: div id=nav class=grid_12 ul id=menu li class=current /home Home /li li /collections Collections ul li /collections/collection/fall2008 2008Fall 2008 /li li /collections/collection/spring2009 2009Spring 2009 /li /ul /li li /about About Us ul li /news News /li li /press Press /li /ul /li li /contact Contact Us /li /ul /div I stripped the existing superfish.css down to only the Essential Styles and apply hovers to modern browsers sections; otherwise the CSS is pretty straightforward as well: #nav { width: 960px; height: 40px; background: transparent url(/images/nav_bg.gif) 0px 0px no-repeat; display: block; position: relative; margin: 15px 0 0 0; z-index: 100; } #menu li {position: relative; display:block; float: left; height: 40px; margin: 0; padding: 0; font-size: 16px; line-height: 40px; } #menu li a {position: relative; display: block; float: left; color: #64a3b5;text-decoration: none; height: 40px; padding: 0 20px; } #menu li a:link { color: #64a3b5; } #menu li a:hover { color: #000; background: #dfdfdf; } #menu li.current a { color: #333; } #menu ul {display: block; background-color: #f0e9f1; border-bottom: 1px solid #ccc; margin: 0; padding: 0; clear: both; width: 130px;} #menu ul li {position: relative; display: block; float: none; height: 30px; margin: 0; padding: 0; line-height: 30px; font-size: 90%;} #menu ul li a {position: relative; display: block; float: none; color: #64a3b5; text-decoration: none; height: 30px; margin: 0; padding: 0 0 0 15px; z-index: 120;} #menu ul li a:hover { color: #000; background: #dfdfdf; } #menu ul li.current a { color: #333; } Any ideas? Thanks, Bob -- View this message in context: http://www.nabble.com/superfish-%2B-bgiframe-problem-on-IE6-tp19795827s27240p20717771.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] [validate]
Hello i have a question about the remote checking. My question is: does the remote method need the php script to have .php in its name ? (i.e.: something.php) In other words, does remote method work with Apache's Rewrite function? I have two identical scripts which both return TRUE or FALSE to jquery. Scripts: remote: /somedir/something.php - it works (jquery sends data and receives TRUE or FALSE correctly) remote: /rewritedir/something - doesn't work (jquery sends data and doesnt receive anything) The second example with apache's rewrite works only one way - jquery validation sends the data to the php script, but it cannot read the data back (at least for me). Can anyone please tell me if it can work this way? I really would like to preserve Apache's rewrite function...
[jQuery] Re: can't get an attribute from an appended img
Code helps, particularly simplified code! Howard On Nov 26, 11:47 am, Radu [EMAIL PROTECTED] wrote: hi, this is my first post on the group so, i have a form through wich i'm sending an ajax reques to a php script and get the result back. to be more clear i write a text into an input box then i submit it to a php file where I make an image from the text using gd2. Then I send back the path to the image. I use this path so i can add images to a div. add the images to the div i'm using append(). The ids of the images are dynamicly made. all ok until this point what I want to do is, when I clikc an image to optain it's id (in an alert for example) For some reason I get the ids only for the elements that were originaly in the page, but not for the appended imgs Thanks, Radu
[jQuery] Re: jQuery timing out on page load
It shouldn't timeout if you're not running any functions, are you using the packed version? Are you sure you don't have any javascript code on these pages? On Nov 11, 3:01 am, harryhobbes [EMAIL PROTECTED] wrote: Hi, I've got jQuery loading by default on my site. The library is only used on some pages in my site, however when I load a page that isn't using jquery (but still loading the file in the html header) Firefox pops up with a warning that jquery is timing out. Any suggestions? Cheers
[jQuery] Re: jQuery timing out on page load
I'm guessing the path is wrong, are you using absolute paths or relative? ricardobeat wrote: It shouldn't timeout if you're not running any functions, are you using the packed version? Are you sure you don't have any javascript code on these pages? On Nov 11, 3:01 am, harryhobbes [EMAIL PROTECTED] wrote: Hi, I've got jQuery loading by default on my site. The library is only used on some pages in my site, however when I load a page that isn't using jquery (but still loading the file in the html header) Firefox pops up with a warning that jquery is timing out. Any suggestions? Cheers
[jQuery] Use of getBoxObjectFor() is deprecated. Try to use element.getBoundingClientRect() if possible.
Searched around and found a old post here but there was no answer. Any idea what this is about and how I can squash it? Ed
[jQuery] Re: [validate] remote checking and apache rewrite problem
Is there a redirect involved? If so, my guess is that the XMLHttpRequest doesn't follow the redirect, just gets the 30x code and no response body. I don't think the plugins can do anything about that... Jörn On Thu, Nov 27, 2008 at 12:02 PM, jurkoferko [EMAIL PROTECTED] wrote: Hi i have a problem with remote checking. I have two identical scripts, both of them return 'true' or 'false': 1. /something.php 2. /script/something When i use the first PHP script in remote, javascript sends data to the PHP script and PHP sends data to javascript. Everything is working OK. But when i use the second PHP script in remote, which is executed the same way as the first, but the difference is, that this second script is handled through Apache's rewrite function, this second script sends data to PHP correctly but receives NO ANSWER. Although the script itself displays 'true' or 'false' when you call it directly from the browser. Is there any way that remote checking in jquery's validate will work with apache's rewrite ? Or am I doing something wrong ?
[jQuery] Flow control in functions.....
I may have titled this wrong but that is the best description I could think of being a newbie. I have a function the inside calls another function. What I need to have happen is for the calling function to wait for a response from the called function but that is not what is happening. The calling function goes right on processing the rest of the script which of course errors out because the required vars are not set properly yet. Here is some code var chkmail = function(data){ if (data.exists == 1){ $('#emailerror').show(); var emailerror = 1; } else{ $('#emailerror').hide(); var olde = $('#editaemail').val(); var emailerror = 0; } return emailerror; } //This is the pre submit function for the Jquery form plugin function presub(){ \\get the new email address entered in the form newe = $('#editaemail').val(); \\set the url var so IE won't cache the ajax call url = '/myaccount/process.cfm?t=' + new Date().getTime(); \\password change test vars p1 = $('#editapassword1').val(); p2 = $('#editapassword2').val(); \\default error state vars set to 0 emailerror = 0; passworderror = 0; \\UI update to notify client $('#editasave').attr(disabled,disabled).attr(value,One Moment); \\Test old email (set at doc.ready) to new email to see if they are different if(olde != newe){ \\send new email through post to search DB for existing \\returns JSON either {exists:1} or {exists:0} \\callback set to fire chkmail() $.post(url, {checkname: newe}, chkmail, json); } \\Check password fields to see if they are the same if (p1 != p2){ $('#passerror').show(); passworderror = 1; } else{ $('#passerror').hide(); } if(emailerror == 0 passworderror == 0) { return true; } else{ $('#editasave').removeAttr(disabled).attr(value,Save Changes); return false; } } After the $.post functions callback is triggered the script continues on to the password checks and since the $.post function hasn't received a response yet, the system doesn't catch the errors with the email address. I'm sure there is a more robust way of doing this but as I said earlier, I am a newbie to JS and learning as I go. Any help would be appreciated.
[jQuery] Re: Selecting elements based on exact content
A filter function would do: $('elements').filter(function(){ return $(this).text() == 'ants'; }); - ricardo On Nov 27, 8:04 am, Dovdimus Prime [EMAIL PROTECTED] wrote: Hi all The :contains(text) selector will select any element that contains the specified text (similar to a like '%stuff%' database query). How can I find only exact matches? i.e. if I'm searching for 'ants', to find only elements containing the text 'ants', and not elements containing the text 'pants' or 'antsy'? Thanks David
[jQuery] Re: how to call a function at outside object in jQuery's click function?
Try this: var Example = function(){}; Example.prototype = { abobora: function(){ alert('Hi!'); }, execute: function(){ var t = this; $('#any_button').click(function(){ t.abobora(); }); } }; - ricardo On Nov 27, 7:39 am, Yam. [EMAIL PROTECTED] wrote: I met a small problem that an outside 'example' object does not be got in a 'click' function. would you tell me how to do that? == example code: == var Example = function(){}; Example.prototype = { i_want_to_call_this_function: function(){ alert('Hi!'); }, execute: function(){ $('#any_button').click(function(){ // How to call 'i_want_to_call_this_function' from here? // this.i_want_to_call_this_function(); // - Unknown. i know a 'this' object pointed to html object. }); } }; var example = new Example(); example.execute();
[jQuery] Re: Why does :not([id=blah]) not work?
Awesome - that cleared everything up for me!!! I went right to the cleaner version, and it worked. Thank you so much, Jeremy
[jQuery] Re: Disable/Enable jQuery Added Events
use .data to store a boolean variable on the DOM element, then in the click function check that variable to see if it is enabled or not. Josh Powell On Nov 27, 12:46 am, Neil Craig [EMAIL PROTECTED] wrote: Something I would like to do is to add several events handlers to an element and control the firing by enabling disabling it. For example: jQuery(.sample).click(function() { // do something }).disable(); Clicking should not fire the event until jQuery(.sample).enable() has been called. Have anyone done something similar?
[jQuery] How to pass loop increment to Jquery
Hi, I've my PHP code generating rows using certain loop conditons, And I'd like to show/hide a div overlay on mouseover and mouseout of a text link generated in each row respectively. I wrote the following code. this seems to be show div overlay of last row. That is because I wrote the function in document.ready. I dont think Jquery lets us put javascript in HTML code, So how can I make my code work in such a case? $(document).ready(function(){ var i= $(#count).val(); for(j=0;ji;j++){ var k = #show_details+j; var refer = #show +j; $(k).hide(); $(refer).mouseover(function(){ $(k).show(slow); }); $(refer).mouseout(function(){ $(k).hide(slow); }); } });
[jQuery] Re: How to pass loop increment to Jquery
you can use jquery's .each() which is passed the loop index but to be honest the best thing to do is to use a class and replace al that code with $(.show_details) .hover(function() { $(this).show(slow); },function() { $(this).hide(slow); }); --adam On Nov 27, 2:20 pm, Sai Krishna [EMAIL PROTECTED] wrote: Hi, I've my PHP code generating rows using certain loop conditons, And I'd like to show/hide a div overlay on mouseover and mouseout of a text link generated in each row respectively. I wrote the following code. this seems to be show div overlay of last row. That is because I wrote the function in document.ready. I dont think Jquery lets us put javascript in HTML code, So how can I make my code work in such a case? $(document).ready(function(){ var i= $(#count).val(); for(j=0;ji;j++){ var k = #show_details+j; var refer = #show +j; $(k).hide(); $(refer).mouseover(function(){ $(k).show(slow); }); $(refer).mouseout(function(){ $(k).hide(slow); }); } });
[jQuery] Re: How to pass loop increment to Jquery
you'd have to tweak that i kind of missed your structure slightly, but the idea is to just use a class and let jquery handle the iterating... --adam On Nov 27, 2:35 pm, ajpiano [EMAIL PROTECTED] wrote: you can use jquery's .each() which is passed the loop index but to be honest the best thing to do is to use a class and replace al that code with $(.show_details) .hover(function() { $(this).show(slow);},function() { $(this).hide(slow); }); --adam On Nov 27, 2:20 pm, Sai Krishna [EMAIL PROTECTED] wrote: Hi, I've my PHP code generating rows using certain loop conditons, And I'd like to show/hide a div overlay on mouseover and mouseout of a text link generated in each row respectively. I wrote the following code. this seems to be show div overlay of last row. That is because I wrote the function in document.ready. I dont think Jquery lets us put javascript in HTML code, So how can I make my code work in such a case? $(document).ready(function(){ var i= $(#count).val(); for(j=0;ji;j++){ var k = #show_details+j; var refer = #show +j; $(k).hide(); $(refer).mouseover(function(){ $(k).show(slow); }); $(refer).mouseout(function(){ $(k).hide(slow); }); } });
[jQuery] Re: How to pass loop increment to Jquery
thank you Ill try that On Nov 28, 12:36 am, ajpiano [EMAIL PROTECTED] wrote: you'd have to tweak that i kind of missed your structure slightly, but the idea is to just use a class and let jquery handle the iterating... --adam On Nov 27, 2:35 pm, ajpiano [EMAIL PROTECTED] wrote: you can use jquery's .each() which is passed the loop index but to be honest the best thing to do is to use a class and replace al that code with $(.show_details) .hover(function() { $(this).show(slow);},function() { $(this).hide(slow); }); --adam On Nov 27, 2:20 pm, Sai Krishna [EMAIL PROTECTED] wrote: Hi, I've my PHP code generating rows using certain loop conditons, And I'd like to show/hide a div overlay on mouseover and mouseout of a text link generated in each row respectively. I wrote the following code. this seems to be show div overlay of last row. That is because I wrote the function in document.ready. I dont think Jquery lets us put javascript in HTML code, So how can I make my code work in such a case? $(document).ready(function(){ var i= $(#count).val(); for(j=0;ji;j++){ var k = #show_details+j; var refer = #show +j; $(k).hide(); $(refer).mouseover(function(){ $(k).show(slow); }); $(refer).mouseout(function(){ $(k).hide(slow); }); } });
[jQuery] Re: remove objects from set
On 26 Lis, 18:33, ricardobeat [EMAIL PROTECTED] wrote: You can add elements to a jQuery object simply using $('originalobject').add('#someid').add('.someclass').add($ ('anotherobject')).add(node); Thanks for your help. This is what I needed to do: $(function() { $.extend({ validation: { invalidFields: $([]), } } ); $.fn.extend({ setValidationError: function() { for (var i = 0, len = this.length; i len; i++) { $.validation.invalidFields = $.validation.invalidFields.add (this[i]); } }, removeValidationError: function() { for (var i = 0, len = this.length; i len; i++) { $.validation.invalidFields = $.validation.invalidFields.not (this[i]); } } }); }); -- regards, takeshin
[jQuery] Re: Lightbox/ThickBox/ui.dialog etc
check this one out, I think it will do all that you need: http://dev.iceburg.net/jquery/jqModal/ - Jack Lee Mc wrote: Hi there, Does anyone have an opinion on what they think is the best lightbox implementation to use? It's not going to be used to display images, it's mainly form interaction. My only caveat's are: - Must be draggable - Must (unfortunately) work in IE6 - Must be modal I've been playing with ui.dialog and really like it. However I seem to be having some issues in IE6 - using the same theme as displayed on this page: http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog The close image on the title bar is causing some layout issues and also select elements from the underlying content are appearing through into the content of the dialog. A quick search brought back this: http://jquery.com/demo/thickbox/. Appears to do everything required except be draggable. Can anyone point me in the right direction? Cheers, Lee
[jQuery] Re: error option for jQuery.ajax
Great. I'll try it out when I return to work next week. Thank you so much! seasoup wrote: Your getting an error in that code because you need a comma after the success:function(){}, Also, make sure there is no comma after the last method in the object or IE throws an error. Josh Powell On Nov 26, 11:51 pm, WebAppDeveloper [EMAIL PROTECTED] wrote: Hi, I have the following code below where I'm trying to dynamically check if an AJAX request error occurs. If an error occurs, do something; otherwise, do something else (if it's a success). But according to jQuery.com, they say You can never have both an error and a success callback with a request. And that's why I'm getting an error when running the code below. Is there a way to solve this? $(document).ready(function() { $.ajax({ type: GET, url: SomeProcessPage.cfm, data: FirstName=JerryLastName=Young, success: function(data) { $(data).appendTo(#myDivId); } error: function(XMLHttpRequest, textStatus, errorThrown){ $(#msg).ajaxError(function(event, request, settings){ $(this).append(liError requesting page + settings.url + /li); }); } });}); -- View this message in context:http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p2... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p20725653.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: How to pass loop increment to Jquery
I dont know where am I doing mistake here. Could somebody point out? $(document).ready(function(){ $(.show).hover.each( function(){ $(.show_details).hide(slow); }, function(){ $(.show_details).show(slow); }) }); On Nov 28, 1:10 am, Sai Krishna [EMAIL PROTECTED] wrote: thank you Ill try that On Nov 28, 12:36 am, ajpiano [EMAIL PROTECTED] wrote: you'd have to tweak that i kind of missed your structure slightly, but the idea is to just use a class and let jquery handle the iterating... --adam On Nov 27, 2:35 pm, ajpiano [EMAIL PROTECTED] wrote: you can use jquery's .each() which is passed the loop index but to be honest the best thing to do is to use a class and replace al that code with $(.show_details) .hover(function() { $(this).show(slow);},function() { $(this).hide(slow); }); --adam On Nov 27, 2:20 pm, Sai Krishna [EMAIL PROTECTED] wrote: Hi, I've my PHP code generating rows using certain loop conditons, And I'd like to show/hide a div overlay on mouseover and mouseout of a text link generated in each row respectively. I wrote the following code. this seems to be show div overlay of last row. That is because I wrote the function in document.ready. I dont think Jquery lets us put javascript in HTML code, So how can I make my code work in such a case? $(document).ready(function(){ var i= $(#count).val(); for(j=0;ji;j++){ var k = #show_details+j; var refer = #show +j; $(k).hide(); $(refer).mouseover(function(){ $(k).show(slow); }); $(refer).mouseout(function(){ $(k).hide(slow); }); } });
[jQuery] Validation
hi, I'm using the jQuery Validation plugin for a big project and I'm loving it. I am however getting desperate trying to solve a particular issue. I've hunted for a solution for days now and tried everything I could think of, but it seems I coded myself into a deadlock. I'm hoping you can have a quick look at my code, it's only a little bit :) I'm developing a user registration form with quite some advanced validation. So far it works just fine, apart from one thing: remotely checking if the username does not exist already. Here's my code: // extend the validation plugin to do remote username dupe checking jQuery.validator.addMethod('usernameCheck', function(username) { var postURL = ?= $basepath; ?user/json_username_check/ + username + / + new Date().getTime(); $.ajax({ type: POST, url: postURL, success: function(msg) { result = (msg=='TRUE') ? true : false; } }); return result; }, ''); The problem is that I cannot return the result of the Ajax call back to the Validator. The Ajax call itself works fine, I can see that using Firebug. I've been advised to not use this low level jQuery Ajax call, but to use the remote option of the validator plugin instead. However, the reason I'm not using the remote selector from the Validation plugin is that my backend (Code Igniter) does not accept params in the format ?name=value. It will block all those. Code Igniter expects this: /name/value. It is possible to tell Code Igniter to use query strings, but that will break my entire application. Therefore, I am forced to use the $.ajax call. In my research somewhere I found somebody saying that asynchronous calls inside an addmethod do not work. I figured explicitly setting the async = false in the Ajax request (not shown above) would help, but it doesn't. The Ajax request itself works fine but I have no way to return the result of it to the Validator plugin. With remote not being an option and AddMethod not working, I have no idea what to do next. I don't mean to sound lazy, but rewriting or hacking the plugin itself beats my purpose of reusing and saving time. I've been so productive in producing forms thanks to this plugin but spending so much time on this little part got me quite depressed. I hope you can give me some advise, I would be very grateful. Thanks! Ferdy
[jQuery] Why keyCode into keyup event is disable
I'm trying to use the folowing code !-- --- HTML botom of the page -- scriptinitform()/script /*** Javascript ***/ function initform() { // To find every input field into myform and attach mykeyupfct $([EMAIL PROTECTED]'password']:visible,input [EMAIL PROTECTED]'text']:visible).attr(id,function(){ $(this).keyup(function() {mykeyupfct(this);}); }) } function mykeyupfct(myfield) { var sid=#+myfield.id var skey $(sid).keyup(function(e) { skey = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; alert(never alert : + skey); }); alert(always alert but no skey for +sid); } Im also tryinng : $(sid).bind('keyup', function(e) {skey=e.keyCode; alert(skey); }) but it's the same problem Thank's a lot for your help A beginner jQuery Soledad
[jQuery] disable header breaks tablesort
Hi, i have a table col1 | col2 | col3 I don't want col2 to be sortable... So I added $(#tblusers).tablesorter({ headers: { 1: { sorter: false } } }); Now, the column is not sortable as I wish, but it breaks the other 2 columns. I can click on the other 2 columns only once each. It sorts them correctly, in descending order, but then won't let me sort ascending. The only way header1 will respond again is if i click column 3 (which again is locked on descending).. Can anybody help? Thanks -- View this message in context: http://www.nabble.com/disable-header-breaks-tablesort-tp20721037s27240p20721037.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Jeditable, async value
I'm using the fantastic Jeditable plugin, everything is great, but there is one problem that I can't solve. I submit the edited value to a function called setTitle (successHandler, errorHandler, value) which sends the data to the server and if everything goes well (the server responses) it calls the successHandler If the server responses I wanna set the title to the new value else I'd like to use the old value $(.title).editable(function(value, settings) { setTitle(function() { // return value }, function() { // return old_value }, value); }, { submit : 'OK' }); how can I solve it? regards, Viktor
[jQuery] Drop-down code broken
Hello, I'm pretty new to jQuery and found a nice drop-down menu on the web I'd like to use. However, the code for the drop-down effect doesn't seem to work, and I believe it's because the jQuery library they use is from 2006. Here is the old code: script type=text/javascript $(document).ready(function(){ $(#nav-one li).hover( function(){ $(ul, this).fadeIn(fast); }, function() { } ); if (document.all) { $(#nav-one li).hoverClass (sfHover); } }); $.fn.hoverClass = function(c) { return this.each(function(){ $(this).hover( function() { $(this).addClass(c); }, function() { $(this).removeClass(c); } ); }); }; /script Can anyone help me with this, or is it even needed? The menu seems to come down by itself with the CSS, but I like the little face effect. Here's where I got it from: http://be.twixt.us/jquery/suckerFish.php So basically all I want it to do is fade on the drop-down, just like it does on that site, but I want it to work with the latest version of jQuery. Can anyone help me? I'd really appreciate it. Thanks!
[jQuery] Re: How to pass loop increment to Jquery
jQuery automatically iterates through jQuery collections for you: $(function(){ $(.show).hover(function(){ $(.show_details).hide(slow); }, function(){ $(.show_details).show(slow); }) }); That code will iterate through all DOM objects with a class of 'show' and hide/show all objects with a class of 'show_details'. To get fancy Josh Powell On Nov 27, 1:36 pm, Sai Krishna [EMAIL PROTECTED] wrote: I dont know where am I doing mistake here. Could somebody point out? $(document).ready(function(){ $(.show).hover.each( function(){ $(.show_details).hide(slow); }, function(){ $(.show_details).show(slow); }) }); On Nov 28, 1:10 am, Sai Krishna [EMAIL PROTECTED] wrote: thank you Ill try that On Nov 28, 12:36 am, ajpiano [EMAIL PROTECTED] wrote: you'd have to tweak that i kind of missed your structure slightly, but the idea is to just use a class and let jquery handle the iterating... --adam On Nov 27, 2:35 pm, ajpiano [EMAIL PROTECTED] wrote: you can use jquery's .each() which is passed the loop index but to be honest the best thing to do is to use a class and replace al that code with $(.show_details) .hover(function() { $(this).show(slow);},function() { $(this).hide(slow); }); --adam On Nov 27, 2:20 pm, Sai Krishna [EMAIL PROTECTED] wrote: Hi, I've my PHP code generating rows using certain loop conditons, And I'd like to show/hide a div overlay on mouseover and mouseout of a text link generated in each row respectively. I wrote the following code. this seems to be show div overlay of last row. That is because I wrote the function in document.ready. I dont think Jquery lets us put javascript in HTML code, So how can I make my code work in such a case? $(document).ready(function(){ var i= $(#count).val(); for(j=0;ji;j++){ var k = #show_details+j; var refer = #show +j; $(k).hide(); $(refer).mouseover(function(){ $(k).show(slow); }); $(refer).mouseout(function(){ $(k).hide(slow); }); } });
[jQuery] Re: Why keyCode into keyup event is disable
Couple of things, 1) I highly suggest using json format to code javascript. Keeps things object oriented. 2) What are you attempting to do with the ).attr(id var myObj = { initform : function() { // To find every input field into myform and attach mykeyupfct $([EMAIL PROTECTED]'password']:visible,input [EMAIL PROTECTED]'text']:visible).keyup(function() { mykeyupfct(this); }); } to run: myObj.initForm(); On Nov 27, 9:41 am, Soledad [EMAIL PROTECTED] wrote: I'm trying to use the folowing code !-- --- HTML botom of the page -- scriptinitform()/script /*** Javascript ***/ function initform() { // To find every input field into myform and attach mykeyupfct $([EMAIL PROTECTED]'password']:visible,input [EMAIL PROTECTED]'text']:visible).attr(id,function(){ $(this).keyup(function() {mykeyupfct(this);}); }) } function mykeyupfct(myfield) { var sid=#+myfield.id var skey $(sid).keyup(function(e) { skey = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; alert(never alert : + skey); }); alert(always alert but no skey for +sid); } Im also tryinng : $(sid).bind('keyup', function(e) {skey=e.keyCode; alert(skey); }) but it's the same problem Thank's a lot for your help A beginner jQuery Soledad
[jQuery] Re: Validation
put 'return result' inside of the success method. Everything outside of the ajax call is done sequentially, so its returning before the ajax call comes back. Actually, you may need to put the ajax call outside of validator.addmethod and call validator.addmethod inside of the success. On Nov 27, 8:29 am, Fledder [EMAIL PROTECTED] wrote: hi, I'm using the jQuery Validation plugin for a big project and I'm loving it. I am however getting desperate trying to solve a particular issue. I've hunted for a solution for days now and tried everything I could think of, but it seems I coded myself into a deadlock. I'm hoping you can have a quick look at my code, it's only a little bit :) I'm developing a user registration form with quite some advanced validation. So far it works just fine, apart from one thing: remotely checking if the username does not exist already. Here's my code: // extend the validation plugin to do remote username dupe checking jQuery.validator.addMethod('usernameCheck', function(username) { var postURL = ?= $basepath; ?user/json_username_check/ + username + / + new Date().getTime(); $.ajax({ type: POST, url: postURL, success: function(msg) { result = (msg=='TRUE') ? true : false; } }); return result; }, ''); The problem is that I cannot return the result of the Ajax call back to the Validator. The Ajax call itself works fine, I can see that using Firebug. I've been advised to not use this low level jQuery Ajax call, but to use the remote option of the validator plugin instead. However, the reason I'm not using the remote selector from the Validation plugin is that my backend (Code Igniter) does not accept params in the format ?name=value. It will block all those. Code Igniter expects this: /name/value. It is possible to tell Code Igniter to use query strings, but that will break my entire application. Therefore, I am forced to use the $.ajax call. In my research somewhere I found somebody saying that asynchronous calls inside an addmethod do not work. I figured explicitly setting the async = false in the Ajax request (not shown above) would help, but it doesn't. The Ajax request itself works fine but I have no way to return the result of it to the Validator plugin. With remote not being an option and AddMethod not working, I have no idea what to do next. I don't mean to sound lazy, but rewriting or hacking the plugin itself beats my purpose of reusing and saving time. I've been so productive in producing forms thanks to this plugin but spending so much time on this little part got me quite depressed. I hope you can give me some advise, I would be very grateful. Thanks! Ferdy
[jQuery] Draggable() doesn't work with table rows?
I can drag and sort lists. I can sort tables. I can drag entire tables. But I can't drag individual table rows. Anyone know how to do it? Here's some sandbox code: ul id=list li id=a_1 class=drag1The/li li id=a_2 class=drag1slow/li li id=a_3 class=drag1green/li li id=a_4 class=drag1turtle/li /ul table id=table tbody id=rows tr id=a_1 class=drag2tdThe/td/tr tr id=a_2 class=drag2tdquick/td/tr tr id=a_3 class=drag2tdbrown/td/tr tr id=a_4 class=drag2tdfox/td/tr /tbody /table script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jquery/1.2.6/jquery.min.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jqueryui/1.5.2/jquery-ui.min.js/script script type=text/javascript $(document).ready(function() { $('.drag1').draggable();// WORKS // $('#list').sortable(); // WORKS // $('#rows').sortable(); // WORKS // $('#table').draggable();// WORKS // $('#rows').draggable(); // DOESN'T WORK -- ? $('.drag2').draggable();// DOESN'T WORK -- ? // $('#a_1').draggable(); // DOESN'T WORK -- ? }); /script
[jQuery] Re: ajax post variable error in safari/chrome
WebKit sucks parsing Dynamic XML, I had this problem and I found it was because Gzip... The SOLUTION in PHP, add the fallowing code in your PHP code: header('Content-Type: application/xml'); ob_start('ob_gzhandler'); another problem reasons could be that your dynamic XML is not a real XML, my advice for tests: Use Firefox and Firebug save your dynamic XML in the same dir where is your dyamic one open both, the dynamic and the saved on firefox check if the headers look the same good luck. pedalpete-2 wrote: I know this is kinda weird, and I can't seem to find where the issue is. i've been working on a tag cloud for my site hearwhere.com and everything works from FF/IE, but safari and chrome won't let me pass a multi-word variable into my query. You can test it out at http://zifimusic.com/v3 The single word genres from the tag cloud work no problem, but the multi-words (like 'folk rock') always return 0 results in Safari/ Chrome but return a number of results in FF/IE. I've output the query and copied it from source, and it runs fine, so I don't understand how Chrome Safari could be causing this issue, but everything seems to be going in correctly. I've left an 'alert' on the passed genre so I can see what is being passed, and it all looks good to me. ANY ideas on this? Super strange (i think). -- View this message in context: http://www.nabble.com/ajax-post-variable-error-in-safari-chrome-tp19803716s27240p20675959.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Draggable() doesn't work with table rows?
I don't think you can drag table rows... it would remove them from the table... On Nov 27, 3:11 pm, René [EMAIL PROTECTED] wrote: I can drag and sort lists. I can sort tables. I can drag entire tables. But I can't drag individual table rows. Anyone know how to do it? Here's some sandbox code: ul id=list li id=a_1 class=drag1The/li li id=a_2 class=drag1slow/li li id=a_3 class=drag1green/li li id=a_4 class=drag1turtle/li /ul table id=table tbody id=rows tr id=a_1 class=drag2tdThe/td/tr tr id=a_2 class=drag2tdquick/td/tr tr id=a_3 class=drag2tdbrown/td/tr tr id=a_4 class=drag2tdfox/td/tr /tbody /table script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jquery/1.2.6/jquery.min.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jqueryui/1.5.2/jquery-ui.min.js/script script type=text/javascript $(document).ready(function() { $('.drag1').draggable();// WORKS // $('#list').sortable(); // WORKS // $('#rows').sortable(); // WORKS // $('#table').draggable();// WORKS // $('#rows').draggable(); // DOESN'T WORK -- ? $('.drag2').draggable();// DOESN'T WORK -- ? // $('#a_1').draggable(); // DOESN'T WORK -- ? }); /script
[jQuery] Auto Save After Every Field Change?
I'm thinking about adding the functionality to auto save the user's data using ajax calls after each time he leaves a field and has changed the data in it, but my concern is about the amount of traffic and calls this will generate between the browser and the web server. Should I be concerned about this type thing of this in this day and age? Overall, there aren't many fields - less than 50, but I can end up with multiple rows of data within it, ex a list of names with their related address, street, province/state, etc Besides the obvious point of the user never losing any of his data due to session timeout or network issues, another reason for me wanting to do this is because the data entered in certain fields can affect other fields, and generate errors and warnings that the user must address, so I'm thinking this would be a nice way of 'instant notification' of issues with the data Anybody have any thoughts? Thanks, Cory
[jQuery] Re: animate problem with IE7
Well, have you thought of using fixed pixel positions, rather than percentages? When you click prev or next, use the offset() function to grab the exact position, then animate += 245px (or whatever). It's less convenient, but it may be more successful. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Thursday, November 27, 2008 2:49 AM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 The answer for the ticket is: That's a matter of css. Different browser have different whims when it comes to scrolling. Try adding height and width to the containing UL. I tried adding width and height to the UL but nothing changes... to the div wrapping the UL but again, nothing is changed. The LI elements are already fixed... :-| Any other idea?!? On Nov 25, 11:42 pm, ^AndreA^ [EMAIL PROTECTED] wrote: Ticket opened...http://dev.jquery.com/ticket/3650 bye, Andrea On Nov 24, 11:35 pm, ^AndreA^ [EMAIL PROTECTED] wrote: Yesterday I tried to open a ticket but the server (onhttp://dev.jquery.com/) was not responding as it should so I posted a thread also in the jQuery development google group. http://groups.google.com/group/jquery-dev/browse_thread/thread/945f3c... Nobody has replied so far... I wait a couple of days to see if somebody knows something about it and then I'll report it. BTW, Jeffrey, thank you very much for your time!!! Andrea On Nov 24, 6:20 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: Regardless, it is possible that the actual bug may be in the core animate function as regards to animating relative percentages. Don't forget to open a ticket on it (dev.jquery.com) JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Monday, November 24, 2008 3:06 AM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 jQuery cycle plugin is very nice but I have had bad experiences with plugins... Usually they do a lot of things but not exactly what I need, therefore I have to start tweaking them and 'often' it would take less time doing it from scratch... often... ;-) On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote: why don´t you use Jquery Cycle plugin? On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I'm not an expert in the animation sytem -- you should open a ticket (dev.jquery.com) and get some others to take a look at it. When I stepped through the code, I found a potential problem here, line 3043 of jquery.js // We need to compute starting value if ( unit != px ) { self.style[ name ] = (end || 1) + unit; start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } The div in question has a starting position of: left:-50%; The value of end is 50, unit is %. All of the other divs that had a positive percentage were handled correctly. While processing this div the starting position was somehow altered to -4%, leaving the ending position at 46% (-4 + 50). I'm not that familiar with the animation plumbing, so I'm not sure why this is occurring. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ^AndreA^ Sent: Saturday, November 22, 2008 4:26 PM To: jQuery (English) Subject: [jQuery] Re: animate problem with IE7 Hi Jeffrey, thanks. I deleted the float: left;, i didn't know was useless with position:absolute; Anyway, I noted the strange behaviour of the li elements too. I uploaded jQuery unpacked... if you still want to have a look... ;-) BTW, there could be something wrong with animate('left','+=50%'); but that would mean a bug... :-| Thanks, Andrea On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote: I watched the animation with the IE developer toolbar, and noticed a couple of oddities. Firstly, the CSS for the divs are set to both position:absolute and float:left. This is not the source of the problem (I overwrite to float:none and tried it), but float:left is unnecessary if with absolute positioning. Anyway, then I monitored the left: position as the animations happened. While going to the right, everything went as usual. Div#0 0% to -50% Div#1 25% to -25% Div#2 50% to 0% Div#3 75% to 25% Div#4 100% to 50% Div#5 125% to 75% All good. Then I refreshed and tried going to the left. Div#0 0% to 50% Div#1 25% to 75% Div#2 50% to 100% Div#3 75% to 125% Div#4 100% to 45% Div#5 125% to 48% As you can see, divs 0-3 were fine. Divs 4 and 5 got WEIRD
[jQuery] Re: Auto Save After Every Field Change?
Well, I wouldn't do it. I would not want to commit the data entry until it is all input - all none, atomicity is goodness. Countless times I have started filling out some form myself - realized I didn't want to go through with it for some reason or other and bailed out. If perchance one of the early values was my social security number, it's not so cool that it has already gone to the server even though I believe I've cancelled my form. There may well be validation issues that can't be resolved with only part of the form posted, too. The network/timeout issues are only magnified - 50 chances to fail vs one. Save the values in a cookie if need be, so they don't get lost if there's a failure. Better still, use an Ajax post technique to send the data. Trap any error from that and deal with it. Your form full of data will not have gone away, so you can recover easily from the error, perhaps completely unbeknownst to the user you could retry or resubmit to a backup server if the primary has gone dead. Don On Nov 27, 7:01 pm, hanther [EMAIL PROTECTED] wrote: I'm thinking about adding the functionality to auto save the user's data using ajax calls after each time he leaves a field and has changed the data in it, but my concern is about the amount of traffic and calls this will generate between the browser and the web server. Should I be concerned about this type thing of this in this day and age? Overall, there aren't many fields - less than 50, but I can end up with multiple rows of data within it, ex a list of names with their related address, street, province/state, etc Besides the obvious point of the user never losing any of his data due to session timeout or network issues, another reason for me wanting to do this is because the data entered in certain fields can affect other fields, and generate errors and warnings that the user must address, so I'm thinking this would be a nice way of 'instant notification' of issues with the data Anybody have any thoughts? Thanks, Cory
[jQuery] Re: ajax post variable error in safari/chrome
figured this one out a while ago, but forgot to update it (though it took forever to debug too). Turns out it wasn't really webkit (though the other websites didn't have a problem), but spaces in the text were being represented by /\W\g, and only webkit did not strip this out when posting the data. Other browsers did strip it out. On Nov 27, 3:20 pm, rodrigopolo [EMAIL PROTECTED] wrote: WebKit sucks parsing Dynamic XML, I had this problem and I found it was because Gzip... The SOLUTION in PHP, add the fallowing code in your PHP code: header('Content-Type: application/xml'); ob_start('ob_gzhandler'); another problem reasons could be that your dynamic XML is not a real XML, my advice for tests: Use Firefox and Firebug save your dynamic XML in the same dir where is your dyamic one open both, the dynamic and the saved on firefox check if the headers look the same good luck. pedalpete-2 wrote: I know this is kinda weird, and I can't seem to find where the issue is. i've been working on a tag cloud for my site hearwhere.com and everything works from FF/IE, but safari and chrome won't let me pass a multi-word variable into my query. You can test it out athttp://zifimusic.com/v3 The single word genres from the tag cloud work no problem, but the multi-words (like 'folk rock') always return 0 results in Safari/ Chrome but return a number of results in FF/IE. I've output the query and copied it from source, and it runs fine, so I don't understand how Chrome Safari could be causing this issue, but everything seems to be going in correctly. I've left an 'alert' on the passed genre so I can see what is being passed, and it all looks good to me. ANY ideas on this? Super strange (i think). -- View this message in context:http://www.nabble.com/ajax-post-variable-error-in-safari-chrome-tp198... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Auto Save After Every Field Change?
This is an insurance quoting application, and we do allow partial saving of the data, but a complete 'submit' is not allowed until all edits have passed and required information has been entered. Our goal is to provide instant premium updates and realtime edit checking based on the information entered, so we are already using ajax to save some things (deductibles, coverages and limits based on radio buttons) to the database and doing a premium calculation and also returning edit messages, but my concern is with the rest of the info - policy holder details, loss payees, and a few other things, some of which can also affect the premiums. For consistency it seems to me that it all should save immediately but you're right in that it adds complication and also increases the chance of a failure... On Nov 27, 6:33 pm, donb [EMAIL PROTECTED] wrote: Well, I wouldn't do it. I would not want to commit the data entry until it is all input - all none, atomicity is goodness. Countless times I have started filling out some form myself - realized I didn't want to go through with it for some reason or other and bailed out. If perchance one of the early values was my social security number, it's not so cool that it has already gone to the server even though I believe I've cancelled my form. There may well be validation issues that can't be resolved with only part of the form posted, too. The network/timeout issues are only magnified - 50 chances to fail vs one. Save the values in a cookie if need be, so they don't get lost if there's a failure. Better still, use an Ajax post technique to send the data. Trap any error from that and deal with it. Your form full of data will not have gone away, so you can recover easily from the error, perhaps completely unbeknownst to the user you could retry or resubmit to a backup server if the primary has gone dead. Don On Nov 27, 7:01 pm, hanther [EMAIL PROTECTED] wrote: I'm thinking about adding the functionality to auto save the user's data using ajax calls after each time he leaves a field and has changed the data in it, but my concern is about the amount of traffic and calls this will generate between the browser and the web server. Should I be concerned about this type thing of this in this day and age? Overall, there aren't many fields - less than 50, but I can end up with multiple rows of data within it, ex a list of names with their related address, street, province/state, etc Besides the obvious point of the user never losing any of his data due to session timeout or network issues, another reason for me wanting to do this is because the data entered in certain fields can affect other fields, and generate errors and warnings that the user must address, so I'm thinking this would be a nice way of 'instant notification' of issues with the data Anybody have any thoughts? Thanks, Cory- Hide quoted text - - Show quoted text -
[jQuery] Re: Draggable() doesn't work with table rows?
Actually, sortable() lets you drag rows between tables, so I don't think it's impossible. On Nov 27, 4:34 pm, seasoup [EMAIL PROTECTED] wrote: I don't think you can drag table rows... it would remove them from the table... On Nov 27, 3:11 pm, René [EMAIL PROTECTED] wrote: I can drag and sort lists. I can sort tables. I can drag entire tables. But I can't drag individual table rows. Anyone know how to do it? Here's some sandbox code: ul id=list li id=a_1 class=drag1The/li li id=a_2 class=drag1slow/li li id=a_3 class=drag1green/li li id=a_4 class=drag1turtle/li /ul table id=table tbody id=rows tr id=a_1 class=drag2tdThe/td/tr tr id=a_2 class=drag2tdquick/td/tr tr id=a_3 class=drag2tdbrown/td/tr tr id=a_4 class=drag2tdfox/td/tr /tbody /table script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jquery/1.2.6/jquery.min.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jqueryui/1.5.2/jquery-ui.min.js/script script type=text/javascript $(document).ready(function() { $('.drag1').draggable(); // WORKS // $('#list').sortable(); // WORKS // $('#rows').sortable(); // WORKS // $('#table').draggable(); // WORKS // $('#rows').draggable(); // DOESN'T WORK -- ? $('.drag2').draggable(); // DOESN'T WORK -- ? // $('#a_1').draggable(); // DOESN'T WORK -- ? }); /script
[jQuery] Re: Auto Save After Every Field Change?
I agree with Don. If this was, say, an administrative page, sure (maybe). But, if it's anything the general public will be using, no way. As for traffic, I guess it depends on the info that the form will be transmitting. If there aren't any textareas or file uploads, it's unlikely to amount to even a small portion of a single page download. Though upstream bandwidth is usually much lower than downstream, I don't think it's worth considering. The other thing, though, is your application will be opening many more DB connections. But, for the use you describe, I say don't bother. Do all your calculations when the user has *decidedly* submitted the data, not while she/he is working on it. If you're concerned about latency, throw up an animation or something on form submit. b On Thu, Nov 27, 2008 at 11:10 PM, hanther [EMAIL PROTECTED] wrote: This is an insurance quoting application, and we do allow partial saving of the data, but a complete 'submit' is not allowed until all edits have passed and required information has been entered. Our goal is to provide instant premium updates and realtime edit checking based on the information entered, so we are already using ajax to save some things (deductibles, coverages and limits based on radio buttons) to the database and doing a premium calculation and also returning edit messages, but my concern is with the rest of the info - policy holder details, loss payees, and a few other things, some of which can also affect the premiums. For consistency it seems to me that it all should save immediately but you're right in that it adds complication and also increases the chance of a failure... On Nov 27, 6:33 pm, donb [EMAIL PROTECTED] wrote: Well, I wouldn't do it. I would not want to commit the data entry until it is all input - all none, atomicity is goodness. Countless times I have started filling out some form myself - realized I didn't want to go through with it for some reason or other and bailed out. If perchance one of the early values was my social security number, it's not so cool that it has already gone to the server even though I believe I've cancelled my form. There may well be validation issues that can't be resolved with only part of the form posted, too. The network/timeout issues are only magnified - 50 chances to fail vs one. Save the values in a cookie if need be, so they don't get lost if there's a failure. Better still, use an Ajax post technique to send the data. Trap any error from that and deal with it. Your form full of data will not have gone away, so you can recover easily from the error, perhaps completely unbeknownst to the user you could retry or resubmit to a backup server if the primary has gone dead. Don On Nov 27, 7:01 pm, hanther [EMAIL PROTECTED] wrote: I'm thinking about adding the functionality to auto save the user's data using ajax calls after each time he leaves a field and has changed the data in it, but my concern is about the amount of traffic and calls this will generate between the browser and the web server. Should I be concerned about this type thing of this in this day and age? Overall, there aren't many fields - less than 50, but I can end up with multiple rows of data within it, ex a list of names with their related address, street, province/state, etc Besides the obvious point of the user never losing any of his data due to session timeout or network issues, another reason for me wanting to do this is because the data entered in certain fields can affect other fields, and generate errors and warnings that the user must address, so I'm thinking this would be a nice way of 'instant notification' of issues with the data Anybody have any thoughts? Thanks, Cory- Hide quoted text - - Show quoted text -
[jQuery] Combining Selectables and Draggables
I wrote up an article doing my best to explain how to use both selecable and draggable UI elements to work together to select a group and to drag them. I Richard. Worth helped me about a year ago to try to figure it out, but it was kind of buggy, then I asked him if he found a solution, so I decided to write an article about it and share it since I know I am not that only one who wants to know how to do this. Link: http://www.ryancoughlin.com/2008/11/23/combining-selectables-and-draggables-using-jquery-ui/ Thank you, Ryan
[jQuery] Strange behaviour with sortable()
(Disclaimer: Sorry for posting code -- It's as terse as I can make it.) I'm trying to enable sorting between tables -- drag a row within a table to change its order, or drag a row to another table and it will snap into place. In each case, after you drag-and-drop the row, the table calls an update function. Now, if I set up the .sortable() for each table manually, sorting works fine. Each table callsback to its update function and reflects the current rows. E.g.,: bTable 1/b table id=table1 tbody id=rows1 tr id=c_1 class=drag2tdThe/td/tr tr id=c_2 class=drag2tdquick/td/tr tr id=c_3 class=drag2tdbrown/td/tr tr id=c_4 class=drag2tdfox/td/tr /tbody /table bTable 2/b table id=table2 tbody id=rows2 tr id=d_1 class=drag2tdThe/td/tr tr id=d_2 class=drag2tdquick/td/tr tr id=d_3 class=drag2tdbrown/td/tr tr id=d_4 class=drag2tdfox/td/tr /tbody /table input id=make type=button value=Make Connectable / script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jquery/1.2.6/jquery.min.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jqueryui/1.5.2/jquery-ui.min.js/script script type=text/javascript connectable = [#rows2,#rows1]; $(document).ready(function() { $('#rows1').sortable({ connectWith: [connectable.join(,)], update: function(e, ui) { $(this).sortable(refresh); items = $(this).sortable(toArray); var sort_order = items.join(','); $('#results').append(sort_order + \n); }, }); $('#rows2').sortable({ connectWith: [connectable.join(,)], update: function(e, ui) { $(this).sortable(refresh); items = $(this).sortable(toArray); var sort_order = items.join(','); $('#results').append(sort_order + \n); }, }); }); /script textarea id=results rows=10 cols=40/textarea --- But if I put the .sortable() bits inside a function (there's a reason I want to do this), it doesn't work right. Whether I drag a row in the first or second table, the update function only reflects the sort order of the first table. I can't figure out why. E.g.: - bTable 1/b table id=table1 tbody id=rows1 tr id=c_1 class=drag2tdThe/td/tr tr id=c_2 class=drag2tdquick/td/tr tr id=c_3 class=drag2tdbrown/td/tr tr id=c_4 class=drag2tdfox/td/tr /tbody /table br / bTable 2/b table id=table2 tbody id=rows2 tr id=d_1 class=drag2tdThe/td/tr tr id=d_2 class=drag2tdquick/td/tr tr id=d_3 class=drag2tdbrown/td/tr tr id=d_4 class=drag2tdfox/td/tr /tbody /table input id=make type=button value=Make Connectable / script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jquery/1.2.6/jquery.min.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jqueryui/1.5.2/jquery-ui.min.js/script script type=text/javascript connectable = [#rows2,#rows1]; $(document).ready(function() { $('#make').click(function(){ for (t in connectable) { $(connectable[t]).sortable({ connectWith: [connectable.join(,)], update: function(e, ui) { console.log(connectable[t]); $(connectable[t]).sortable(refresh); items = $(connectable[t]).sortable(toArray); var sort_order = items.join(','); $('#results').append(sort_order + \n); } }); } }); }); /script textarea id=results rows=10 cols=40/textarea
[jQuery] Re: jQuery timing out on page load
The path is right and I'm using the packed version. There may be js on the page, but nothing is using jquery because I haven't enabled the page to use it yet. Basically I have a site that i'm incrementally adding jquery so that every page has a degree of degradation to it. On Nov 28, 1:30 am, Liam Potter [EMAIL PROTECTED] wrote: I'm guessing the path is wrong, are you using absolute paths or relative? ricardobeat wrote: It shouldn't timeout if you're not running any functions, are you using the packed version? Are you sure you don't have any javascript code on these pages? On Nov 11, 3:01 am, harryhobbes [EMAIL PROTECTED] wrote: Hi, I've got jQuery loading by default on my site. The library is only used on some pages in my site, however when I load a page that isn't using jquery (but still loading the file in the html header) Firefox pops up with a warning that jquery is timing out. Any suggestions? Cheers