[jQuery] Re: XML Parsing Question...
Because I don't want to deal with the customer service calls generated by the ActiveX objects. Plenty of people working in corporate cubbyholes get their computers locked down so that ActiveX isn't allowed to execute. Not that I really want to worry about IE6 but I can't exclude them yet. :) And, I know it's technically not an xml parser but it's not an HTML parser either unless the underlying code only recognizes HTML tags. In a way, it seems more like an SGML parser. Still doesn't explain why it works in some browsers and not the other (i.e. FF2 vs FF3). kn On Oct 8, 10:10 pm, Michael Geary [EMAIL PROTECTED] wrote: Well... Really, it doesn't work *at all*. You're not using anXMLparser. It's an HTML parser. Sure, it will do some kind of passable job of parsing some kinds ofXML, sort of, in some browsers. Why not use a realXMLparser? function parseXML(xml) { if( window.ActiveXObject window.GetObject ) { var dom = new ActiveXObject( 'Microsoft.XMLDOM' ); dom.loadXML(xml); return dom; } if( window.DOMParser ) return new DOMParser().parseFromString(xml, 'text/xml' ); throw new Error( 'NoXMLparser available' ); } A quick test: var dom = parseXML('foo what=isitbarhowdy/bar/foo'); var $dom = $(dom); console.log( $dom.find('foo').attr('what') ); // isit console.log( $dom.find('bar').text() ); // howdy You could make it a plugin: jQuery.parseXML = function(xml) { return jQuery( parseXML(xml) ); }; And then you can replace the first two lines of the test code above with: var $dom = $.parseXML('foo what=isitbarhowdy/bar/foo'); -Mike From: KenLG It may not be supported but it works great...usually. As far as find being case-sensitive, the weird thing is that it doesn't necessarily seem true. I could lcase the tags in theXMLbut still do the find against the mixed case element name and it still works. I had this suspicion that jquery is doing that find in a case- insensitive way. Actually, something I forgot to try: FireFox 3 works just fine with the mixed caseXML. Weird. I guess I'll just have to deal until FF2 gets phased out. Thanks, kn On Oct 6, 2:42 am, Erik Beeson [EMAIL PROTECTED] wrote: To my knowledge,XMLparsing via the jQuery constructor isn't supported. See here:http://dev.jquery.com/ticket/3143 --Erik On Sat, Oct 4, 2008 at 12:29 PM, KenLG [EMAIL PROTECTED] wrote: For much of my app, I'm doing an Ajax hit to the server to grabXML. That works great. But, in some cases, I've got too many pieces of data (unrelated) that I need to pull so I'm trying to do a simple passthrough from the server side (I'm using ASP.Net). So, I'll either output from SQL Server or hand-stitch someXMLand write it to the page. Whenever I do this passthrough (whether it comes from SQL Server or from my own efforts), theXMLdoesn't get parsed by Jquery. For example: var sTestXML = '?xmlversion=1.0?\r \nEventContactsEventContactEventContactDataHello/ EventContactData/EventContact/EventContacts\r\n'; var test = $(sTestXML); alert(test.find(EventContact).length); will result in the alert showing zero. Now, if I lower case some of the tags (and this will vary fromXML doc toXMLdoc but usually it's the root and object-level tags), it'll work. What's going on here?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Hover not work properly when moving mouse fast...
Ok when I go over the example one fast stroke in Firefox 3 then I get 4 and 6 for the outer.. in the 1st example. Now try to do a circlular movement in the orange box in the 1st example... stay inside the orange, over keeps firing, do a movement from left to right and it doesn't On the 2nd example, try to go really fast with the mouse over the entire area, sometimes it will fire once and sometimes 3 times. On Oct 15, 11:39 am, Karl Rudd [EMAIL PROTECTED] wrote: It seems to work as I expect it too on the example page. Can you provide a working example and explain what you expect to happen? Karl Rudd On Wed, Oct 15, 2008 at 2:02 PM, Mech7 [EMAIL PROTECTED] wrote: http://docs.jquery.com/Events/mouseout Even in the example it does not work correct.. for example make some circles with the mouse on mouseout.. it will keep adding numbers. Also with mousenter, move it fast and the numbers will go up with big amounts. :( How to fix this, i can't use mouseout cause it will fire also with the child elements.
[jQuery] [EMAIL PROTECTED] has invited you to have a 3D avatar chat
From: yasantha Avatar: Guest_FItSeka To: Jquery-en Hey Jquery-en,yasantha has added you as a friend on IMVU. Is yasantha your friend? nbsp; Please respond or yasantha may think you said no :) IMVU is the world's greatest 3D chat!Dress up your Avatar with 3D clothes. Chat with your friends amp; meet new ones. Decorate your own 3D Room with furniture. FREE to download amp; use! http://www.imvu.com Copyright copy; 2006-2007 IMVU, Inc. 411 High Street, Palo Alto, CA 94301. This email was sent via IMVU by yasantha ([EMAIL PROTECTED]) to [EMAIL PROTECTED] If you want to prevent any future emails from IMVU, you can remove yourself by pointing your web browser to http://www.imvu.com/catalog/web_nonregisteredoptout.php?code=6bec72[EMAIL PROTECTED] Your unsubscribe confirmation code is 6bec72
[jQuery] Re: Replacing special characters from Ajax - xml data
Nobody have a clue? Tell me if I need to clarify. On Oct 14, 10:47 am, neXib [EMAIL PROTECTED] wrote: Hi, I've got a xml feed that I'm getting from an external url, it's in utf-8 format and loads fine (looks perfect if I just copy it into the local xml file). But the problem is that our way of getting this xml file which is something the company have coded earlier (old now) seems to encode it as something other than utf-8. So when I output the data special characters like our æøå (aring; and such) turns into garble. I can probably get this code of ours changed internally, but in the meantime it would be nice if I could replace these characters with jquery. I tried a jquery like below but nothing like aring; or hex values or anything shows the right character. Ideas? var $thirdLink = $(this).find('h5.media'); var linkText = $thirdLink.text().replace('å','aring;'); $thirdLink.text(linkText);
[jQuery] Re: [validate] Validation code in separate file, fails to work
On Wed, Oct 15, 2008 at 12:05 AM, Jörn Zaefferer [EMAIL PROTECTED] wrote: There are lot of reasons why the included file didn't work, and its hard to tell without looking at it. I recommend to use Firebug: Check the Net tab to see if the file was actually loaded. Yes, the file is just loaded with 200 statsCode. I have upload the file: http://www.dustyfrog.nl/export/ Do I need to wrap it into some method which I should call in HTML page? Maybe $document.ready() doesn't work from javascript files but only in HTML?
[jQuery] Re: [validate] Validation code in separate file, fails to work
Whats wrong with that page? Works for me just fine. Jörn On Wed, Oct 15, 2008 at 9:18 AM, Weyert de Boer [EMAIL PROTECTED] wrote: On Wed, Oct 15, 2008 at 12:05 AM, Jörn Zaefferer [EMAIL PROTECTED] wrote: There are lot of reasons why the included file didn't work, and its hard to tell without looking at it. I recommend to use Firebug: Check the Net tab to see if the file was actually loaded. Yes, the file is just loaded with 200 statsCode. I have upload the file: http://www.dustyfrog.nl/export/ Do I need to wrap it into some method which I should call in HTML page? Maybe $document.ready() doesn't work from javascript files but only in HTML?
[jQuery] Re: [validate] Validation code in separate file, fails to work
Heh. I must have been dreaming last night. Thanks anyways. Whats wrong with that page? Works for me just fine.
[jQuery] Re: Hover not work properly when moving mouse fast...
Right. That's what I'd expect. The mouseout (and mouseover) events bubble up through child DOM nodes, and often fire at odd times, which is why it you should use the mouseenter and mouseleave events. The enter and leave events are specially built to not bubble (at least not unexpectedly). I do see what you mean by the mouseleave firing more than once in some cases. No idea why. Do you have a particular page that isn't working? Karl Rudd On Wed, Oct 15, 2008 at 6:00 PM, Mech7 [EMAIL PROTECTED] wrote: Ok when I go over the example one fast stroke in Firefox 3 then I get 4 and 6 for the outer.. in the 1st example. Now try to do a circlular movement in the orange box in the 1st example... stay inside the orange, over keeps firing, do a movement from left to right and it doesn't On the 2nd example, try to go really fast with the mouse over the entire area, sometimes it will fire once and sometimes 3 times. On Oct 15, 11:39 am, Karl Rudd [EMAIL PROTECTED] wrote: It seems to work as I expect it too on the example page. Can you provide a working example and explain what you expect to happen? Karl Rudd On Wed, Oct 15, 2008 at 2:02 PM, Mech7 [EMAIL PROTECTED] wrote: http://docs.jquery.com/Events/mouseout Even in the example it does not work correct.. for example make some circles with the mouse on mouseout.. it will keep adding numbers. Also with mousenter, move it fast and the numbers will go up with big amounts. :( How to fix this, i can't use mouseout cause it will fire also with the child elements.
[jQuery] Re: UI/Sortables beginner understanding problem
I tried the change param: $(#staerke2).sortable({ opacity: 0.5, change: console.log(changed), connectWith: [#staerke1] }); but it shoots, when the list is inialized. so no Luck here... Can anybody help me out? Thx tom
[jQuery] Re: JSON data issue in IE | Language Translation
how'd you fix it? On Sep 25, 3:11 pm, Arif [EMAIL PROTECTED] wrote: I have resolved this :) Thanks Mohammed Arifhttp://www.mohammedarif.com On Sep 22, 2:24 pm, Arif [EMAIL PROTECTED] wrote: Even I got the issue, it's not been rendering because of French accented characters in IE. So what do I need to change theJSONcharacter encoding? P.S: I don't have server control, can change the front end layer (xhtml/css/js/json) only, and will not be able to write any server side code otherwise I could have easily done it. Many thanks Mohammed Arifhttp://www.mohammedarif.com On Sep 22, 11:12 am, Arif [EMAIL PROTECTED] wrote: Hi All, Hope, you all would be doing well. I am trying to create a language translation utility using jQuery for some specific words only, seems working fine in Firefox but don’t do well in IE 6/7. Given is theJSONfile, where I map headings which needs to be translated in French. JSONData: { download : télécharger, categories : sujets d'actualité, recent_comments : mais que l'histoire de l', recent posts : Messages Récents, also worthy : aussi digne, archieves : archives, } I am able to load myJSONfile successfully using $.getJSON(), it translates in FF but does not do the same in IE 6/7. jQuery Method: function loadJSON(){ $.getJSON(json/data_ca_fr.json, function(json){ $(.json_trans).each(function(i){ //getting all the headings to translate switch($(.json_trans)[i].innerHTML) { case Download: // Start here if $(.json_trans)[i].innerHTML == download $(.json_trans)[i].innerHTML =json.download; break;// Stop here case Categories: // Start here if $(.json_trans)[i].innerHTML == download $(.json_trans)[i].innerHTML =json.categories; break;// Stop here default break; } }) }); } I am just comparing English words in the page through innerHTML because jQuery html() return the first array index only , defined span tag with .json_trans class for picking up all the required spans and do the translation. I know, it’s not the robust way to do the language translation but does require for client and it’s not AJAX at all, just calling the jsonfile on dom ready. Any quick pointer/ suggestion should be appreciated. Thanks for your time Mohammed Arifhttp://www.mohammedarif.com
[jQuery] Re: Using jQuery Multiple File Upload Plugin and jQuery Form Plugin together
Can you post a link? I'm trying to use jQuery Form Plugin(http://www.malsup.com/jquery/form/) and jQuery Multiple File Upload Plugin(http://www.fyneworks.com/jquery/multiple-file-upload/) together to build a possibility to Upload more then one file at a time.
[jQuery] Re: how can i query all fields with values in a form
var inputs = jQuery(the_form).find('input'); //a list of fields var field = jQuery(inputs).filter('[name='+fieldname+']'); my problem is, that inputs doesn't contain textarea and select fields. Use the pseudo selector :input. var inputs = $('#myForm :input'); http://docs.jquery.com/Selectors/input
[jQuery] Re: Using jQuery Multiple File Upload Plugin and jQuery Form Plugin together
Hello, Can you post a link? Sorry, but I can't at this point. It is part of a large Intranet Project. But if it helps, I can build a little sample app... But to be clear: I should work, right? Greetings, Stefan Sturm
[jQuery] AJAX/JSON/PHP function works in Safari/FF but not in IE
This code works flawless in Safari and FF but not in any IE. Can anyone see the problem? $(document).ready(function() { $(#jquery_spinner_2).hide(function() { first = true; teaser(function() { $(#jquery_spinner_2).hide(function() { $(#jquery_spinner_1).fadeIn('slow') }); }); teaser(); }); function teaser() { var spinnerContainer_1 = $('#jquery_spinner_1'); var spinnerContainer_2 = $('#jquery_spinner_2'); $.ajax({ url: '/_library/ajax.php', data: 'ajax-action=getStartImages', dataType: 'json', type: 'post', success: function (j) { if(!first) { spinnerContainer_2.html(j); first = true; } else { spinnerContainer_1.html(j); first = false; } } }); } $.timer(5000,(function (timer) { if(first) { $(#jquery_spinner_1).fadeOut('slow',function() { $(#jquery_spinner_2).fadeIn('slow'); $(#jquery_spinner_1).hide(); teaser(); }); } else { $(#jquery_spinner_2).fadeOut('slow',function() { $(#jquery_spinner_1).fadeIn('slow'); $(#jquery_spinner_2).hide(); teaser(); }); } })); });
[jQuery] Re: SerialScroll navigation modification question
Ok, nice to know :) There is one snippet to generate sort of a simple pagination, based on the items. -- Ariel Flesler http://flesler.blogspot.com On Oct 15, 6:54 am, Armand Datema [EMAIL PROTECTED] wrote: FYI this functionality also works great with the pagination plagin you only need to modify it a bit the pagination plugin returns a span for the first item, this needs to be changed to a standard link var lnk = $(a class='active'+(appendopts.text)+/a) and because the click handler is handled by the serialscroll plugin you need to delete that from the pagination plugin as well //.bind(click, getClickHandler(page_id)) so in my case i first call the pagination plgin to create a nr of links based on the nr of items in my news dataset , adn then i call the serialscroll to make this into a scroller and attach the navigation to the before created paging links Armand On Tue, Oct 14, 2008 at 2:59 PM, Ariel Flesler [EMAIL PROTECTED] wrote: Nope, I thought I had a snippet for this on the Doctorate on... post, it seems I forgot to add this one. Will do as soon as I can. -- Ariel Flesler http://flesler.blogspot.com On Oct 14, 6:13 am, Armand Datema [EMAIL PROTECTED] wrote: Thanks thats about how I solved it also just wanted to check if somehow this was allready included int he plugin and I missed it Armand On Fri, Oct 10, 2008 at 10:33 PM, Ariel Flesler [EMAIL PROTECTED] wrote: You have 2 options. - Binding externally: var $links = $('#navigation a').click(function(){ $links.removeClass('selected'); $(this).addClass('selected'); }); - Using the onBefore callback. I think the first one is simple and safe. I'd go for that. Cheers -- Ariel Flesler http://flesler.blogspot.com On Oct 9, 8:37 am, Armand Datema [EMAIL PROTECTED] wrote: Hi I am using the serialscroll on my site to page through a news resultset. I am using the naviagation option that automatically turns a given list into the naviagation for this scroller. However I would like to have the link in the ul have a new class when its clicked so I can style this differently, whats the best way to do this. thanks in advance Armand -- Armand Datema CTO SchwingSoft -- Armand Datema CTO SchwingSoft
[jQuery] Re: how can i query all fields with values in a form
hello mike, thanks a lot, i *should* have read on. additional wonderful features were around the corner :) . best regards, alex On Wed, Oct 15, 2008 at 15:02, Mike Alsup [EMAIL PROTECTED] wrote: var inputs = jQuery(the_form).find('input'); //a list of fields var field = jQuery(inputs).filter('[name='+fieldname+']'); my problem is, that inputs doesn't contain textarea and select fields. Use the pseudo selector :input. var inputs = $('#myForm :input'); http://docs.jquery.com/Selectors/input
[jQuery] Re: JS Question: How does this jQuery idiom work?
It's very important becuase the symbol $ is used by other javascript libraries and it can cause a conflict if you use it outside of the anonymous function. For example another sloppy library might have a global definition var $ = function(){ alert('Not Cool Man!'); }; then if you tried to use jQuery $(#mycoolapp).coolPlugin().beCool(); and yould get the alert, 'Not Cool Man!' But jQuery doesnt stand for such sloppy nonsense so we do: jQuery.noConflict(); and write our plugin still using $ like so: (function($){ $.fn.coolPlugin = function(){ //do cool stuff and feel free to use $ and know // it means jQuery and not the lame alert function //declared globally by sloppy library X } })(jQuery); On Wed, Oct 15, 2008 at 9:09 AM, Mike Alsup [EMAIL PROTECTED] wrote: Plugins are supposed to use this: (function($) { // Plugin code }) (jQuery) I know what it does (allows the use of $ within the script), but how does it actually work? Is it somehow casting the function object as the jQuery object? It always seemed odd to me, and I haven't seen this idiom elsewhere. Consider this bit of code: // declare a function that accepts an argument var myFn = function(myParam) { // inside here I can use myParam freely }; // call the function and pass an argument myFn(3); Now, change what you call the parameter name and what you pass to the function var myFn = function($) { // inside here I can use $ freely }; // call the function and pass jQuery as the argument myFn(jQuery); Now do it all in one step, as an anonymous function: (function($) { // inside here I can use myParam freely })(jQuery); -- Christopher Thatcher
[jQuery] Re: IE bug in the Tab plugin
Maybe it is in your IE settings (Tools - Internet options - General - Temp. Internet settings - Settings - Check for news version of stored pages) When it is on 'On every page visit' it will blink a lot. Setting it to 'Automaticly' will reduce (or eliminate) blinking. Remember that things will be cached when set to 'Automaticly'. Not always desired when developing! ;-) [EMAIL PROTECTED] schreef: Hi, There seems to be an issue with the Tab plugin in IE 6.0 ... Try it at jQuery doc page : http://docs.jquery.com/UI/Tabs When the mouse hover the tabs or when tabs are clicked, they disappear and there's a lot of blinking. It does not happen in Firefox. Is there a fix for that ? Thanks
[jQuery] Re: JS Question: How does this jQuery idiom work?
I still have no idea what's going on syntactically, but now I know what's happening. This reinforced the concept (writes Poop! to the screen): (function(poop) { document.write(poop); }) (Poop!) On Oct 15, 10:00 am, chris thatcher [EMAIL PROTECTED] wrote: It's very important becuase the symbol $ is used by other javascript libraries and it can cause a conflict if you use it outside of the anonymous function. For example another sloppy library might have a global definition var $ = function(){ alert('Not Cool Man!'); }; then if you tried to use jQuery $(#mycoolapp).coolPlugin().beCool(); and yould get the alert, 'Not Cool Man!' But jQuery doesnt stand for such sloppy nonsense so we do: jQuery.noConflict(); and write our plugin still using $ like so: (function($){ $.fn.coolPlugin = function(){ //do cool stuff and feel free to use $ and know // it means jQuery and not the lame alert function //declared globally by sloppy library X } })(jQuery); On Wed, Oct 15, 2008 at 9:09 AM, Mike Alsup [EMAIL PROTECTED] wrote: Plugins are supposed to use this: (function($) { // Plugin code }) (jQuery) I know what it does (allows the use of $ within the script), but how does it actually work? Is it somehow casting the function object as the jQuery object? It always seemed odd to me, and I haven't seen this idiom elsewhere. Consider this bit of code: // declare a function that accepts an argument var myFn = function(myParam) { // inside here I can use myParam freely }; // call the function and pass an argument myFn(3); Now, change what you call the parameter name and what you pass to the function var myFn = function($) { // inside here I can use $ freely }; // call the function and pass jQuery as the argument myFn(jQuery); Now do it all in one step, as an anonymous function: (function($) { // inside here I can use myParam freely })(jQuery); -- Christopher Thatcher
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
Alex Weber wrote on 10/15/2008 6:58 AM: or if i enable mod_deflate it takes care of the gzipping? Mod_deflate: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html And mod_expires to cache the files on the browser for some duration (1 year is good): http://httpd.apache.org/docs/2.0/mod/mod_expires.html - BIl
[jQuery] Re: Replacing special characters from Ajax - xml data
You're searching for 'å' but most likely the garbage character isn't 'å' but instead transformed to something else in the current character set. So you have to determine what each garbage character is (WireShark is good to see the actual byte values being transmitted), then replace it back to the appropriate character. If the final page is in UTF-8, then any illegal character will be transformed into a special UTF-8 character. You will not be able to reverse it in that case as you could have dozens of illegal characters and they're all now the UTF-8 invalid character. - Bil neXib wrote on 10/15/2008 2:16 AM: Nobody have a clue? Tell me if I need to clarify. On Oct 14, 10:47 am, neXib [EMAIL PROTECTED] wrote: Hi, I've got a xml feed that I'm getting from an external url, it's in utf-8 format and loads fine (looks perfect if I just copy it into the local xml file). But the problem is that our way of getting this xml file which is something the company have coded earlier (old now) seems to encode it as something other than utf-8. So when I output the data special characters like our æøå (aring; and such) turns into garble. I can probably get this code of ours changed internally, but in the meantime it would be nice if I could replace these characters with jquery. I tried a jquery like below but nothing like aring; or hex values or anything shows the right character. Ideas? var $thirdLink = $(this).find('h5.media'); var linkText = $thirdLink.text().replace('å','aring;'); $thirdLink.text(linkText);
[jQuery] Validation - stop validation
Hello, Is it possible to stop the validation on a form after X number of errors? If I have a form with 100 textboxes and each fails it becomes a mess --- I would like to maybe list the first 5 errors and on the sixth say something like There are more errrors. Regards, Eben
[jQuery] Jquery tab
Hello, I am looking for a jQuery ajax script that can do the following: http://www.doublemedia.nl/nieuws.jpg When someone goes with his mouse over one of the tab's you see in the image he has to load the content that belongs to the chosen tab. Any one hoe knows a jquery plugin that can do this? Erwin
[jQuery] Re: Ajax load() problems
Miroku, are you including this in another page. Do you have a valid jquery object form the call $(#azioni)? I had a weird problem a couple days back where the load would work the first time I clicked it, but the next time I clicked it, the whole page would reload. This was the result of javascript in the page I was loading over-ridding the definition for the jquery class. Hope this helps. On Oct 15, 2:47�am, Miroku [EMAIL PROTECTED] wrote: html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / title/title link href=css/main.css rel=stylesheet type=text/css media=screen / link href=css/chat.css rel=stylesheet type=text/css media=screen / script src=javascript/jquery-1.2.6.min.js type=text/javascript/ script script type=text/javascript function alCaricamento(){ � � � � $('#contenuti').load('chat/chat.php?prova=x');} /script /head body onload=alCaricamento(); div id=refresh/div div id=menu/div div id=contenuti/div /body /html that's the page that works... the first one to be loaded this one below is chat.php when the function neither alone neither by clicking the link works script type=text/javascript !-- $(#azioni).load(azioni.php); function caricaPagina(){ � � � � $(#azioni).load('azioni.php'); } setInterval(caricaPagina(),2000); -- /script div id=opzionia href=javascript:caricaPagina();prova/a/div div id=chatbox � div id=luogoEturni/div � div id=azioni/div /div Thanx
[jQuery] Hover In/Out with quick mouse movements
So I have this bug... I have an initial div set to hide on document init, and fadeIn when I hover over the parent div, then fadeOut when I hover back out of the parent div. When I move the mouse fast in and out of the parent div, the child div seems to queue up the movements so after I stop moving the mouse, the fadeIn and fadeOut effects keep running until they have caught up with the mouse movements. Any ideas how to fix this? Still getting my head around jQuery and javascript, so any help would be greatly appreciated. Here's my code: $(document).ready(function() { $('.prev, .next').hide(); $('#topbar').hover(function() { $('.prev, .next').fadeIn('slow'); }, function() { $('.prev, .next').fadeOut('slow'); }); });
[jQuery] Hover In/Out with quick mouse movements
So I have this bug... I have an initial div set to hide on document init, and fadeIn when I hover over the parent div, then fadeOut when I hover back out of the parent div. When I move the mouse fast in and out of the parent div, the child div seems to queue up the movements so after I stop moving the mouse, the fadeIn and fadeOut effects keep running until they have caught up with the mouse movements. Any ideas how to fix this? Still getting my head around jQuery and javascript, so any help would be greatly appreciated. Here's my code: $(document).ready(function() { $('.prev, .next').hide(); $('#topbar').hover(function() { $('.prev, .next').fadeIn('slow'); }, function() { $('.prev, .next').fadeOut('slow'); }); });
[jQuery] Re: IE bug in the Tab plugin
Thanks Snef, that's fixed the issue. However I'm not 100% sure what's happening here... The blinking or flickering I was referring to, was happening when the mouse hovers the tabs. At this stage the page is already loaded so it doesn't matter whether it's cached or not I'm worried my users are going to have the same problem and I can't really tell them to change their IE's settings ! Maybe the author of the plug-in knows about that ? On 15 oct, 15:21, Snef [EMAIL PROTECTED] wrote: Maybe it is in your IE settings (Tools - Internet options - General - Temp. Internet settings - Settings - Check for news version of stored pages) When it is on 'On every page visit' it will blink a lot. Setting it to 'Automaticly' will reduce (or eliminate) blinking. Remember that things will be cached when set to 'Automaticly'. Not always desired when developing! ;-) [EMAIL PROTECTED] schreef: Hi, There seems to be an issue with the Tab plugin in IE 6.0 ... Try it at jQuery doc page :http://docs.jquery.com/UI/Tabs When the mouse hover the tabs or when tabs are clicked, they disappear and there's a lot of blinking. It does not happen in Firefox. Is there a fix for that ? Thanks
[jQuery] Re: jcarousel reset
Damien - I just got this working myself in a dynamically loaded carousel: First, add an initCallback to get a handle on the jcarousel object and save it in a global: myCarousel = null; // This will be the carousel object myData = [...]; // This is the data for the carousel function onInitCarousel(carousel, state) { if (state == 'init') { myCarousel = carousel; } } function myItemLoadCallback(carousel, state) { // build your items from myData[...] here } $('#mycarouseldev').jcarousel({ size: myData.length, initCallback: onInitCarousel, itemLoadCallback: {onBeforeAnimation: myItemLoadCallback}, wrap: 'last', scroll: 3 }); Then, when it is time to reset the carousel: function resetData() { myData = [...] // set the new data myCarousel.reset(); } Hope this helps, Bob On Oct 1, 4:20 am, Anatalsceo [EMAIL PROTECTED] wrote: Thejcarouselplug works really great. I only have a problem with theresetfunction. I try on a page to change the content of the carousel without reloading the page. I'm using for this the $(document).ready(function() {} in order to change the carousel on a click. It doesn't quite work and I was wondering how could I get thereset function to work. It always freezes firefox when using it. regards, Damien
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
If you're using PHP on the backend, here is the solution we use: ?php //define array that will hold an entry for each javascript file $jsfiles = array(); //just add a new line for each javascript file needed $jsfiles[] = jquery.yuimin.js; $jsfiles[] = jquery.autocomplete.yuimin.js; $jsfiles[] = jquery.bgiframe.yuimin.js; $jsfiles[] = jquery.blockui.yuimin.js; $jsfiles[] = jquery.contextmenu.yuimin.js; $jsfiles[] = jquery.cookie.yuimin.js; $jsfiles[] = jquery.cookiejar.yuimin.js; $jsfiles[] = jquery.curvycorners.yuimin.js; $jsfiles[] = jquery.date.yuimin.js; $jsfiles[] = jquery.datepicker.yuimin.js; $jsfiles[] = jquery.filetree.yuimin.js; $jsfiles[] = jquery.history_remote.yuimin.js; $jsfiles[] = jquery.inplace.yuimin.js; $jsfiles[] = jquery.json.yuimin.js; $jsfiles[] = jquery.livequery.yuimin.js; $jsfiles[] = jquery.media.yuimin.js; $jsfiles[] = jquery.metadata.yuimin.js; $jsfiles[] = jquery.scrollto.yuimin.js; $jsfiles[] = jquery.tablesorter.yuimin.js; $jsfiles[] = jquery.tablesorter.cookie.yuimin.js; $jsfiles[] = jquery.tabs.yuimin.js; $jsfiles[] = jquery.thickbox.yuimin.js; $jsfiles[] = jquery.tooltip.yuimin.js; $jsfiles[] = ui.core.yuimin.js; $jsfiles[] = ui.draggable.yuimin.js; ob_start('ob_gzhandler'); //start output buffering using gzip compression header(Content-type: text/javascript; charset: UTF-8); //declare this to the browser as javascript //setup header info to force caching header(Cache-Control: must-revalidate, public); $offset = 60 * 60 * 4; $ExpStr = Expires: . gmdate(D, d M Y H:i:s,time() + $offset) . GMT; header($ExpStr); //set expiration header foreach ($jsfiles as $fn) { echo file_get_contents($fn); echo ;\n; // accommodate scripts which are missing a trailing semicolon } ob_end_flush(); //output the content ? On Oct 15, 10:12 am, Chris Jordan [EMAIL PROTECTED] wrote: Yeah, nothing bugs me more than when I'm searching for the answer to something on google only to come up with fifteen mailing list posts on the subject where the only answer is some smart-ass telling me to search google for it. :o/ On Wed, Oct 15, 2008 at 9:06 AM, Alex Weber [EMAIL PROTECTED] wrote: lol tried that, had to wade through a lot of stuff but I guess I found my answers. if you knew it off the top of your head wouldn't hurt to just say it! =P thanks! -Alex On Oct 15, 9:23 am, MorningZ [EMAIL PROTECTED] wrote: Answers to your questions, every single one of them http://www.google.com/search?q=gzip On Oct 15, 7:58 am, Alex Weber [EMAIL PROTECTED] wrote: the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :) --http://cjordan.us
[jQuery] superfish request- supersubs (left/right menu)
Could the supersubs function also include an option to display the menu, left or right. It seems currently it depends on this line of code: // update offset position of descendant ul to reflect new width of parent .each(function(){ var $childUl = $('ul',this); var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right'; $childUl.css(offsetDirection,emWidth); }) for me this isn't working cause I want it to be right but the checked variable is undefined most of the time, setting offsetDirection to left. Thanks,
[jQuery] Re: BlockUI blacks-out whole screen (BlockUI2.0x, IE7). Opacity?
I've got my issue fixed but something tells me that its not the same for you. The caveat message that I'm using displays and blocks the UI when the DOM is ready. I'm using a tiled background image for my overlay so it has a slight stripped appearance. This image was a PNG. I'm also using the .fixPng() library to fix ie6's transparency issues. Since the call to the fixPng library was being called after the UI was blocked, the tiled bkg image was being stretched across the entire page. The the PNG hack can't be applied to tiled images because of this stretchy problem. I simply changed the overlay back ground image from a PNG to a GIF and all is good again. brian On Oct 15, 10:07 am, Brian Schilt [EMAIL PROTECTED] wrote: I'm having a similar issue, but with IE6. I'm using blockUI a lot in my app and the opacity has always worked fine in IE6. I added a new feature to the app where I needed to block out the entire screen in order to display a caveat message to the user and for some reason the overlay is completely black and the only thing that is visible is the 'message'. This problem only happens in IE6 for me and only when displaying this caveat message. IE6 handles the overlay just fine in other parts of the app. I haven't taken any time to try and figure this out, I just logged it in our bug tracking system. Perhaps its time I tried to figure it out. I'll here if I come up with a solution for me and maybe it will work in your case too. Brian On Oct 15, 6:20 am, Anxiro [EMAIL PROTECTED] wrote: Hi there, I am using jQuery 1.2.6 and BlockUI 2.09 (09/16/2008) on a local server, because of a school project. The BlockUI works perfectly in FireFox (2x and 3x) but I'm having problems in IE7; it blacks-out the whole screen. Only the 'loading'-text is visible; the *website* is gone. My opacity is 0.5, but this seems not to work in IE7. Does anyone got a solution? I have searched Google and forums, but nobody seemed to have a solution to my problem. Thanks for any reply!
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
Thanks tlphipps, Your script is an example of on-the-fly compression right? Think I got it now! :) On Oct 15, 12:18 pm, tlphipps [EMAIL PROTECTED] wrote: If you're using PHP on the backend, here is the solution we use: ?php //define array that will hold an entry for each javascript file $jsfiles = array(); //just add a new line for each javascript file needed $jsfiles[] = jquery.yuimin.js; $jsfiles[] = jquery.autocomplete.yuimin.js; $jsfiles[] = jquery.bgiframe.yuimin.js; $jsfiles[] = jquery.blockui.yuimin.js; $jsfiles[] = jquery.contextmenu.yuimin.js; $jsfiles[] = jquery.cookie.yuimin.js; $jsfiles[] = jquery.cookiejar.yuimin.js; $jsfiles[] = jquery.curvycorners.yuimin.js; $jsfiles[] = jquery.date.yuimin.js; $jsfiles[] = jquery.datepicker.yuimin.js; $jsfiles[] = jquery.filetree.yuimin.js; $jsfiles[] = jquery.history_remote.yuimin.js; $jsfiles[] = jquery.inplace.yuimin.js; $jsfiles[] = jquery.json.yuimin.js; $jsfiles[] = jquery.livequery.yuimin.js; $jsfiles[] = jquery.media.yuimin.js; $jsfiles[] = jquery.metadata.yuimin.js; $jsfiles[] = jquery.scrollto.yuimin.js; $jsfiles[] = jquery.tablesorter.yuimin.js; $jsfiles[] = jquery.tablesorter.cookie.yuimin.js; $jsfiles[] = jquery.tabs.yuimin.js; $jsfiles[] = jquery.thickbox.yuimin.js; $jsfiles[] = jquery.tooltip.yuimin.js; $jsfiles[] = ui.core.yuimin.js; $jsfiles[] = ui.draggable.yuimin.js; ob_start('ob_gzhandler'); //start output buffering using gzip compression header(Content-type: text/javascript; charset: UTF-8); //declare this to the browser as javascript //setup header info to force caching header(Cache-Control: must-revalidate, public); $offset = 60 * 60 * 4; $ExpStr = Expires: . gmdate(D, d M Y H:i:s,time() + $offset) . GMT; header($ExpStr); //set expiration header foreach ($jsfiles as $fn) { echo file_get_contents($fn); echo ;\n; // accommodate scripts which are missing a trailing semicolon} ob_end_flush(); //output the content ? On Oct 15, 10:12 am, Chris Jordan [EMAIL PROTECTED] wrote: Yeah, nothing bugs me more than when I'm searching for the answer to something on google only to come up with fifteen mailing list posts on the subject where the only answer is some smart-ass telling me to search google for it. :o/ On Wed, Oct 15, 2008 at 9:06 AM, Alex Weber [EMAIL PROTECTED] wrote: lol tried that, had to wade through a lot of stuff but I guess I found my answers. if you knew it off the top of your head wouldn't hurt to just say it! =P thanks! -Alex On Oct 15, 9:23 am, MorningZ [EMAIL PROTECTED] wrote: Answers to your questions, every single one of them http://www.google.com/search?q=gzip On Oct 15, 7:58 am, Alex Weber [EMAIL PROTECTED] wrote: the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :) --http://cjordan.us
[jQuery] jquery validation using thickbox
Hi, Sorry to bother you but I am not able to solve this problem so posting in forum I am using two jquery plugin 1 Thickbox 2 Jquery validation Without thickbox validation is working fine but validation is not working in thickbox. There is two files ajaxLogin.htm and second is index.html ajaxLogin.htm : script src=/thickbox/js/jquery.js type=text/javascript/script script src=/thickbox/js/jquery.validate.js type=text/ javascript/ script script $(document).ready(function() { // validate signup form on keyup and submit var validator = $(#signupform).validate({ rules: { password: { required: true, minlength: 5 }, password_confirm: { required: true, minlength: 5, equalTo: #password } }, messages: { password: { required: Provide a password, rangelength: jQuery.format(Enter at least {0} characters) }, password_confirm: { required: Repeat your password, minlength: jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above } }, // the errorPlacement has to take the table layout into account errorPlacement: function(error, element) { error.appendTo( element.parent().next() ); } }); }); /script div id=signupwrap form id=signupform method=POST action=http://localhost/thickbox/ index.html table tr td class=labellabel id=lpassword for=passwordPassword/ label/td td class=fieldinput id=password name=password type=password maxlength=50 value= //td td class=status/td /tr tr td class=labellabel id=lpassword_confirm for=password_confirmConfirm Password/label/td td class=fieldinput id=password_confirm name=password_confirm type=password maxlength=50 value= //td td class=status/td /tr /table input id=signupsubmit name=signup type=submit value=Signup / /form /div --- index.html : head style type=text/css media=all @import css/global.css; /style script src=/thickbox/js/jquery.js type=text/javascript/script script src=/thickbox/js/thickbox_plus.js type=text/javascript/ script /head body lia href=ajaxLogin.htm?height=500amp;width=550 class=thickboxThickBox login/a /body /html Please tell me how can I get validation in thickbox? Thanks
[jQuery] Re: XML Parsing Question...
Ajax's XMLHTTPRequest depends on ActiveX to work in IE6, you are already using it. - ricardo On Oct 15, 4:00 am, KenLG [EMAIL PROTECTED] wrote: Because I don't want to deal with the customer service calls generated by the ActiveX objects. Plenty of people working in corporate cubbyholes get their computers locked down so that ActiveX isn't allowed to execute. Not that I really want to worry about IE6 but I can't exclude them yet. :) And, I know it's technically not an xml parser but it's not an HTML parser either unless the underlying code only recognizes HTML tags. In a way, it seems more like an SGML parser. Still doesn't explain why it works in some browsers and not the other (i.e. FF2 vs FF3). kn On Oct 8, 10:10 pm, Michael Geary [EMAIL PROTECTED] wrote: Well... Really, it doesn't work *at all*. You're not using anXMLparser. It's an HTML parser. Sure, it will do some kind of passable job of parsing some kinds ofXML, sort of, in some browsers. Why not use a realXMLparser? function parseXML(xml) { if( window.ActiveXObject window.GetObject ) { var dom = new ActiveXObject( 'Microsoft.XMLDOM' ); dom.loadXML(xml); return dom; } if( window.DOMParser ) return new DOMParser().parseFromString(xml, 'text/xml' ); throw new Error( 'NoXMLparser available' ); } A quick test: var dom = parseXML('foo what=isitbarhowdy/bar/foo'); var $dom = $(dom); console.log( $dom.find('foo').attr('what') ); // isit console.log( $dom.find('bar').text() ); // howdy You could make it a plugin: jQuery.parseXML = function(xml) { return jQuery( parseXML(xml) ); }; And then you can replace the first two lines of the test code above with: var $dom = $.parseXML('foo what=isitbarhowdy/bar/foo'); -Mike From: KenLG It may not be supported but it works great...usually. As far as find being case-sensitive, the weird thing is that it doesn't necessarily seem true. I could lcase the tags in theXMLbut still do the find against the mixed case element name and it still works. I had this suspicion that jquery is doing that find in a case- insensitive way. Actually, something I forgot to try: FireFox 3 works just fine with the mixed caseXML. Weird. I guess I'll just have to deal until FF2 gets phased out. Thanks, kn On Oct 6, 2:42 am, Erik Beeson [EMAIL PROTECTED] wrote: To my knowledge,XMLparsing via the jQuery constructor isn't supported. See here:http://dev.jquery.com/ticket/3143 --Erik On Sat, Oct 4, 2008 at 12:29 PM, KenLG [EMAIL PROTECTED] wrote: For much of my app, I'm doing an Ajax hit to the server to grabXML. That works great. But, in some cases, I've got too many pieces of data (unrelated) that I need to pull so I'm trying to do a simple passthrough from the server side (I'm using ASP.Net). So, I'll either output from SQL Server or hand-stitch someXMLand write it to the page. Whenever I do this passthrough (whether it comes from SQL Server or from my own efforts), theXMLdoesn't get parsed by Jquery. For example: var sTestXML = '?xmlversion=1.0?\r \nEventContactsEventContactEventContactDataHello/ EventContactData/EventContact/EventContacts\r\n'; var test = $(sTestXML); alert(test.find(EventContact).length); will result in the alert showing zero. Now, if I lower case some of the tags (and this will vary fromXML doc toXMLdoc but usually it's the root and object-level tags), it'll work. What's going on here?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Problems with find()
Hi, It does find only descendant elements. It's likely a fault in your plugin code, without seeing it one can just guess. Try using $('li',this), maybe you get lucky :) - ricardo On Oct 15, 9:46 am, less than zero [EMAIL PROTECTED] wrote: Hi, I'm having some problems with a plugin I'm developing. I'm using '$(this).find('whatever')' to locate the relevant elements within the html code, which works fine if just one instance of the plugin is initialised. However, if multiple versions are called they start to conflict with each other because they seem to be referencing the same elements. I thought that find() would only locate descendant elements. E.g. $('#myList').find('li'); Would only find li elements that descended from ul id=myList. This doesn't seem to be the case when used in my plugin however. Is there something I'm missing here or does find() work differently to the way I described. I can't find any information in the documentation to suggest otherwise. Thanks in advance. -- View this message in context:http://www.nabble.com/Problems-with-find%28%29-tp19991875s27240p19991... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Odd behavior in IE with select boxes
I don't do this with client side, I do it with server side and a database, but I think you should try one of the following: 1) label for=type class=dialog firstSelect Type/label select id=type class=dialog first option selected=selected value=--- Type ---/option script type=text/javascript // javascript here to dynamically load content /script /select or 2) label for=type class=dialog firstSelect Type/label select id=type class=dialog first //No option to start with /select javascript: Then make your javascript add the first option. If it is the first in the list then it will be selected by default so there is no need to add selected=selected Hope this helps, Johnie Karr On Oct 14, 1:57 pm, TimW66 [EMAIL PROTECTED] wrote: Anyone? On Oct 13, 6:08 pm, TimW66 [EMAIL PROTECTED] wrote: I'm seeing some odd behavior in IE with my SELECT boxes. In the static HTML, I have the following: label for=type class=dialog firstSelect Type/label select id=type class=dialog first option selected value=--- Type ---/option /select In JavaScript, I have the following: $.get(create.do, params, function(data) { if( $('option', idSel).length 0 ) { var firstOption = $('option', idSel); $(idSel).replaceWith(data); $(idSel).prepend(firstOption); $(idSel).removeAttr('disabled'); } } ); The data coming back is actually a snippet of HTML, like this: select id=typeoption value=1In/optionoption value=2Out/ option/select Note it does not contain a selected attribute. What I want is to merge the data with the static HTML so in essence I would have: label for=type class=dialog firstSelect Type/label select id=type class=dialog first option selected value=--- Type ---/option option value=1In/option option value=2Out/option /select However, in IE, the selected attribute always seems to get set on the In instead. Is this yet another odd thing with IE? Is there something else I should be doing to get the desired results? Thanks in advance.- Hide quoted text - - Show quoted text -
[jQuery] Re: Using jQuery Multiple File Upload Plugin and jQuery Form Plugin together
OK, I made a small example: http://tests.tripplanner.de Two Forms: 1.) With the Form PlugIn and Multi 2.) With the Form PlugIn ans no Multi The first one is not working , the second is. Check the Firebug console for the return of the upload script. It simply returns $_FILES... Greetings, Stefan Sturm
[jQuery] Re: Hover In/Out with quick mouse movements
i usually get around such problems by using a var stopper = false; which is set to true once the mouseover/out is called. you could just do something like: var stopper = false; $('#topbar').hover(function() { if(stopper == false){ stopper = true; $('.prev, .next').fadeIn('slow', function(){ stopper = false; } }, and as it seems, you should take a second var for the fadeout, but i havent got time to test it right now. if someone got a better way to accomplish this i would be happy to read that :) just play around with it and hopefully have fun (and dont copy and paste my code, havent checked for misspellings cause of lack of time) hope that helps :) greetings manarius
[jQuery] Re: JS Question: How does this jQuery idiom work?
Plugins are supposed to use this: (function($) { // Plugin code }) (jQuery) I know what it does (allows the use of $ within the script), but how does it actually work? Is it somehow casting the function object as the jQuery object? It always seemed odd to me, and I haven't seen this idiom elsewhere. Consider this bit of code: // declare a function that accepts an argument var myFn = function(myParam) { // inside here I can use myParam freely }; // call the function and pass an argument myFn(3); Now, change what you call the parameter name and what you pass to the function var myFn = function($) { // inside here I can use $ freely }; // call the function and pass jQuery as the argument myFn(jQuery); Now do it all in one step, as an anonymous function: (function($) { // inside here I can use myParam freely })(jQuery);
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
Correct. We use yuimin to manuall compress/minify the original .js file. Then this script handles the gzip compression on-the-fly. I really wish we could do the yuimin on the fly as well, but we haven't found a good way to handle that. On Oct 15, 10:35 am, Alex Weber [EMAIL PROTECTED] wrote: Thanks tlphipps, Your script is an example of on-the-fly compression right? Think I got it now! :) On Oct 15, 12:18 pm, tlphipps [EMAIL PROTECTED] wrote: If you're using PHP on the backend, here is the solution we use: ?php //define array that will hold an entry for each javascript file $jsfiles = array(); //just add a new line for each javascript file needed $jsfiles[] = jquery.yuimin.js; $jsfiles[] = jquery.autocomplete.yuimin.js; $jsfiles[] = jquery.bgiframe.yuimin.js; $jsfiles[] = jquery.blockui.yuimin.js; $jsfiles[] = jquery.contextmenu.yuimin.js; $jsfiles[] = jquery.cookie.yuimin.js; $jsfiles[] = jquery.cookiejar.yuimin.js; $jsfiles[] = jquery.curvycorners.yuimin.js; $jsfiles[] = jquery.date.yuimin.js; $jsfiles[] = jquery.datepicker.yuimin.js; $jsfiles[] = jquery.filetree.yuimin.js; $jsfiles[] = jquery.history_remote.yuimin.js; $jsfiles[] = jquery.inplace.yuimin.js; $jsfiles[] = jquery.json.yuimin.js; $jsfiles[] = jquery.livequery.yuimin.js; $jsfiles[] = jquery.media.yuimin.js; $jsfiles[] = jquery.metadata.yuimin.js; $jsfiles[] = jquery.scrollto.yuimin.js; $jsfiles[] = jquery.tablesorter.yuimin.js; $jsfiles[] = jquery.tablesorter.cookie.yuimin.js; $jsfiles[] = jquery.tabs.yuimin.js; $jsfiles[] = jquery.thickbox.yuimin.js; $jsfiles[] = jquery.tooltip.yuimin.js; $jsfiles[] = ui.core.yuimin.js; $jsfiles[] = ui.draggable.yuimin.js; ob_start('ob_gzhandler'); //start output buffering using gzip compression header(Content-type: text/javascript; charset: UTF-8); //declare this to the browser as javascript //setup header info to force caching header(Cache-Control: must-revalidate, public); $offset = 60 * 60 * 4; $ExpStr = Expires: . gmdate(D, d M Y H:i:s,time() + $offset) . GMT; header($ExpStr); //set expiration header foreach ($jsfiles as $fn) { echo file_get_contents($fn); echo ;\n; // accommodate scripts which are missing a trailing semicolon} ob_end_flush(); //output the content ? On Oct 15, 10:12 am, Chris Jordan [EMAIL PROTECTED] wrote: Yeah, nothing bugs me more than when I'm searching for the answer to something on google only to come up with fifteen mailing list posts on the subject where the only answer is some smart-ass telling me to search google for it. :o/ On Wed, Oct 15, 2008 at 9:06 AM, Alex Weber [EMAIL PROTECTED] wrote: lol tried that, had to wade through a lot of stuff but I guess I found my answers. if you knew it off the top of your head wouldn't hurt to just say it! =P thanks! -Alex On Oct 15, 9:23 am, MorningZ [EMAIL PROTECTED] wrote: Answers to your questions, every single one of them http://www.google.com/search?q=gzip On Oct 15, 7:58 am, Alex Weber [EMAIL PROTECTED] wrote: the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :) --http://cjordan.us
[jQuery] Re: Using multiple selectors
Thanks, this helped my to discover the correct syntax, choosing the apostrophes right. $('#Test, input[name=Prefix]').val('Testing'); O. Wyss On Oct 14, 10:40 pm, TimW66 [EMAIL PROTECTED] wrote: The input needs to have an ID, jQuery can't reference by the name attribute using the style you specified. You might also try: $(#form input['name=Prefix']).val(Testing); Here's more on selecting by attribute:http://docs.jquery.com/Selectors/attributeEquals#attributevalue And for more on selectors:http://docs.jquery.com/Selectors Also, you'll need to use the val() function instead of value. On Oct 14, 2:49 pm, wyo [EMAIL PROTECTED] wrote: I've a form like form id=Test ... fieldset table ... tbody tr tdinput name=Prefix/td Now I try to access it in the following way: $('#Test, Prefix').value = 'Testing; I also tried $('#Test', 'Prefix').value = 'Testing; with no success. Any idea what's wrong? O. Wyss
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
Hmmm thanks :) I use YUI too for manual compression... I found this article while I was researching and I think it might interest you: http://www.tummblr.com/wordpress/minify-and-gzip-javascript-and-css-with-minimal-cpu-overhead/ Alex On Oct 15, 12:50 pm, tlphipps [EMAIL PROTECTED] wrote: Correct. We use yuimin to manuall compress/minify the original .js file. Then this script handles the gzip compression on-the-fly. I really wish we could do the yuimin on the fly as well, but we haven't found a good way to handle that. On Oct 15, 10:35 am, Alex Weber [EMAIL PROTECTED] wrote: Thanks tlphipps, Your script is an example of on-the-fly compression right? Think I got it now! :) On Oct 15, 12:18 pm, tlphipps [EMAIL PROTECTED] wrote: If you're using PHP on the backend, here is the solution we use: ?php //define array that will hold an entry for each javascript file $jsfiles = array(); //just add a new line for each javascript file needed $jsfiles[] = jquery.yuimin.js; $jsfiles[] = jquery.autocomplete.yuimin.js; $jsfiles[] = jquery.bgiframe.yuimin.js; $jsfiles[] = jquery.blockui.yuimin.js; $jsfiles[] = jquery.contextmenu.yuimin.js; $jsfiles[] = jquery.cookie.yuimin.js; $jsfiles[] = jquery.cookiejar.yuimin.js; $jsfiles[] = jquery.curvycorners.yuimin.js; $jsfiles[] = jquery.date.yuimin.js; $jsfiles[] = jquery.datepicker.yuimin.js; $jsfiles[] = jquery.filetree.yuimin.js; $jsfiles[] = jquery.history_remote.yuimin.js; $jsfiles[] = jquery.inplace.yuimin.js; $jsfiles[] = jquery.json.yuimin.js; $jsfiles[] = jquery.livequery.yuimin.js; $jsfiles[] = jquery.media.yuimin.js; $jsfiles[] = jquery.metadata.yuimin.js; $jsfiles[] = jquery.scrollto.yuimin.js; $jsfiles[] = jquery.tablesorter.yuimin.js; $jsfiles[] = jquery.tablesorter.cookie.yuimin.js; $jsfiles[] = jquery.tabs.yuimin.js; $jsfiles[] = jquery.thickbox.yuimin.js; $jsfiles[] = jquery.tooltip.yuimin.js; $jsfiles[] = ui.core.yuimin.js; $jsfiles[] = ui.draggable.yuimin.js; ob_start('ob_gzhandler'); //start output buffering using gzip compression header(Content-type: text/javascript; charset: UTF-8); //declare this to the browser as javascript //setup header info to force caching header(Cache-Control: must-revalidate, public); $offset = 60 * 60 * 4; $ExpStr = Expires: . gmdate(D, d M Y H:i:s,time() + $offset) . GMT; header($ExpStr); //set expiration header foreach ($jsfiles as $fn) { echo file_get_contents($fn); echo ;\n; // accommodate scripts which are missing a trailing semicolon} ob_end_flush(); //output the content ? On Oct 15, 10:12 am, Chris Jordan [EMAIL PROTECTED] wrote: Yeah, nothing bugs me more than when I'm searching for the answer to something on google only to come up with fifteen mailing list posts on the subject where the only answer is some smart-ass telling me to search google for it. :o/ On Wed, Oct 15, 2008 at 9:06 AM, Alex Weber [EMAIL PROTECTED] wrote: lol tried that, had to wade through a lot of stuff but I guess I found my answers. if you knew it off the top of your head wouldn't hurt to just say it! =P thanks! -Alex On Oct 15, 9:23 am, MorningZ [EMAIL PROTECTED] wrote: Answers to your questions, every single one of them http://www.google.com/search?q=gzip On Oct 15, 7:58 am, Alex Weber [EMAIL PROTECTED] wrote: the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :) --http://cjordan.us
[jQuery] BlockUI blacks-out whole screen (BlockUI2.0x, IE7). Opacity?
Hi there, I am using jQuery 1.2.6 and BlockUI 2.09 (09/16/2008) on a local server, because of a school project. The BlockUI works perfectly in FireFox (2x and 3x) but I'm having problems in IE7; it blacks-out the whole screen. Only the 'loading'-text is visible; the *website* is gone. My opacity is 0.5, but this seems not to work in IE7. Does anyone got a solution? I have searched Google and forums, but nobody seemed to have a solution to my problem. Thanks for any reply!
[jQuery] Re: Slide Show (S6) Autoplay Addon Beta (w/ Scroll-Up Effect) - jQuery Animate in Action
Chuck, I suspect it's only the svg object being used for the background, which really doesn't have anything to do with the 'code' - only the implementation. I'm looking at it in Safari, so I'm only guessing. Perhaps Gerald can add a simple workaround, or an example without the gradient On Oct 15, 5:30 am, C.Everson [EMAIL PROTECTED] wrote: On Tue, 14 Oct 2008 21:51:46 -0700 (PDT), Gerald wrote: See an example slide show in action @http://slideshow.rubyforge.org/autoplay.html The URL presents this message: Microsoft's Internet Explorer browser has no built-in vector graphics machinery required for loss-free gradient background themes. Please upgrade to a better browser such as Firefox, Opera, Safari or others with built-in vector graphics machinery and much more. I'm NOT trying to be critical, but while everyone certainly appreciates your effort and contribution, IMHO it does not really help anyone since IE is the defacto standard for browsers. Love it or hate it, we all have to deal with it. Personally I don't see any point in pursuing any code that won't run on IE other than as hobby code Just my $.02 Chuck
[jQuery] Re: BlockUI blacks-out whole screen (BlockUI2.0x, IE7). Opacity?
How does the demo page look for you? http://malsup.com/jquery/block/#page Can you make a demo page that shows the problem you're seeing? Mike On Oct 15, 6:20 am, Anxiro [EMAIL PROTECTED] wrote: Hi there, I am using jQuery 1.2.6 and BlockUI 2.09 (09/16/2008) on a local server, because of a school project. The BlockUI works perfectly in FireFox (2x and 3x) but I'm having problems in IE7; it blacks-out the whole screen. Only the 'loading'-text is visible; the *website* is gone. My opacity is 0.5, but this seems not to work in IE7. Does anyone got a solution? I have searched Google and forums, but nobody seemed to have a solution to my problem. Thanks for any reply!
[jQuery] [ANN] S6 - Easier to Understand and Extend S5 Rewrite using jQuery
Hello, For the Slide Show (S9) gem that lets you create slide shows and author slides in plain text using a wiki-style markup language that's easy-to-write and easy-to-read I've created a rewrite of Eric Meyer's S5 JavaScript code using the jQuery JavaScript library. The idea is that the new code (S6) is easier to understand and easier to extend. You can find the code online @ http://slideshow.rubyforge.org/svn/trunk/lib/templates/s6/slides.js and compare it to http://slideshow.rubyforge.org/svn/trunk/lib/templates/s5/slides.js Add plugins, effects and more. Contributions welcome! Cheers. PS: To see the jQuery-powered S6 slide show package in action see the S6-adaption of Prototype vs jQuery: To and from JavaScript libraries by Remy Sharp as an example online @ http://slideshow.rubyforge.org/jquery.html S6 usage tips: Use the t-key to toggle between outline and presentation mode. Scroll to the bottom right corner for slide show controls (or press the c-key). Use the space bar, right arrow, down arrow or page down to go to next slide and so on. -- Gerald Bauer - Internet Professional - http://geraldbauer.ca
[jQuery] treeview: options 'animated' and 'speed'
In an older version of my application, I applied option 'speed: fast' to my treeview. For a more recent version I wanted to find out exactly which settings are applicable for this option, but I could't find any documentation on it. The 'animated' option is documented though and because it can be set to fast as well, I figured it was sort of a replacement for 'speed'. Apparently it isn't though and 'animation' has a very nasty side effects on my treeview, giving me problems withe the rendering of images in the list items. So I switched back to 'speed: fast' and the nasty side effects disappeared. My questions are these: - Exactly what is the difference between the 'speed' and 'animation' options and when should I use one or the other? - Where can I find documentation about appropriate settings for the 'speed' option? - What about that nasty side effect of the 'animated: fast' option? Is that a known bug?
[jQuery] Re: Hover In/Out with quick mouse movements
Thanks for the reply. Looks a bit like overkill tbh, and I did quickly try it but couldn't make it work. What I have now is -- $(document).ready(function() { $('.ticker-prev, .ticker-next').hide(); $('#topbar').hover(function() { $('.ticker-prev, .ticker-next').fadeIn(500); }, function() { $('.ticker-prev, .ticker-next').fadeTo(2000, 1).fadeOut(500); }); }); Which when I mouseout delays the fadeout effect by 2 seconds by fooling the already faded in element to fade in some more, ie. do nothing, before fading out. What I'd like to be able to do still though is to cancel the quesue of mousein/out effects, and also if a user mousein then out then in again before the 2 second wait then the mouseout effect in the middle should not run. Hope someone can understand this little problem and help out. Cheers!
[jQuery] Re: [validate] Validation code in separate file, fails to work
Hmm, could you have a look at the page again? Do you know why it's adding the error message twice? Once after the div-element of the validating element and after the container div of the page itself? On Wed, Oct 15, 2008 at 9:45 AM, Weyert de Boer [EMAIL PROTECTED] wrote: Heh. I must have been dreaming last night. Thanks anyways. Whats wrong with that page? Works for me just fine.
[jQuery] Slide Show (S6) Autoplay Addon Beta (w/ Scroll-Up Effect) - jQuery Animate in Action
Hello, At yesterday's Vancouver Ajax Hack Night inspired by Karl Swedberg's Scroll Up Headline Reader jQuery Tutorial [1] I put together an autoplay addon (Beta version) for the S6 slide show package. Using jQuery's animate[2] function lets you loop through slides in autoplay with a scroll-up effect and more. It's as easy as replacing: $( cid ).hide(); // hide current slide $( nid ).show(); // show next slide with: var cheight = $( cid ).outerHeight(); $( cid ).animate({top: -(cheight+5)},slow); $( nid ).css('top',(cheight+5)+'px'); $( nid ).show(); $( nid ).animate({top: 0},slow, function() { $ ( cid ).hide().css( 'top', '0px'); } ); See an example slide show in action @ http://slideshow.rubyforge.org/autoplay.html Note, you can use the 'a', 's' or 'p' keys to start/stop the autoplay. Cheers. [1] http://docs.jquery.com/Tutorials:Scroll_Up_Headline_Reader [2] http://docs.jquery.com/Effects/animate -- Gerald Bauer - Internet Professional - http://geraldbauer.ca
[jQuery] Re: Hover In/Out with quick mouse movements
davebowker wrote: Which when I mouseout delays the fadeout effect by 2 seconds by fooling the already faded in element to fade in some more, ie. do nothing, before fading out. Maybe hoverIntent is what you are looking for: http://plugins.jquery.com/project/hoverIntent Cheers Mate
[jQuery] making style changes on keydown event
Hi All, I am new to jQuery and need some help. I am writing a custom suggest box in jQuery. One behavior I am trying to achieve is highlight suggestions on keydown on keyup events. I have written css classes for it and I am using toggleClass in event handler. But problem I am facing is that the style changes are done as long as event is live. Let me explain it, I am changing background- color on keydown event, the color changes on keydown event but as soon as I release key the background-color gets back to original value. I want the style changes to be permanent until I change them on some other event/criteria. Let me provide my jQuery code - $( function() { $(#fromCityBox) .keyup( function(event) { event.preventDefault(); var value = $(this).val(); if(value.length = 3) { $.ajax( { type : GET, url : /etravel_new/suggest.do?for= +value, success : function(response) { if(response response.length 0) { $(#fromSuggestionsTable) .html(response) .css(display, block) .filter(#fromSuggestionsTable td) .click( function(event) { if($(event.target).is(td)) { $(#fromCityBox).val($(event.target).text()); var code = getAirportCode($(event.target).text()); $(#from_CityF).val(code); }; $(#fromSuggestionsTable).css(display, none); } ) .mouseover( function(event) { $(event.target).toggleClass(highlightSuggestion); } ) .mouseout( function(event) { $(event.target).toggleClass(highlightSuggestion); } ); } else { $(#fromSuggestionsTable) .css(display, none); } } } ); } if(value.length 3) { $(#fromSuggestionsTable).css(display, none); } }
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
Yeah, nothing bugs me more than when I'm searching for the answer to something on google only to come up with fifteen mailing list posts on the subject where the only answer is some smart-ass telling me to search google for it. :o/ On Wed, Oct 15, 2008 at 9:06 AM, Alex Weber [EMAIL PROTECTED] wrote: lol tried that, had to wade through a lot of stuff but I guess I found my answers. if you knew it off the top of your head wouldn't hurt to just say it! =P thanks! -Alex On Oct 15, 9:23 am, MorningZ [EMAIL PROTECTED] wrote: Answers to your questions, every single one of them http://www.google.com/search?q=gzip On Oct 15, 7:58 am, Alex Weber [EMAIL PROTECTED] wrote: the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :) -- http://cjordan.us
[jQuery] jqmodal overlay is flashing with internet explorer
Hi folks, My problem is, that when I open a jqmodal window, for a short time, the overlay has full opacity. This problem only occours with Internet Explorer. I'm very thankfull that this problem also happen on the official jqmodal site, when you open example 6, the alert() override. I hope this helps you, to help me ;). Greetings Tim
[jQuery] Beginner: Load Bind Event Problem
My page: I click a tab and it loads in the html file for the tab. I click a link on the newly loaded html file but it doesn't run the function I wrote for it. The link only runs the function when it's in the home file, rather than the loaded file. I know this has to do with binding, but it's too confusing. Any help would be appreciated. Thanks, Jason
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
Answers to your questions, every single one of them http://www.google.com/search?q=gzip On Oct 15, 7:58 am, Alex Weber [EMAIL PROTECTED] wrote: the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :)
[jQuery] Problems with find()
Hi, I'm having some problems with a plugin I'm developing. I'm using '$(this).find('whatever')' to locate the relevant elements within the html code, which works fine if just one instance of the plugin is initialised. However, if multiple versions are called they start to conflict with each other because they seem to be referencing the same elements. I thought that find() would only locate descendant elements. E.g. $('#myList').find('li'); Would only find li elements that descended from ul id=myList. This doesn't seem to be the case when used in my plugin however. Is there something I'm missing here or does find() work differently to the way I described. I can't find any information in the documentation to suggest otherwise. Thanks in advance. -- View this message in context: http://www.nabble.com/Problems-with-find%28%29-tp19991875s27240p19991875.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: treeview: options 'animated' and 'speed'
Documentation is here: http://docs.jquery.com/Plugins/Treeview/treeview#toptions Its likely that there was another issue causing trouble, please post a testpage. Jörn On Wed, Oct 15, 2008 at 11:39 AM, pjdevries [EMAIL PROTECTED] wrote: In an older version of my application, I applied option 'speed: fast' to my treeview. For a more recent version I wanted to find out exactly which settings are applicable for this option, but I could't find any documentation on it. The 'animated' option is documented though and because it can be set to fast as well, I figured it was sort of a replacement for 'speed'. Apparently it isn't though and 'animation' has a very nasty side effects on my treeview, giving me problems withe the rendering of images in the list items. So I switched back to 'speed: fast' and the nasty side effects disappeared. My questions are these: - Exactly what is the difference between the 'speed' and 'animation' options and when should I use one or the other? - Where can I find documentation about appropriate settings for the 'speed' option? - What about that nasty side effect of the 'animated: fast' option? Is that a known bug?
[jQuery] Re: Ajax load() problems
html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / title/title link href=css/main.css rel=stylesheet type=text/css media=screen / link href=css/chat.css rel=stylesheet type=text/css media=screen / script src=javascript/jquery-1.2.6.min.js type=text/javascript/ script script type=text/javascript function alCaricamento(){ $('#contenuti').load('chat/chat.php?prova=x'); } /script /head body onload=alCaricamento(); div id=refresh/div div id=menu/div div id=contenuti/div /body /html that's the page that works... the first one to be loaded this one below is chat.php when the function neither alone neither by clicking the link works script type=text/javascript !-- $(#azioni).load(azioni.php); function caricaPagina(){ $(#azioni).load('azioni.php'); } setInterval(caricaPagina(),2000); -- /script div id=opzionia href=javascript:caricaPagina();prova/a/div div id=chatbox div id=luogoEturni/div div id=azioni/div /div Thanx
[jQuery] Proper jQuery object creation for chaining
Sorry in advance if this is confusing... I am new to jQuery (converting myself from Prototype), and as such I am finding situations where I need to create a new object, which I would have done with a class in Prototype (as such, doesn't make sense for it to appear anywhere except the start of a chain, since it will return a new object). This object will also be used similar to a superclass for other objects as well. I also want the object to be chain-able as well. My first attempt at this was something along these lines: (function($) { function create($opts) { // some code to create an object return obj; } $.fn.firstObj = function($opts) { // Error any chained calls if (this.length) throw SyntaxError(); return create($.extend({}, arguments.callee, $opts)); } $.extend( $.fn.firstObj, { // Some public methods and default properties prop1: 'val1', prop2, 'val2', method1: function() { dosomething(arguments); } } ); })(jQuery); (function($) { function create($opts) { // some code to create an object return obj; } $.fn.secondObj = function($opts) { // Error any chained calls if (this.length) throw SyntaxError(); return $.fn.firstObj($.extend({}, arguments.callee, $opts)); } $.extend( $.fn.secondObj, { // Some public methods and default properties prop1: 'newval1', //overrides $.fn.firstObj.prop1 newprop2, 'val2', newmethod1: function() { dosomethingelse(arguments); } } ); })(jQuery); Problem is, that say I chain either of the returned objects, I lose the public methods for those objects. example: var newObj = $.fn.firstObj({prop1: 'foobar'}); console.log(newObj.method1 + ''); // logs: function() {dosomething(arguments);} newObj.click( function() { console.log(this.method1 + ''); } ); // logs undefined now (I've also tried $(this).method1) What is the proper way of creating a new object in jQuery so that it can properly be chained afterwards?
[jQuery] Re: Slide Show (S6) Autoplay Addon Beta (w/ Scroll-Up Effect) - jQuery Animate in Action
On Tue, 14 Oct 2008 21:51:46 -0700 (PDT), Gerald wrote: See an example slide show in action @ http://slideshow.rubyforge.org/autoplay.html The URL presents this message: Microsoft's Internet Explorer browser has no built-in vector graphics machinery required for loss-free gradient background themes. Please upgrade to a better browser such as Firefox, Opera, Safari or others with built-in vector graphics machinery and much more. I'm NOT trying to be critical, but while everyone certainly appreciates your effort and contribution, IMHO it does not really help anyone since IE is the defacto standard for browsers. Love it or hate it, we all have to deal with it. Personally I don't see any point in pursuing any code that won't run on IE other than as hobby code Just my $.02 Chuck
[jQuery] Re: XML Parsing Question...
On Oct 15, 2008, at 2:00 AM, KenLG wrote: Because I don't want to deal with the customer service calls generated by the ActiveX objects. Plenty of people working in corporate cubbyholes get their computers locked down so that ActiveX isn't allowed to execute. Not that I really want to worry about IE6 but I can't exclude them yet. :) IE had an XML parser shipped/built in (as an ActiveX control) way before the others. The only question is which version. But, if you are just doing a simple parse, you should be fine with anything that is out there. In other words, Michael Geary is right - just use the built in parsers. It's silly to try and reinvent it. best, -Rob And, I know it's technically not an xml parser but it's not an HTML parser either unless the underlying code only recognizes HTML tags. In a way, it seems more like an SGML parser. Still doesn't explain why it works in some browsers and not the other (i.e. FF2 vs FF3). kn On Oct 8, 10:10 pm, Michael Geary [EMAIL PROTECTED] wrote: Well... Really, it doesn't work *at all*. You're not using anXMLparser. It's an HTML parser. Sure, it will do some kind of passable job of parsing some kinds ofXML, sort of, in some browsers. Why not use a realXMLparser? function parseXML(xml) { if( window.ActiveXObject window.GetObject ) { var dom = new ActiveXObject( 'Microsoft.XMLDOM' ); dom.loadXML(xml); return dom; } if( window.DOMParser ) return new DOMParser().parseFromString(xml, 'text/xml' ); throw new Error( 'NoXMLparser available' ); } A quick test: var dom = parseXML('foo what=isitbarhowdy/bar/foo'); var $dom = $(dom); console.log( $dom.find('foo').attr('what') ); // isit console.log( $dom.find('bar').text() ); // howdy You could make it a plugin: jQuery.parseXML = function(xml) { return jQuery( parseXML(xml) ); }; And then you can replace the first two lines of the test code above with: var $dom = $.parseXML('foo what=isitbarhowdy/bar/foo'); -Mike From: KenLG It may not be supported but it works great...usually. As far as find being case-sensitive, the weird thing is that it doesn't necessarily seem true. I could lcase the tags in theXMLbut still do the find against the mixed case element name and it still works. I had this suspicion that jquery is doing that find in a case- insensitive way. Actually, something I forgot to try: FireFox 3 works just fine with the mixed caseXML. Weird. I guess I'll just have to deal until FF2 gets phased out. Thanks, kn On Oct 6, 2:42 am, Erik Beeson [EMAIL PROTECTED] wrote: To my knowledge,XMLparsing via the jQuery constructor isn't supported. See here:http://dev.jquery.com/ticket/3143 --Erik On Sat, Oct 4, 2008 at 12:29 PM, KenLG [EMAIL PROTECTED] wrote: For much of my app, I'm doing an Ajax hit to the server to grabXML. That works great. But, in some cases, I've got too many pieces of data (unrelated) that I need to pull so I'm trying to do a simple passthrough from the server side (I'm using ASP.Net). So, I'll either output from SQL Server or hand-stitch someXMLand write it to the page. Whenever I do this passthrough (whether it comes from SQL Server or from my own efforts), theXMLdoesn't get parsed by Jquery. For example: var sTestXML = '?xmlversion=1.0?\r \nEventContactsEventContactEventContactDataHello/ EventContactData/EventContact/EventContacts\r\n'; var test = $(sTestXML); alert(test.find(EventContact).length); will result in the alert showing zero. Now, if I lower case some of the tags (and this will vary fromXML doc toXMLdoc but usually it's the root and object-level tags), it'll work. What's going on here?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: what is the best way to do this
I don't think you can 'get' class attributes (though you could try $ ('div').attr('class');). I you can get the ids. I set the id and then use jquery search class so if you had [code] div class=profile id=p1/divdiv class=profile id=p2/div [/code] etc. you could get the divs by using [code] $('div.profile').attr('id'); [/code]
[jQuery] startsWith / endsWith
Hi, it would be nice to find these two functionalities in the jQuery Utilities/String operations, beside trim(). No ? -- View this message in context: http://www.nabble.com/startsWith---endsWith-tp19997960s27240p19997960.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: UI/Sortables beginner understanding problem
I solved the problem with the numbered li. But how can I catch the event when I drag a li around? the change, update, start, sort, stop, beforeStop, recieve, remove, over, out, activate, deactivate are firing when the page loads, not when I sort around. sigh! $(#staerke2).sortable({ opacity: 0.5, cursor: pointer, recieve: (console.log(recieve)), connectWith: [#staerke1] }); cu tom
[jQuery] Re: minify + gzip??????? stupid question i know but please explain...
lol tried that, had to wade through a lot of stuff but I guess I found my answers. if you knew it off the top of your head wouldn't hurt to just say it! =P thanks! -Alex On Oct 15, 9:23 am, MorningZ [EMAIL PROTECTED] wrote: Answers to your questions, every single one of them http://www.google.com/search?q=gzip On Oct 15, 7:58 am, Alex Weber [EMAIL PROTECTED] wrote: the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :)
[jQuery] Re: BlockUI blacks-out whole screen (BlockUI2.0x, IE7). Opacity?
I'm having a similar issue, but with IE6. I'm using blockUI a lot in my app and the opacity has always worked fine in IE6. I added a new feature to the app where I needed to block out the entire screen in order to display a caveat message to the user and for some reason the overlay is completely black and the only thing that is visible is the 'message'. This problem only happens in IE6 for me and only when displaying this caveat message. IE6 handles the overlay just fine in other parts of the app. I haven't taken any time to try and figure this out, I just logged it in our bug tracking system. Perhaps its time I tried to figure it out. I'll here if I come up with a solution for me and maybe it will work in your case too. Brian On Oct 15, 6:20 am, Anxiro [EMAIL PROTECTED] wrote: Hi there, I am using jQuery 1.2.6 and BlockUI 2.09 (09/16/2008) on a local server, because of a school project. The BlockUI works perfectly in FireFox (2x and 3x) but I'm having problems in IE7; it blacks-out the whole screen. Only the 'loading'-text is visible; the *website* is gone. My opacity is 0.5, but this seems not to work in IE7. Does anyone got a solution? I have searched Google and forums, but nobody seemed to have a solution to my problem. Thanks for any reply!
[jQuery] minify + gzip??????? stupid question i know but please explain...
the recomendation out there is serve your JS minified + gzipped ok, i downloaded the YUI minified and use it to minify all my files (~50% size reduction)... now whats all this talk about gzipping? do i have to manually download gzip and do the same thing? AFTER I minify the file? (or write a batch that does both?) or if i enable mod_deflate it takes care of the gzipping? thanks! :)
[jQuery] Re: Beginner: Load Bind Event Problem
Because the events are initialised on page load for the dom state available at that moment (more on this here: http://docs.jquery.com/Tutorials:AJAX_and_Events)http://docs.jquery.com/Tutorials:AJAX_and_Events . either you include your javascript inside the ajaxed html (baad), or (wiser solution) you use livequery plugin, available here: http://plugins.jquery.com/project/livequery On Wed, Oct 15, 2008 at 6:46 PM, Jason [EMAIL PROTECTED] wrote: My page: I click a tab and it loads in the html file for the tab. I click a link on the newly loaded html file but it doesn't run the function I wrote for it. The link only runs the function when it's in the home file, rather than the loaded file. I know this has to do with binding, but it's too confusing. Any help would be appreciated. Thanks, Jason
[jQuery] Using jQuery Multiple File Upload Plugin and jQuery Form Plugin together
Hello, I'm trying to use jQuery Form Plugin( http://www.malsup.com/jquery/form/ ) and jQuery Multiple File Upload Plugin( http://www.fyneworks.com/jquery/multiple-file-upload/ ) together to build a possibility to Upload more then one file at a time. But when I try to do this, the Form Plugin uploads no file. I can select more then one file and after submitting the form, the server script( php ) gets called, but there is no file uploaded. Perhaps somebody can help me on this... Greetings, Stefan Sturm
[jQuery] Re: startsWith / endsWith
sometimes jQuery isn't always the answer :-) You can just add a few fines to a common js file in your project String.prototype.beginsWith = function(t, i) { if (i==false) { return (t == this.substring(0, t.length)); } else { return (t.toLowerCase() == this.substring(0, t.length).toLowerCase()); } } String.prototype.endsWith = function(t, i) { if (i==false) { return (t == this.substring(this.length - t.length)); } else { return (t.toLowerCase() == this.substring(this.length - t.length).toLowerCase()); } } More: (http://www.ivanuzunov.net/top-10-javascript-stringprototype- extensions/) And then you can use those on any object, not just a jQuery object if( $(#div1).text().beginsWith(Item 1, true) == true ) { // do something with this div that starts with Item 1 } heck, even the trim prototype listed on that page String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/ g,'’); } makes var trimmedText = $.trim($(#div1).text()); 'cleaner' in that it can be said var trimmedText = $(#div1).text().trim(); On Oct 15, 1:09 pm, debussy007 [EMAIL PROTECTED] wrote: Hi, it would be nice to find these two functionalities in the jQuery Utilities/String operations, beside trim(). No ? -- View this message in context:http://www.nabble.com/startsWith---endsWith-tp19997960s27240p19997960... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: SerialScroll navigation modification question
FYI this functionality also works great with the pagination plagin you only need to modify it a bit the pagination plugin returns a span for the first item, this needs to be changed to a standard link var lnk = $(a class='active'+(appendopts.text)+/a) and because the click handler is handled by the serialscroll plugin you need to delete that from the pagination plugin as well //.bind(click, getClickHandler(page_id)) so in my case i first call the pagination plgin to create a nr of links based on the nr of items in my news dataset , adn then i call the serialscroll to make this into a scroller and attach the navigation to the before created paging links Armand On Tue, Oct 14, 2008 at 2:59 PM, Ariel Flesler [EMAIL PROTECTED] wrote: Nope, I thought I had a snippet for this on the Doctorate on... post, it seems I forgot to add this one. Will do as soon as I can. -- Ariel Flesler http://flesler.blogspot.com On Oct 14, 6:13 am, Armand Datema [EMAIL PROTECTED] wrote: Thanks thats about how I solved it also just wanted to check if somehow this was allready included int he plugin and I missed it Armand On Fri, Oct 10, 2008 at 10:33 PM, Ariel Flesler [EMAIL PROTECTED] wrote: You have 2 options. - Binding externally: var $links = $('#navigation a').click(function(){ $links.removeClass('selected'); $(this).addClass('selected'); }); - Using the onBefore callback. I think the first one is simple and safe. I'd go for that. Cheers -- Ariel Flesler http://flesler.blogspot.com On Oct 9, 8:37 am, Armand Datema [EMAIL PROTECTED] wrote: Hi I am using the serialscroll on my site to page through a news resultset. I am using the naviagation option that automatically turns a given list into the naviagation for this scroller. However I would like to have the link in the ul have a new class when its clicked so I can style this differently, whats the best way to do this. thanks in advance Armand -- Armand Datema CTO SchwingSoft -- Armand Datema CTO SchwingSoft
[jQuery] how can i query all fields with values in a form
hi friends, i wanted to reference a field by it's name, in the form it is found. my way was: var inputs = jQuery(the_form).find('input'); //a list of fields var field = jQuery(inputs).filter('[name='+fieldname+']'); my problem is, that inputs doesn't contain textarea and select fields. is there a more complete solution? i imagine a sum of arrays similar to inputs. any way to put an or in this query? best regards, alex
[jQuery] Lightbox Plugin wanted
I'm looking for a jquery lightbox plugin for a screenshot tour. I want to present an image in a lightbox with a text below the image and a link to the next image. When the user clicks the link, the next image and the next text should be displayed, again with a link to the next screenshot. - The tour should start with a click on a text link. Most lightbox scripts I found work if you show all images as thumbs on the original html page. But I don't want the images to be visible at the original page at all, there should be just the textual link. - Most lightbox scripts use little arrows above the image to navigate to the next image. These arrows are only visible if you hover the mouse cursor over the image. This looks cool, but doesn't rank high on the usabillity scale. I would prefer a script which has text links below the image. Thickbox does this. - Ideally the plugin would also support multiple languages, as I have a German as well as an English website. I've tried Leandro's lightbox (http://leandrovieira.com/projects/ jquery/lightbox/) as well as the thickbox (http://jquery.com/demo/ thickbox/) but didn't find a way to achieve all of what I describe above. Does anyone know which plugin I could use? Best Regards, Sandra
[jQuery] how to store xml in a variable
Hello! I need to store in object variables xml data contained in different xml files. The code i came up with does not seem to function properly. Can you tell me what i'm doing wrong? $(document).ready(function() { // To preload more files, add them to the filesToLoad array. var filesToLoad = [{ instance: 'ds_projects_XML', file: 'projects/datascapes.xml' }, { instance: 'ds_people_XML', file: 'people/datascapes.xml'}]; for (var i = 0; i filesToLoad.length; i++) { var $file = filesToLoad[i].file; var $instance = filesToLoad[i].instance; $.get($file, {}, function(xmlData, strStatus) { if (strStatus == 'success') { // $.log('M2.START: success loading file : ' + $file); eval($instance + ' = $(xmlData)'); if (i === (filesToLoad.length - 1)) { $.log('finished loading!'); } } else { $.log('error loading file : ' + $file + ' error: ' + strStatus); } }); } });
[jQuery] Re: page refreshs on form submit
Hi, thanks for your response. Do you mean something like this? jQuery.ajax({type:'POST', dataType: 'json', data: this.serialize(), url:'/trainingHelper/user/signUp', success:function(data,textStatus) { signUpResult(data); return false; }, error:function(XMLHttpRequest,textStatus,errorThrown) { return false; } }); With this I get the same behaviour :/ Any other suggestions? Cheers Finn MorningZ schrieb: Yuck Break out the $.ajax code out of the markup, that's just making it tons more difficult to debug $(document).ready(function() { $.ajax({ type:'POST', dataType: 'json', data: this.serialize(), url:'/trainingHelper/user/signUp', success:function(data,textStatus) { signUpResult(data); }, error:function(XMLHttpRequest,textStatus,errorThrown){ } }); return false; }); breaking out out that way makes it easier to see that you are missing return false from both the success and error callbacks (which is needed) On Oct 14, 9:15�pm, Finn Herpich [EMAIL PROTECTED] wrote: Hi folks, I've searched the Internet for a while but couldn't find a reason why my problem occurs. So, I'm working on a jQuery-plugin for Grails and I'm struggling with an AJAX-submit of a form. The attached code, generated by the plugin, leads the browser (Opera 9.6, Firefox 3.0.3 working with jQuery 1.2.6) to show the result on a new page instead of calling the success-function. Maybe I'm just to tired at the moment (3 am here), but I can't see my mistake. Hopefully someone can help me =) Cheers Finn !-- snip -- script src=/trainingHelper/js/jquery/jquery-1.2.6.js type=text/javascript /script /head body form id=signUpForm name=signUpForm action=/trainingHelper/user/signUp method=post onsubmit=$.ajax({type:'POST',dataType: 'json',data: this.serialize(), url:'/trainingHelper/user/signUp',success:function(data,textStatus){signUpResult(data);},error:function(XMLHttpRequest,textStatus,errorThrown){}});return false button type=submitSign Up/button /form /body /html
[jQuery] Re: Lightbox Plugin wanted
shadowbox? http://mjijackson.com/shadowbox/ On Wed, Oct 15, 2008 at 2:08 PM, Sandra Erb [EMAIL PROTECTED]wrote: I'm looking for a jquery lightbox plugin for a screenshot tour. I want to present an image in a lightbox with a text below the image and a link to the next image. When the user clicks the link, the next image and the next text should be displayed, again with a link to the next screenshot. - The tour should start with a click on a text link. Most lightbox scripts I found work if you show all images as thumbs on the original html page. But I don't want the images to be visible at the original page at all, there should be just the textual link. - Most lightbox scripts use little arrows above the image to navigate to the next image. These arrows are only visible if you hover the mouse cursor over the image. This looks cool, but doesn't rank high on the usabillity scale. I would prefer a script which has text links below the image. Thickbox does this. - Ideally the plugin would also support multiple languages, as I have a German as well as an English website. I've tried Leandro's lightbox (http://leandrovieira.com/projects/ jquery/lightbox/ http://leandrovieira.com/projects/jquery/lightbox/) as well as the thickbox (http://jquery.com/demo/ thickbox/ http://jquery.com/demo/thickbox/) but didn't find a way to achieve all of what I describe above. Does anyone know which plugin I could use? Best Regards, Sandra
[jQuery] what is the best way to do this
Hi I use jquery to filter a dataset based on classes. Each item has a class of the profile that news item is in so lets say div class=profile1 div class=profile2 div class=profile3 nof in a forum i check checkbox for profile 1 and 3 and now i need to have have the classes with profile 1 and 3 set to a new class whats the best way to go about his.
[jQuery] Re: what is the best way to do this
$('.profile1,.profile3').addClass('selected') just turn the names or numbers into vars: var selection = []; $('form checkbox:checked').each(function(){ selection.push('.'+this.whateverValue); }); // now selection == ['.profile1','.profile3']; selection = selection.join(','); $(selection).addclass('selected'); It depends on what exactly you need. - ricardo On Oct 15, 8:42 am, Armand Datema [EMAIL PROTECTED] wrote: Hi I use jquery to filter a dataset based on classes. Each item has a class of the profile that news item is in so lets say div class=profile1 div class=profile2 div class=profile3 nof in a forum i check checkbox for profile 1 and 3 and now i need to have have the classes with profile 1 and 3 set to a new class whats the best way to go about his.
[jQuery] Re: page refreshs on form submit
Yeah, you're right... my example wasn't correct or working I will note, that if you have any sort of javascript error, then the code will never reach the return false and stop the action from happening. meaning it will continue to do a full post to the other page on top of that advice. i'd suggest using Mike Alsup's excellent ajax form plugin http://www.malsup.com/jquery/form/ it does all that plumbing for you automatically.. On Oct 15, 2:10 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, thanks for your response. Do you mean something like this? jQuery.ajax({type:'POST', dataType: 'json', data: this.serialize(), url:'/trainingHelper/user/signUp', success:function(data,textStatus) { signUpResult(data); return false; }, error:function(XMLHttpRequest,textStatus,errorThrown) { return false; } }); With this I get the same behaviour :/ Any other suggestions? Cheers Finn MorningZ schrieb: Yuck Break out the $.ajax code out of the markup, that's just making it tons more difficult to debug $(document).ready(function() { $.ajax({ type:'POST', dataType: 'json', data: this.serialize(), url:'/trainingHelper/user/signUp', success:function(data,textStatus) { signUpResult(data); }, error:function(XMLHttpRequest,textStatus,errorThrown){ } }); return false; }); breaking out out that way makes it easier to see that you are missing return false from both the success and error callbacks (which is needed) On Oct 14, 9:15 pm, Finn Herpich [EMAIL PROTECTED] wrote: Hi folks, I've searched the Internet for a while but couldn't find a reason why my problem occurs. So, I'm working on a jQuery-plugin for Grails and I'm struggling with an AJAX-submit of a form. The attached code, generated by the plugin, leads the browser (Opera 9.6, Firefox 3.0.3 working with jQuery 1.2.6) to show the result on a new page instead of calling the success-function. Maybe I'm just to tired at the moment (3 am here), but I can't see my mistake. Hopefully someone can help me =) Cheers Finn !-- snip -- script src=/trainingHelper/js/jquery/jquery-1.2.6.js type=text/javascript /script /head body form id=signUpForm name=signUpForm action=/trainingHelper/user/signUp method=post onsubmit=$.ajax({type:'POST',dataType: 'json',data: this.serialize(), url:'/trainingHelper/user/signUp',success:function(data,textStatus){signUpResult(data);},error:function(XMLHttpRequest,textStatus,errorThrown){}});return false button type=submitSign Up/button /form /body /html
[jQuery] Re: Odd behavior in IE with select boxes
The javascript has to be in an external file. Both of these are similar to what I had done in other attempts. The odd thing is, in IE I can see the first element of the data has the 'selected' attribute, even though the original HTML sent by the server doesn't have it. The only thing I can figure is either IE is adding it via the underlying call from the $.get(), or jQuery itself is adding it. I did come up with a less than elegant way of handling the problem: $.get(create.do, params, function(data) { var id = $(data).attr('id'); var idSel = '#'+id; // Faster than adding the '#' everywhere it is needed??? if( $('option', idSel).length 0 ) { // Is the option tag present? $('option:not(:first)', idSel).remove(); // Clear out all option tags but the first. $(data).children().each(function() { // For each child, add a new option. $(idSel).append('option value=' + $(this).val() + '' + $ (this).text() + '/option'); }); $(idSel).removeAttr('disabled'); // Enable the field. } } ); I have to call remove() because this code is called on blur, so just Alt-Tab'bing away from the browser added another set of entries. On Oct 15, 8:22 am, JohnieKarr [EMAIL PROTECTED] wrote: I don't do this with client side, I do it with server side and a database, but I think you should try one of the following: 1) label for=type class=dialog firstSelect Type/label select id=type class=dialog first option selected=selected value=--- Type ---/option script type=text/javascript // javascript here to dynamically load content /script /select or 2) label for=type class=dialog firstSelect Type/label select id=type class=dialog first //No option to start with /select javascript: Then make your javascript add the first option. If it is the first in the list then it will be selected by default so there is no need to add selected=selected Hope this helps, Johnie Karr On Oct 14, 1:57 pm, TimW66 [EMAIL PROTECTED] wrote: Anyone? On Oct 13, 6:08 pm, TimW66 [EMAIL PROTECTED] wrote: I'm seeing some odd behavior in IE with my SELECT boxes. In the static HTML, I have the following: label for=type class=dialog firstSelect Type/label select id=type class=dialog first option selected value=--- Type ---/option /select In JavaScript, I have the following: $.get(create.do, params, function(data) { if( $('option', idSel).length 0 ) { var firstOption = $('option', idSel); $(idSel).replaceWith(data); $(idSel).prepend(firstOption); $(idSel).removeAttr('disabled'); } } ); The data coming back is actually a snippet of HTML, like this: select id=typeoption value=1In/optionoption value=2Out/ option/select Note it does not contain a selected attribute. What I want is to merge the data with the static HTML so in essence I would have: label for=type class=dialog firstSelect Type/label select id=type class=dialog first option selected value=--- Type ---/option option value=1In/option option value=2Out/option /select However, in IE, the selected attribute always seems to get set on the In instead. Is this yet another odd thing with IE? Is there something else I should be doing to get the desired results? Thanks in advance.- Hide quoted text - - Show quoted text -
[jQuery] Re: Using jQuery Multiple File Upload Plugin and jQuery Form Plugin together
Yes, it should work. And a sample app would be great! Can you post a link? Sorry, but I can't at this point. It is part of a large Intranet Project. But if it helps, I can build a little sample app... But to be clear: I should work, right? Greetings, Stefan Sturm
[jQuery] Timeout is triggered after calling .abort() on xhr request
Hi! I'v found that aborting ajax request that has timeout set, doesn't stop timeout event from occuring. My code is something like: -- $.ajaxSetup({ timeout:12 }); var req = $.ajax({url:AJAX_URLS.my_url, type: 'GET', dataType: 'json', error: function(data, textStatus, errorThrown){ this_obj.error_handler(data, textStatus, errorThrown); }, success: function(data) { this_obj.success_handler(data); } }); (...) // somewhere else: req.abort(); req = null; -- Even though abort() is called, and req is set to null, timeout still happens and error handler is called. Seems for me to be a kind of bug. I've looked into jQuery code and seems that there is no way to stop timeout from being triggered. Maybe I should handle this in my error handler, but I'm not sure how can I check if timeout has happened for aborted request or for new one that could appear meanwhile? Any ideas?
[jQuery] Re: Problem with jCarousel in Safari.
I'm getting very similar behaviour in Safari and WebKit nightly build with a slideshow widget i'm making with jcarousel. I'm not using google js, just local jquery, and also using the preload plugin to preload my images. (http://plugins.jquery.com/project/Preload) Seems that when the site is tested on localhost (ie, fast loading times) i get the unexpected behaviour - sometimes jcarousel fails to fire, essentially, so the prev/next buttons don't show and no scrolling happens. If i refresh, sometimes i get expected operation, other times it remains broken. FF and even IE work fine -- it's almost as if Safari/WebKit is too fast... Is there some cleverness about the way it works that disagrees with Jcarousel - but only sometimes? S On Oct 14, 10:23 am, Stephen [EMAIL PROTECTED] wrote: Im using google.load to fire up jquery and it seems that its causing jCarousel to behave funny in chrome / safari, firstly if the jcarousel call is before the carousel itself then the next / previous buttons stay disabled then if you move the call after the carousel then it lose position and scroll more than it should compared to firefox etc. im using the simple template as a debug as the page i am using this on has allot of other function which i thought to be the problem originally, here is the code i am using. script language=javascript type=text/javascript src=http://www.google.com/jsapi; /script script type=text/javascript google.load(jquery, 1.2.6); google.setOnLoadCallback(function() { $('#mycarousel').jcarousel({ vertical: true, scroll: 2 });});/script !-- jCarousel library -- script type=text/javascript src=../lib/jquery.jcarousel.pack.js/ script Any ideas how to get safari behave for this?
[jQuery] Re: jqGrid 3.3 version
Hi Tony, Very nicely done - will definitely take a look at it. Is there a plan to add filtering too? For example, I do a search which returns 3000 records (say split over GroupA,GroupB,GroupC etc). Now, if I want to filter on just GroupA (say 500 records) and then return just that info in the grid is that possible? Obviously it would require some sneaky server side Ajax to do too - but it would require filtering drop downs on each column in the grid too? Great work! Thanks, Patrick On Oct 15, 11:13 am, Rey Bango [EMAIL PROTECTED] wrote: Wow Tony! Just WOW! :D Rey... Tony wrote: Hello all, A new version of jqGrid is available. All the new features and bug fixes can be found here http://www.secondpersonplural.ca/jqgriddocs/index.htm Be a sure to visit the demo page for the new features. http://trirand.com/jqgrid/jqgrid.html The jqGrid home page is here http://trirand.com/blog/ Enjoy Tony
[jQuery] superfish z-index issue
Good Morning, Friends. In two days, I'm scheduled to release a very large project that I've been working on, and in the process of error checking I noticed one very large malfunction. In most all browsers, the drop down menus are working perfectly, but it seems in Internet Explorer 7, the drop downs are slipping behind the heading picture. Could someone please have a look and help me figure out what to do to fix it? I figure it's something to do with the z-index. I tried adding a high z-index to the hover elements in the superfish.css and also tried adding a low z-index to my content div, but neither of these solutions has worked. Please helpe! While you're looking, keep in mind that I'm back there tinkering, so if pages are broken, that is why. If any other suggestions can be made on anything with the site, I would greatly appreciate any and all feedback that I could get about it. This is the largest site I've ever developed, and I want it to be SUPER stellar. Thanks so much! http://keytosavannah.dev.emarketsouth.com
[jQuery] tablesorter AJAX resort
I have an table that a user can sort by selecting one or more columns. A user can then do a search on the table which will clear out the tbody and then insert new table rows into the tbody. When this happens the table headings still have the user selections for which columns they want sorted, but the table is NOT sorted because of the ajax call and subsequent update to the tbody. I do this after the ajax update of the table. $(#sortable_table).trigger(update); I know I have to do $(#sortable_table).trigger(sorton,OPTIONS) in order for sorting to work, but I need options to be the current columns selected to be sorted. (This is in config.sortList, but I do not know how to access it.)
[jQuery] document.ready() not firing when the URL has a target
This seems like somebody should have come across this bug before, but my searches haven't turned up anything... So I'm working on a Drupal application, and when I hit a URL on it, for example at http://localhost/node/13, jquery loads up fine, document.ready() fires, and all the jQuery goodness is on the page. Here's a little html snippet: body a name=top/ a href=#topgoto top of page/a if I click on the 'goto top of page' link, everything that's done in the document.ready() function is lost, and there's no more jQuery goodness on my page. Also, if I hit http://localhost/node/13#top, the document.ready() function doesn't fire also. Can somebody point me in the right direction on how to fix this? Thanks!
[jQuery] Loading Mask
Is it possible to add a loading mask to a specific element??
[jQuery] Re: Impossible challenge: when bg image loads
in www.gewton.com, when the background loads, fade in. Just that. The problem is: the background is defined in css. Is not an image tag. And souldn't be. On Oct 12, 3:40 pm, Eric [EMAIL PROTECTED] wrote: I'm gonna go out on a limb and say, no. But you might be able to work with the browser cache by loading the bg.jpg in a hidden div. If that causes the image to be cached by the browser, then you can show the background after a significant delay and it *should* appear instantaneously. Not tested, sorry. If you describe the effect you're trying to obtain, perhaps we can find another solution? On Oct 12, 11:44 am,gjhames[EMAIL PROTECTED] wrote: It's possible to callback a function when a background image of an element, defined in css, finish to loads? Example: div#mydiv { background-image: url(files/bg.jpg); } Thanks.
[jQuery] Re: Timeout is triggered after calling .abort() on xhr request
I think I've managed to do that. While aborting request I do: if (req){ req.abort(); req.is_aborted=true; req=null; } and in error_handler: error_handler:function(xhr, textStatus, errorThrown){ if (textStatus=='timeout' (!xhr || xhr.is_aborted)){ return true; } alert('Sorry, error occured while loading data. Please, try again...'); }
[jQuery] Re: Help combining two small jquery scripts
I've made no progress on this. I only seem to be able to break it in different ways every time I make a change that seems right. Can anybody lend a hand? On Oct 9, 4:17 pm, illtron [EMAIL PROTECTED] wrote: Hi, I posted this a few weeks ago but I didn't get any traction. I've been fumbling with it on and off since then, but I'm not getting anywhere. I figured it couldn't hurt to try again. I think I'm pretty close to getting this to work, but it's not quite there. This is essentially tab functionality, but the initially showing div needs to be randomly chosen. I can either show the random div initially, but then the links don't work. Alternatively, I can make the links work, but then I can't get the random div. The code I'm including shows working links. To (attempt to) show the random div, I'm using thishttp://www.leftrightdesigns.com/library/jquery/randomchild/ The links use this:http://enure.net/dev/hide-all-except-one/ I was trying to take this part, which shows the first child div of #toggleThis: $('#toggleThis div:first').attr('id') And substitute this: $('#toggleThis').randomChild() but it doesn't work. Can anybody weigh in and tell me where I'm going wrong? Thanks! !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleRandom test/title style type=text/css.hide { display: none; }/style script type=text/javascript src=http://code.jquery.com/jquery- latest.min.js/script script type=text/javascript $(document).ready(function() { var hash = window.location.hash; (!hash) ? hideAllExcept('#' + $('#toggleThis div:first').attr('id')) : hideAllExcept(window.location.hash); $('a.toggle').click(function() { var href = $(this).attr('href'); hideAllExcept(href); }); }); function hideAllExcept(el) { $('#toggleThis div').addClass('hide'); $(el).removeClass('hide'); $('a.toggle').removeClass('active'); $('a[href=' + el + ']').addClass('active'); } jQuery.fn.randomChild = function(settings) { return this.each(function(){ var c = $(this).children().length; var r = Math.ceil(Math.random() * c); $(this).children().hide().parent().children(':nth- child(' + r + ')').show(); }); }; /script /head body ul lia href=#lorem class=toggleLorem ipsum/a/ li lia href=#ut class=toggleUt enim ad/a/li lia href=#duis class=toggleDuis aute/a/li lia href=#execepteur class=toggleExcepteur sint/a/li /ul div id=toggleThis div id=loremLorem ipsum dolor sit amet./div div id=utUt enim ad minim veniam./div div id=duisDuis aute irure dolor./div div id=execepteurExcepteur sint occaecat./div /div /body /html
[jQuery] Re: Impossible challenge: when bg image loads
Well, I'm not sure you can do it from CSS, but the following should work: var i = new Image(); i.src = img/background.jpg; // define the image you want to load here $(i).load(function () { $(div/).css({ opacity:0, position:absolute, // use as needed top:0, // use as needed left:0, // use as needed height:i.height, width:i.width, backgroundImage: url( + i.src + ) }).appendTo(body).animate({opacity:1}); }); -Eric On Oct 15, 12:13 pm, gjhames [EMAIL PROTECTED] wrote: inwww.gewton.com, when the background loads, fade in. Just that. The problem is: the background is defined in css. Is not an image tag. And souldn't be. On Oct 12, 3:40 pm, Eric [EMAIL PROTECTED] wrote: I'm gonna go out on a limb and say, no. But you might be able to work with the browser cache by loading the bg.jpg in a hidden div. If that causes the image to be cached by the browser, then you can show the background after a significant delay and it *should* appear instantaneously. Not tested, sorry. If you describe the effect you're trying to obtain, perhaps we can find another solution? On Oct 12, 11:44 am,gjhames[EMAIL PROTECTED] wrote: It's possible to callback a function when a background image of an element, defined in css, finish to loads? Example: div#mydiv { background-image: url(files/bg.jpg); } Thanks.
[jQuery] Re: Ajax load() problems
Don't really know if I have a valid jquery object... how do I verify that? and... sorry but what do you mean by Miroku, are you including this in another page.? ^^;; On 15 Ott, 15:27, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Miroku, are you including this in another page. Do you have a valid jquery object form the call $(#azioni)?
[jQuery] Re: Proper jQuery object creation for chaining
Hey Sliver, It looks like you are expecting jQuery to work like Prototype does...I'm not too familiar with Prototype, but my understanding is that it has functions which assist with the inheritance issues in Javascript. jQuery is more about easily selecting DOM elements and doing stuff with them (find stuff, do stuff) and not as much about OOP and inheritance. You're a bit on the wrong track using the $.fn namespace to define your classes -- that namespace allows for plugin methods, which can then be run in the context of a jQuery object and its collection of DOM nodes. So you might do something like this: $.fn.invert= function() { return this.each(function() { this.style.backgroundColor = '#00'; this.style.color = '#ff'; }); }; Then you could do this: $(div).invert(); // invert all divs on page Your best bet might be to leverage both libraries - Prototype for the OOP/inheritance that you're used to, and jQuery for the DOM manipulation/plugin architecture. Hope that helps a bit. -- Josh - Original Message - From: sliver [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Wednesday, October 15, 2008 9:02 AM Subject: [jQuery] Proper jQuery object creation for chaining Sorry in advance if this is confusing... I am new to jQuery (converting myself from Prototype), and as such I am finding situations where I need to create a new object, which I would have done with a class in Prototype (as such, doesn't make sense for it to appear anywhere except the start of a chain, since it will return a new object). This object will also be used similar to a superclass for other objects as well. I also want the object to be chain-able as well. My first attempt at this was something along these lines: (function($) { function create($opts) { // some code to create an object return obj; } $.fn.firstObj = function($opts) { // Error any chained calls if (this.length) throw SyntaxError(); return create($.extend({}, arguments.callee, $opts)); } $.extend( $.fn.firstObj, { // Some public methods and default properties prop1: 'val1', prop2, 'val2', method1: function() { dosomething(arguments); } } ); })(jQuery); (function($) { function create($opts) { // some code to create an object return obj; } $.fn.secondObj = function($opts) { // Error any chained calls if (this.length) throw SyntaxError(); return $.fn.firstObj($.extend({}, arguments.callee, $opts)); } $.extend( $.fn.secondObj, { // Some public methods and default properties prop1: 'newval1', //overrides $.fn.firstObj.prop1 newprop2, 'val2', newmethod1: function() { dosomethingelse(arguments); } } ); })(jQuery); Problem is, that say I chain either of the returned objects, I lose the public methods for those objects. example: var newObj = $.fn.firstObj({prop1: 'foobar'}); console.log(newObj.method1 + ''); // logs: function() {dosomething(arguments);} newObj.click( function() { console.log(this.method1 + ''); } ); // logs undefined now (I've also tried $(this).method1) What is the proper way of creating a new object in jQuery so that it can properly be chained afterwards?
[jQuery] Re: Impossible challenge: when bg image loads
Well done Eric. Your script tested here and do the job. Nice solution. I'd like to suggest the following: 1-) Set a time for the animation in order to see the image growing on the screen: animate({opacity:1}, 2000); 2-) Leave in place the image defined via CSS and hide it via script. (Unubstrutive script principle). $('body').css('backgroundImage', 'none'); Well, I'm not sure you can do it from CSS, but the following should work: var i = new Image(); i.src = img/background.jpg; // define the image you want to load here $(i).load(function () { $(div/).css({ opacity:0, position:absolute, // use as needed top:0, // use as needed left:0, // use as needed height:i.height, width:i.width, backgroundImage: url( + i.src + ) }).appendTo(body).animate({opacity:1}); }); -Eric On Oct 15, 12:13 pm, gjhames [EMAIL PROTECTED] wrote: inwww.gewton.com, when the background loads, fade in. Just that. The problem is: the background is defined in css. Is not an image tag. And souldn't be. On Oct 12, 3:40 pm, Eric [EMAIL PROTECTED] wrote: I'm gonna go out on a limb and say, no. But you might be able to work with the browser cache by loading the bg.jpg in a hidden div. If that causes the image to be cached by the browser, then you can show the background after a significant delay and it *should* appear instantaneously. Not tested, sorry. If you describe the effect you're trying to obtain, perhaps we can find another solution? On Oct 12, 11:44 am,gjhames[EMAIL PROTECTED] wrote: It's possible to callback a function when a background image of an element, defined in css, finish to loads? Example: div#mydiv { background-image: url(files/bg.jpg); } Thanks.
[jQuery] Re: page refreshs on form submit
Thanks, it was indeed a js-error, but not in the script I called. The magic: data: this.serialize(), should be data: jQuery(this).serialize(), and that's it. Additional I can say that return false is only needed at the end of onsubmit (at least it works with opera nd ff, no ie here to test it, maybe someone can verify that). The working form-tag would be something like this: form id=signUpForm name=signUpForm action=/trainingHelper/user/ signUp method=post onsubmit=jQuery.ajax({type:'POST', dataType: 'json', data: jQuery(this).serialize(), url:'/trainingHelper/user/signUp', success:function(data,textStatus){ alert(data.reason); }, error:function(XMLHttpRequest,textStatus,errorThrown) { } }); return false; Cheers Finn MorningZ schrieb: Yeah, you're right... my example wasn't correct or working I will note, that if you have any sort of javascript error, then the code will never reach the return false and stop the action from happening. meaning it will continue to do a full post to the other page on top of that advice. i'd suggest using Mike Alsup's excellent ajax form plugin http://www.malsup.com/jquery/form/ it does all that plumbing for you automatically.. On Oct 15, 2:10�pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, thanks for your response. Do you mean something like this? jQuery.ajax({type:'POST', � � � � � � � � � dataType: 'json', � � � � � � � � � data: this.serialize(), � � � � � � � � � url:'/trainingHelper/user/signUp', � � � � � � � � � success:function(data,textStatus) { � � � � � � � � � � � �signUpResult(data); � � � � � � � � � � � �return false; � � � � � � � � � }, error:function(XMLHttpRequest,textStatus,errorThrown) { � � � � � � � � � � � � return false; � � � � � � � � � � �} � � � � � � � � � }); With this I get the same behaviour :/ Any other suggestions? Cheers Finn MorningZ schrieb: Yuck Break out the $.ajax code out of the markup, that's just making it tons more difficult to debug $(document).ready(function() { � � $.ajax({ � � � �type:'POST', � � � �dataType: 'json', � � � �data: this.serialize(), � � � �url:'/trainingHelper/user/signUp', � � � �success:function(data,textStatus) { � � � � � �signUpResult(data); � � � �}, � � � �error:function(XMLHttpRequest,textStatus,errorThrown){ � � � �} � � }); � �return false; }); breaking out out that way makes it easier to see that you are missing return false from both the success and error callbacks (which is needed) On Oct 14, 9:15 pm, Finn Herpich [EMAIL PROTECTED] wrote: Hi folks, I've searched the Internet for a while but couldn't find a reason why my problem occurs. So, I'm working on a jQuery-plugin for Grails and I'm struggling with an AJAX-submit of a form. The attached code, generated by the plugin, leads the browser (Opera 9.6, Firefox 3.0.3 working with jQuery 1.2.6) to show the result on a new page instead of calling the success-function. Maybe I'm just to tired at the moment (3 am here), but I can't see my mistake. Hopefully someone can help me =) Cheers Finn !-- snip -- script src=/trainingHelper/js/jquery/jquery-1.2.6.js type=text/javascript /script /head body form id=signUpForm name=signUpForm action=/trainingHelper/user/signUp method=post onsubmit=$.ajax({type:'POST',dataType: 'json',data: this.serialize(), url:'/trainingHelper/user/signUp',success:function(data,textStatus){signUpResult(data);},error:function(XMLHttpRequest,textStatus,errorThrown){}});return false button type=submitSign Up/button /form /body /html
[jQuery] get onclick value
a id=link1 onclick=target=_self href=http://test.com/;link/a alert( $(#link1).attr(onclick) ); expect will be target=_self but the result is function anonymous() { target=_self } any idea how could I only get target=_self back
[jQuery] Re: Ajax load() problems
how do I verify that? quick and dirty way... alert it: if you are using firebug (which you should be!), type this in the console after the page loads: alert($(some selector)) you should get [object Object] as the result if it's something you need to check in code $(some selector).size will be 0 if you got items On Oct 15, 4:27 pm, Miroku [EMAIL PROTECTED] wrote: Don't really know if I have a valid jquery object... how do I verify that? and... sorry but what do you mean by Miroku, are you including this in another page.? ^^;; On 15 Ott, 15:27, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Miroku, are you including this in another page. Do you have a valid jquery object form the call $(#azioni)?
[jQuery] Is there a way to use regex to remove text from a filename
So if I have the following text that prints out on the page file.gif Is there a way in jquery to search for the .gif and remove it from showing up and/or replace it with an icon? please let me know