RE: [jQuery] Re: how to make this really beautifull pattern
I would start by having a look at the functionality of this plug-in: http://malsup.com/jquery/cycle/ Hope this helps... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of hno Sent: Wednesday, February 10, 2010 9:46 AM To: jQuery (English) Subject: [jQuery] Re: how to make this really beautifull pattern hno wrote: HI I have seen this pattern in http://www.altsoftware.com/index.php . there are news menu in the left side . Please visit this site . The news will be change with a really beautiful pattern in every 5 seconds I think it has been written with jquery but I don't know how can I make something like this How can I do so ? thanks so , How can I do so ? I'm waiting ... .
RE: [jQuery] New Forums
But isn't it possible to have our cake and eat it, too in this situation? I'm a member of the CF-Talk (ColdFusion) group and we use both a mailing list and an online system. (I'm hesitant to call the online system a forum because it may not fit the accepted definition of a forum). However, people can go online and use the system for reading the mail and search the archives, or they can just use their email for the same messages, as I do. The main difference between the two, I think, is that House of Fusion runs their own servers and software, whereas, it looks like John is outsourcing that work, which is understandable. But there out to be a solution that provides both forum and email solutions simultaneously. Surely, if someone chooses it, there is an option to send all messages to someone's email address and not just messages from particular threads. Perhaps John, et al, should go over to www.HouseOfFusion.com and see how it's being doing there and discuss this issue with those that control the CF-Talk list, as well as the other lists that are present, such as CF-Newbie. (I've always thought and have suggested that a jQuery-Newbie list would be of great benefit to the jQuery community to separate the beginner questions from the advanced side of things. I just know, that as busy as I am, I won't have time or the desire to visit a forum constantly and check what people are posting. I do read people's posts and even if I don't know the answer, I read responses to learn and help when I can. I have to be in my email constantly for client communications and taking the jQuery list out of my central area of communications (email) is going to kill my participation in the jQuery list, unfortunately. Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Karl Swedberg Sent: Friday, January 22, 2010 9:30 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] New Forums On Jan 21, 2010, at 8:11 PM, brian wrote: FWIW, I'm pretty sure the decision to drop Google Groups is due to John Ressig's account being spoofed by spammers. No, that's not it. Okay, maybe it was one of the last straws, but we've been talking about moving to a forum for a couple years now. If you want to know what factors were involved in the decision, please read http://jquery14.com/day-07/new-jquery-forum/ To be honest, I've never been a fan of forums, either. But after spending some time in the jQuery forum, I'm starting to appreciate its advantages over a plain mailing list. I wish there were a solution out there that is ideal for everyone. Unfortunately, though, every solution comes with its own set of compromises. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
RE: [jQuery] Live function syntax
How about making a variable out of $(#tag).val() and using that for the css variable? $('#family').click(function() { value = $(this).val(); $('#tag').css('font-family', value); }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mircea Sent: Wednesday, January 20, 2010 7:13 AM To: jQuery (English) Subject: [jQuery] Live function syntax Hi, I want to add a live event on a function. My function is: $(#family).click(function(){ $($(#tag).val()).css(font-family, $(#family).val()); }); I've tryed to add it like this: $(#family).live(click, function(){ $($(#tag).val()).css(font-family, $(#family).val()); }); but I get a $(#family).live is not a function FireBug error. How should I use it right? Thank you.
RE: [jQuery] new forums used?
Hi, David... What do you find more appealing about forums than an email list? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of speedpac...@gmail.com Sent: Monday, January 18, 2010 9:50 AM To: jQuery (English) Subject: [jQuery] new forums used? Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
RE: [jQuery] new forums used?
+ 1 Why not have both? (beside possible spammers)... I use the CF-Talk list constantly and it's email- and forum-based. Messages go to both email and the forum. Does the forum have subscribe to this thread capability? What the URL for the forum, anyway? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Octavian Rasnita Sent: Monday, January 18, 2010 11:05 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] new forums used? If the forum is prefered by some users, that's OK, but I don't think it is a good idea to kill the mailing lists, because there are many users that prefer reading a mailing list. The forums will *always* be much less accessible for the blind users for example so it would be much helpful if both ways of communicating will coexist. If some of the users won't like the forum, they would be able to use the mailing lists, while if other users wouldn't want to receive the emails from the mailing list they could just unsubscribe, so the mailing lists won't hurt anyone. Octavian - Original Message - From: speedpac...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, January 18, 2010 4:50 PM Subject: [jQuery] new forums used? Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
RE: [jQuery] new forums used?
it is easier to use a spammed mailing list than a forum. Yes... I would gladly put up with some spam to keep all messages flowing to my inbox, rather than having to use a forum. I can filter the spam as it arrives... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Octavian Rasnita Sent: Monday, January 18, 2010 1:04 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] new forums used? From: Nathan Klatt n8kl...@gmail.com On Mon, Jan 18, 2010 at 10:05 AM, Octavian Rasnita orasn...@gmail.com wrote: If some of the users won't like the forum, they would be able to use the mailing lists, while if other users wouldn't want to receive the emails from the mailing list they could just unsubscribe, so the mailing lists won't hurt anyone. The mailing list is great but what's expected to happen shortly after they stop moderating it, reportedly a significant effort, is the list will be overrun by spammers. Hopefully their fears are unfounded but I'm not holding my breath. Nice knowin' y'all. ;) Well, this is not important at all. If the mailing list subscribers will dislike that spam so much, they will be able to unsubscribe anytime, but maybe some of them will happily accept that spam and also like to continue using the list. I am subscribed to the list with a Gmail address that takes care of most of the spam, and I also have an anti-spam application for other email accounts I use, so it is easier to use a spammed mailing list than a forum. Octavian
RE: [jQuery] Re: Real time AJAX
You have to remove yourself by logging into Google groups. And why don't we include instructions at the bottom of every page on how to remove oneself from the mailing list? There are sufficient questions on how to do this from users that it would seem to warranted. Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Anoop Richards Sent: Sunday, January 17, 2010 10:55 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Re: Real time AJAX REMOVE MOVE ME ASAP. On Sun, Jan 17, 2010 at 9:23 PM, John Arrowwood jarro...@gmail.com wrote: Have you looked at Web Sockets? On Sun, Jan 17, 2010 at 5:17 AM, Izad CM iza...@gmail.com wrote: Hmm, I get what you mean, but how exactly do I update the label text in real-time? One of the better ways that I've discovered is by using long polling technique ( http://blog.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-pol ling/ ). What do you think? On Jan 17, 12:16 am, waseem sabjee waseemsab...@gmail.com wrote: I'm guessing you mean like on google wave. ok. AJAX would mean passing data to a file and returning a response to the user without refreshing the page the user is on. you could say what you want falls sort of under JavaScript animation say you have something like this. textarea class=editableMy test th at can be edited/textarea labelMy test th at can be edited/label the above is you HTML markup. the text area is hidden and the label is shown. when the user clicks the label you would hide the label and show the text area. as well as focus on the textarea. when the users blurs from the text are or presses enter you hide the text are and show the label. however you update the label text. var obj = $(.editable); var lbl = obj.next(); lbl.click(function() { lbl.hide(); obj.show(); obj.focus(); }); obj.blur(function() { lbl.text(obj.text()); obj.hide(); lbl.show()l; }); obj.keypress(function(e) { if(e.which == 13) { lbl.text(obj.text()); obj.hide(); lbl.show()l; } }); On Sat, Jan 16, 2010 at 7:45 AM, Izad CM iza...@gmail.com wrote: Hi guys. I'm a jQuery newbie and naturally I have a question. :) What's the best way to do real-time AJAX calls? I'm developing a web app that has a functionality which is somewhat similar to Google Wave's real-time blip editing feature. Well, you know that thing where we can see the blip being edited by someone else in real-time? That's the thing I'm referring to. What's the best way to do that? One think that I can think of is to do periodic ajax calls using setTimeout() or setInterval(), but I'm not sure if that's the standard way of doing this. Can someone point me in the right direction? Thanks. -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/
RE: [jQuery] Selecting instances separately
I tried your code wrapped in $('document').ready(function() { ... }); and it worked fine... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Alexander Sent: Saturday, January 16, 2010 5:42 AM To: jquery-en@googlegroups.com Subject: [jQuery] Selecting instances separately Hello everyone, I've spent 2 hours with this already and I think I must be dumb or blind since I can't find any hint online. I've got a couple of galleries as a ul in one page ul class=gallery id=galleryid1 liimg ./li liimg ./li ... ... .. /ul ul class=gallery id=galleryid2 liimg ./li liimg ./li ... ... .. /ul etc.etc. For EACH of the galleries - uls SEPARATELY I need to show only 3 lis and hide the rest li. I tried $(.gallery li:gt(2)).hide(); The result is that only first 3 lis are shown and only in first gallery. The rest is hidden. I am looking for something like $(.gallery:each li:gt(2)).hide(); What am I missing ? :) thanks for ideas. Alexander
RE: [jQuery] New forum completely inaccessible
I would vote for using both the email list and forums. I would definitely not use the forum often since it requires opening a browser and going to site, getting to the forum, logging in, etc., etc too much trouble. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Andre Polykanine Sent: Saturday, January 16, 2010 4:56 PM To: JQuery Subject: [jQuery] New forum completely inaccessible Hello everyone, the new jQuery forum at http://forum.jquery.com/ is inaccessible for blind and visually impaired persons. For instance, I can't create a topic because my screen reading program can't find the appropriate edit boxes to post message in. So how could I contact mr. John Resig to ask him what to do with that? Maybe he would help me (he has access to the developers team of this forum engine). Thanks a lot for understanding and suggestions! -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule
[jQuery] Why isn't this working as it does the other 1000 times...
I've been using this over and over on other sites, now this isn't working: I've got this element: div class=windowOverlay/div With this CSS: .windowOverlay { height:100%; position:fixed; overflow:auto; top:0; left:0; background-color:#000; width:100%; z-index:20; opacity:0.5; filter:Alpha(Opacity=50); } And this jQuery to initially hide the overlay div: script type=text/javascript $(document).ready(function() { $('.windowOverlay').hide(); }); /script Yet, the overlay div isn't being hidden.why? Thanks for any feedback! Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
RE: [jQuery] Why isn't this working as it does the other 1000 times...
Nevermind.had an included js file that referenced and overlay div and crossed things up.doh! From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Tuesday, January 05, 2010 8:43 PM To: jquery-en@googlegroups.com Subject: [jQuery] Why isn't this working as it does the other 1000 times... I've been using this over and over on other sites, now this isn't working: I've got this element: div class=windowOverlay/div With this CSS: .windowOverlay { height:100%; position:fixed; overflow:auto; top:0; left:0; background-color:#000; width:100%; z-index:20; opacity:0.5; filter:Alpha(Opacity=50); } And this jQuery to initially hide the overlay div: script type=text/javascript $(document).ready(function() { $('.windowOverlay').hide(); }); /script Yet, the overlay div isn't being hidden.why? Thanks for any feedback! Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
RE: [jQuery] Re: Looking for that plugin that uses scrollTo for product demos...
Whoa! $299 for the Pro version! Unreal! Perhaps the last 9 is a typo, and the price is a more realistic $29. From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jack Killpatrick Sent: Monday, January 04, 2010 7:16 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Re: Looking for that plugin that uses scrollTo for product demos... Maybe this? http://www.slidedeck.com/ - Jack kgosser wrote: bump. any thoughts? On Dec 17 2009, 6:24 pm, kgosser mailto:kgos...@gmail.com kgos...@gmail.com wrote: Hey all, I saw this site a few months ago that was showing off a new plugin which used the scrollTo tool to scroll through one screen shot. I can't seem to find it with a Google search, and I forgot to save it to my Delicious. Yikes! I was wondering if this rings a bell for anyone and if you could direct me to that site? Thanks!
RE: [jQuery] css editor with jquery
Very interesting work, Alfredo! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of orazio.nelson Sent: Saturday, January 02, 2010 9:26 AM To: jQuery (English) Subject: [jQuery] css editor with jquery Hello, i made a proof of concept about a css editor made with jquery. You can see and download it from: http://tt4fn.netsons.org/fonte Is possible to edit almost all the page, for each section there are 34 css customizable options. But now I've a trouble: how can I push the generated css and save it? Tnx Alfredo
RE: [jQuery] Toggle link Needs to Be UNDERNEATH!!!
What happens if you move your jquery source link to the top and leave your toggle code in the bottom? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Erik Sent: Wednesday, December 30, 2009 7:54 AM To: jQuery (English) Subject: [jQuery] Toggle link Needs to Be UNDERNEATH!!! Hi Everyone, My script works great, but I don't know why the link has to be above the toggle content. Is it possible to place the link beneath the DIV I want to hide and show. Right the script only works if the link is above. My intent is to have independent DIV's that toogle... It works, but I need the links below the DIV. Any suggestions? Very grateful. Erik HEREE IS MY CODE: !DOCTYPE html html dir=ltr lang=en-CA body div class=SomeOtherClass Foo a class=SomeClass href=#More Details/a a class=SomeClass href=#More Details/a div class=SomeOtherClass foo /div a class=SomeClass href=#More Details/a div class=SomeOtherClass foo /div /div /body script src=/src/js/jquery/core/jquery-1.3.2.min.js type=text/ javascript/script script type=text/javascript $(document).ready(function() { $('.SomeOtherClass').hide(); $('a.SomeClass').click(function() { $(this).next('div.SomeOtherClass').slideToggle(400); $(this).text($(this).text() == 'More Details' ? 'Close' : 'More Details'); return false; }); }); /script /html
RE: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!!
I took the code below and put it into my editor to format it so I could read more easily. Check your div openings and closings and make sure they match correctly. You've got some problems there that may be throwing off the functionality. Notice where you've got your CONTENT, CONTENT, etc... line in relation to the div above it. Is it supposed to be inside that div? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Erik Sent: Wednesday, December 30, 2009 8:19 AM To: jQuery (English) Subject: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!! Already tried it and I get the same results. This is really funny I don't understand. Allow me to start all over. Here is my script: div id=ws_desc class=box div id=content1 div id=ws_time Session One: 11:00 pm - 12:00 pm /div div id=ws_time2 Session Two: 12:30:pm - 1:30 pm /div div style=width: 354px; height: 1px; background-color: #808080; float: left; margin: 5px 0px 8px 0px /div CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT /div div style=width: 354px; height: 1px; background-color: #808080; float: left; margin: 9px 0px 0px 0px /div div style=width: 300px; float: right; display: block; overflow: hidden div style=float: right; margin-left: 20px; margin: 6px 1px 0px 20px; display: inline a id=slick-toggle class=content8 href=#More Details/a /div div style=float: right; margin-left: 20px; margin: 6px 4px 0px 0px; display: inline a class=content8 href=#Sign Up/a /div /div /div
RE: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!!
Perhaps it's a simple as an extra space in your jquery src link: script src=/src/js/jquery/core/jquery-1.3.2.min.js type=text/ javascript/script Note the extra space above in type=text/ javascript ... When I tried to run your code, I get a $(document).ready(function() { undefined error until I took out that extra space. After I took out the extra space, the code seemed to be working properly... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Erik Sent: Wednesday, December 30, 2009 9:19 AM To: jQuery (English) Subject: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!! Hi Rick, Thanks for your help... I made it really simple. Take a look at this: !DOCTYPE html html dir=ltr lang=en-CA script src=/src/js/jquery/core/jquery-1.3.2.min.js type=text/ javascript/script script type=text/javascript $(document).ready(function() { $('.SomeOtherClass').hide(); $('a.SomeClass').click(function() { $(this).prev('div.SomeOtherClass').slideToggle(400); $(this).text($(this).text() == 'More Details' ? 'Close' : 'More Details'); return false; }); }); /script body div class=SomeOtherClass foo /div diva href=# class=SomeClassMore Details/a/div div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a /body /html
RE: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!!
Did you get my last email about the extra space ? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Erik Sent: Wednesday, December 30, 2009 10:44 AM To: jQuery (English) Subject: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!! Not sure where, but this is it... Still doesn't work. !DOCTYPE html html dir=ltr lang=en-CA script src=/src/js/jquery/core/jquery-1.3.2.min.js type=text/ javascript/script script type=text/javascript $(document).ready(function() { $('[class^=toggle-item]').hide(); $('[class^=link]').click(function() { var $this = $(this); var x = $this.attr(className); $('.toggle-item-' + x).toggle(); return false; }); }); /script body div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a sasasa div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a /body /html
RE: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!!
After removing the space from the jQuery src link, are your div's performing as you want? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Erik Sent: Wednesday, December 30, 2009 10:45 AM To: jQuery (English) Subject: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!! Rick, If you wanted to have independent DIV'S that toggle, how would you do it? Erik On Dec 30, 10:36 am, Rick Faircloth r...@whitestonemedia.com wrote: Perhaps it's a simple as an extra space in your jquery src link: script src=/src/js/jquery/core/jquery-1.3.2.min.js type=text/ javascript/script Note the extra space above in type=text/ javascript ... When I tried to run your code, I get a $(document).ready(function() { undefined error until I took out that extra space. After I took out the extra space, the code seemed to be working properly... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Erik Sent: Wednesday, December 30, 2009 9:19 AM To: jQuery (English) Subject: [jQuery] Re: Toggle link Needs to Be UNDERNEATH!!! Hi Rick, Thanks for your help... I made it really simple. Take a look at this: !DOCTYPE html html dir=ltr lang=en-CA script src=/src/js/jquery/core/jquery-1.3.2.min.js type=text/ javascript/script script type=text/javascript $(document).ready(function() { $('.SomeOtherClass').hide(); $('a.SomeClass').click(function() { $(this).prev('div.SomeOtherClass').slideToggle(400); $(this).text($(this).text() == 'More Details' ? 'Close' : 'More Details'); return false; }); }); /script body div class=SomeOtherClass foo /div diva href=# class=SomeClassMore Details/a/div div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a div class=SomeOtherClass foo /div a href=# class=SomeClassMore Details/a /body /html
RE: [jQuery] jQuery in Action = $15 off today (12/28)
Thanks for the tip, Z... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Monday, December 28, 2009 9:38 AM To: jQuery (English) Subject: [jQuery] jQuery in Action = $15 off today (12/28) Just a heads up to people on this list Manning Publications is running a special of $15 off their books today only... one of those books is the excellent (I'd almost say *required*) read jQuery in Action: http://www.manning.com/bibeault/ Just enter dotd1228 in the Promotional Code box when you check out at manning.com. The $15 discount on any purchase expires at midnight ET (GMT - 5:00) tonight!
RE: [jQuery] jQuery in Action = $15 off today (12/28)
I'm not sure what you mean, Jan... We can order the *new* second edition now, which is not available yet, and get chapters in PDF as they're completed...is that part correct? The part I don't understand is then the brand-new one in late March or April. By the brand-new one, do you mean the completed second edition in print/pdf form? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jan Wilson Sent: Monday, December 28, 2009 11:55 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] jQuery in Action = $15 off today (12/28) MorningZ wrote: Just a heads up to people on this list Manning Publications is running a special of $15 off their books today only... one of those books is the excellent (I'd almost say *required*) read jQuery in Action: http://www.manning.com/bibeault/ Just enter dotd1228 in the Promotional Code box when you check out at manning.com. The $15 discount on any purchase expires at midnight ET (GMT - 5:00) tonight! Thanks MorningZ. Notice that there is a NEW version that is mostly completed. You can order a PDF version of that and get new chapters as they are complete, then the brand-new one in late March or April. Cost for the Second Edition, in PDF or 2 other ebook formats, after the $15 discount, is only $12.50 US! -- Jan
RE: [jQuery] [ask]problem with ajax
Check out the .live() function in jQuery for enabling ajax-added links to your HTML. hth, Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of PUTRA PRIMA Sent: Friday, December 25, 2009 1:01 AM To: jquery-en@googlegroups.com Subject: [jQuery] [ask]problem with ajax hai jquery user ^^ i have a problem with ajax, here is the problem : i have a list of table/data with edit and delete link in file, data.php and i load data.php in my dashboard file named it dashboard.php so this dashboard.php load file data.php result like this : nameaddress control john doe1 anonym delete/edit john doe2 anonym delete/edit john doe3 anonym delete/edit john doe4 anonym delete/edit is it possible that i use the link in data.php to trigger onclick ajax function in dashboard.php ? if it does how ? im really confused with this one T_T i already try this jquery script but it doesn't work $(.delBtn).click(function(){ var del_id = element.attr(id); var info = 'id=' + del_id; $.ajax({ type:POST, url:http://localhost/index.php/superAdmin/delete;, data:info, succes:function(){ $(.helper).html(Data deleted).fadeIn('slow').animate({opacity: 1.0}, 2000).fadeOut('slow'); } }); return false; }); pardon my english ^^ -- Putra Prima A 0410630078 Teknik Elektro Brawijaya 3 ipa 2 smunsa 2004 http://siubie.web.id/
RE: [jQuery] Feliz Navidad
And to you! :o) From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of webmaster-uajms Sent: Thursday, December 24, 2009 10:46 PM To: /Intoxicado-coder:~$; albert.a...@gmail.com; Derek Henninger; etorre...@uajms.edu.bo; j...@xasamail.com; jm.neut...@filzmail.com; jm.neut...@gmail.com; jose luis mujica balderrama; José Rubén Martinez Martínez; joshua001...@hotmail.com; karoly_...@hotmail.com; mavirr...@gmail.com; nandito_970; ormg770; pavel franco; ps...@uajms.edu.bo; raq...@hotmail.com; Rogert Castillo; SALO COLQ.; wk; a...@uajms.edu.bo; a...@mara.scr.entelnet.bo; admiradorsecr...@terra.com; aldha...@gmail.com; alvaro_c...@hotmail.com; ancefel...@gmail.com; antonio suarez; avi...@tablondeanuncios.com; brad.gr...@ictxwavemedia.net; bradley.gr...@gmail.com; c_arani...@yahoo.com; chrisg...@gmail.com; daniel murguia garcia; elhackernet-cfagbxj94857892l-jm.neutron=gmail@elistas.net; eli_ca...@yahoo.es; elpaistarija; e...@colosa.com; ernestogal...@gmail.com; fabian...@hotmail.com; ferminsi...@gmail.com; Frankie Fu; gabycita...@hotmail.com; gib.fal...@gmail.com; gpromocion; hard...@gmail.com; i...@itmaster.com.ar; intlerasmusmun...@ugr.es; jack.ss...@gmail.com; jalil.raq...@gmail.com; jjos.manci...@gmail.com; jm.neutron; josue.manci...@uajms.edu.bo; jquery-en; Karla R. Saavedra G.; lenri...@uajms.edu.bo; linber...@gmail.com; lrami...@gmail.com; Marcos Troncoso; mil2...@hotmail.com; n142...@gmail.com; nodlogin-unsubscr...@googlegroups.com; ormg...@hotmail.com; Pablo E. Fernández A.; pe...@hotmail.com; raq...@uajms.edu.bo; rodrigo053081; ruben hurtado; saul...@hotmail.com; tai_...@taibolivia.com; tazarr...@gmail.com; trementi...@hotmail.es; universi...@ulpgc.es; wavemaker-hispano+unsubscr...@googlegroups.com Subject: [jQuery] Feliz Navidad Feliz Navidad :)
RE: [jQuery] How to get these two slide show to alternate?????
Yes, I found the missing “{“, but thanks for pointing that out. I tried your combination of timings, but it still didn’t work. I tried that combination before, but again, it just causes a change sequence like: start - first slide changes 3 sec later- second slide changes 3 sec later- both slide change together as the 3 and 6 sec timeouts overlap It would seem that both slide shows need a 6 second timeout starting at a different interval or “delay” or 3 seconds apart to get them on a different timing sequence. Maybe I just need initial settings, then after the images start changing I need to change the timing settings. Seems like your idea and all the other timing changes I’ve tried should work, but nothing is giving me the timing I’m after. Thanks, Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Leonardo Balter Sent: Tuesday, December 22, 2009 11:14 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] How to get these two slide show to alternate? first you forgot a { in the first cycle, maybe you already noticed this. Second, trying to help you: why don't you try to use for both slideshows a delay of 3000ms but a timeout of 3 secs in the first and 6 secs in the other one. This make the right magic for you? 2009/12/23 Rick Faircloth r...@whitestonemedia.com Ok…I’ve been banging my head and Google long enough… I’ve got two cycle plug-ins running, trying to get them to display the first image (working), wait 3 seconds (slideshow1), change slideshow1 image, wait 3 seconds, change slideshow2 image, wait 3 seconds change slideshow1 image, etc. Just alternate the two slideshow transitions 3 seconds apart. Why won’t this work? $('.slideshow').cycle( fx: 'fade', speed:1000, delay: 3000, timeout: 3000 }); $('.slideshow2').cycle({ fx: 'fade', speed: 1000, delay: 6000, timeout: 3000 }); Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson -- At, Leo Balter http://leobalter.net Blog técnico: http://blog.leobalter.net
RE: [jQuery] Re: how to access elements with index in for-loop
Ø this is a pretty stupid way to loop through a jQuery object Is it necessary to be insulting to be helpful, Eric? What was your code like when you first began to write JS or jQuery? Always perfect and mature, I’m sure… Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Eric Zhong Sent: Wednesday, December 23, 2009 9:52 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Re: how to access elements with index in for-loop thank you very much, your way is better than mine ! 2009/12/24 Šime Vidas sime.vi...@gmail.com First of all, the wrong code is wrong, look this is your code: $(function(){ var trs = $(#tb tr:not(:first)) for( var i=0; i$trs.length; i++ ) { //$trs[i].find(td:eq(1)).attr(style,color:red); //wrong $trs.get(i).find(td:eq(1)).attr(style,color:red); //wrong } }) 1. you forgot to put semicolons at two places. $(function(){ var trs = $(#tb tr:not(:first)); -- HERE for( var i=0; i$trs.length; i++ ) { //$trs[i].find(td:eq(1)).attr(style,color:red); //wrong $trs.get(i).find(td:eq(1)).attr(style,color:red); //wrong } }); -- HERE 2. You declared a variable named trs but you than use a varibale named $trs which of course doesn't exist because you haven't declared it... $(function(){ var $trs = $(#tb tr:not(:first)); for( var i=0; i$trs.length; i++ ) { //$trs[i].find(td:eq(1)).attr(style,color:red); //wrong $trs.get(i).find(td:eq(1)).attr(style,color:red); //wrong } }); OK, now the code should work, right? Well, no... because what the get(i) method does is it returns the DOM element at index i from the $trs jQuery obect so after you do get (i), you no longer have an jQuery object, and you cannot call the find () method because it is not a property of DOM elements What you could do is encapsulate $trs.get(i) inside $() to get a jQuery object based on the DOM element, so this code does work: $($trs.get(i)).find(td:eq(1)).attr(style, color:red); However, this is a pretty stupid way to loop through a jQuery object... a better way is to use the each() method: $trs.each(function() { $(this).find(td:eq(1)).attr(style, color:blue); });
[jQuery] How to get these two slide show to alternate?????
Ok.I've been banging my head and Google long enough. I've got two cycle plug-ins running, trying to get them to display the first image (working), wait 3 seconds (slideshow1), change slideshow1 image, wait 3 seconds, change slideshow2 image, wait 3 seconds change slideshow1 image, etc. Just alternate the two slideshow transitions 3 seconds apart. Why won't this work? $('.slideshow').cycle( fx: 'fade', speed:1000, delay: 3000, timeout: 3000 }); $('.slideshow2').cycle({ fx: 'fade', speed: 1000, delay: 6000, timeout: 3000 }); Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
RE: [jQuery] Best Service
You' think Mr. globosoft would at least attempt to mask the attempt to market deceitfully by not sending his message using the company name as his name, as well as sending the message from a non-globosoft web address (skhalid.gst). So much for subtlety... (and command of the subtleties of English) -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of globosoft Sent: Friday, December 11, 2009 8:15 AM To: jquery-en@googlegroups.com Subject: [jQuery] Best Service Recently, I had a chance to outsource a project to Globosoft Technologies. They produce high quality work at a reasonable cost. If you are looking for the services like custom Website, CMS, Clone, e-commerce, Network support and SEO you should definitely check Globosoft Technologies first. Here is their website address http://www.globosoft.com -- View this message in context: http://old.nabble.com/Best-Service-tp26744096s27240p26744096.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
RE: [jQuery] Re: AND OR Expression
Expecting it to? Demeaning attitude...real helpful...just make people feel stupid when they request help. Great community building skills, Z... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Thursday, December 10, 2009 2:46 PM To: jQuery (English) Subject: [jQuery] Re: AND OR Expression This isn't working out for me Expecting it to? First post you were comparing: string string... which isn't going to work Follow up post after blowing right over Richard's suggestion, you are comparing string number, which *still* isn't going to work... and this line doesn't make any sense var td4th = parseInt($('td:nth-child(4)', jQuery (this))); as you are parseInt-ing a jQuery object On Dec 10, 2:36 pm, evanbu...@gmail.com evanbu...@gmail.com wrote: This isn't working out for me var td4th = parseInt($('td:nth-child(4)', jQuery (this))); if (td4th.text() 4) || ((td4th.text() 2 (activeCEO == 'Yes')) td4th.addClass(bgColor); If I do this, it works if (td4th.text() 4) td4th.addClass(bgColor); but once I add the rest beyond the || operator it doesn't. On Dec 10, 1:29 pm, Richard D. Worth rdwo...@gmail.com wrote: Convert with parseInt and then compare int to int instead of strings https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global... - Richard On Thu, Dec 10, 2009 at 12:26 PM, evanbu...@gmail.com evanbu...@gmail.comwrote: I having trouble with this line if (td4th.text() '4') || (td4th.text() '2' (activeCEO == 'Yes')) In plain English, I want it to be true if td4th 4 OR td4th 2 AND activeCEo = 'Yes' Thanks $('#tblBoardDirectors tr').each(function() { var relStatus = ($('td:nth-child(5)', $(this)).text()) var activeCEO = ($('td:nth-child(12)', $(this)).text ()); { if (relStatus != 'Retired') { var td4th = $('td:nth-child(4)', $ (this)); if (td4th.text() '4') || (td4th.text() '2' (activeCEO == 'Yes')) td3rd.addClass(bgColor); } } });- Hide quoted text - - Show quoted text -
RE: [jQuery] Re: AND OR Expression
I'm able to help, too, but by the time I read messages there are usually responses... Anyway, you don't have to care what *I* think, but you should care what those you are trying to help think. Attitude is as important as knowledge... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Thursday, December 10, 2009 7:20 PM To: jQuery (English) Subject: [jQuery] Re: AND OR Expression On Dec 10, 2:59 pm, Rick Faircloth r...@whitestonemedia.com wrote: Demeaning attitude...real helpful...just make people feel stupid when they request help. Great community building skills, Z... Not my attempt not like a give a care what you think of me anyways i'm at least able to help on this forum
RE: [jQuery] Re: AND OR Expression
I know...helping can be a pain...but try to be patient and remember back when you didn't understand how jQuery worked. It takes some getting used to the principles and techniques and it's easy to forget what it's like to be a beginner. -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Thursday, December 10, 2009 7:23 PM To: jQuery (English) Subject: [jQuery] Re: AND OR Expression On Dec 10, 2:59 pm, Rick Faircloth r...@whitestonemedia.com wrote: Demeaning attitude...real helpful...just make people feel stupid when they request help. Great community building skills, Z... Not my intent he wasn't comparing apples to apples, and didn't get this... *twice* not like a give a care what you think of me anyways
RE: [jQuery] New site with jquery: Cpluv
The site loaded quickly for me...as quick or quicker than many mainly html sites...talking about ShaperStudio.com... -Original Message- From: jquery-en+ow...@googlegroups.com [mailto:jquery-en+ow...@googlegroups.com] On Behalf Of RobG Sent: Tuesday, December 08, 2009 8:41 AM To: jQuery (English) Subject: Re: [jQuery] New site with jquery: Cpluv Escape-Artist wrote: Which site are you talking about? You can check out more about us: Shaperstudio on http://www.shaperstudio.com our site There's no flash on the cpluv site. Great, but the home page is over 800kb, half of which is script. Good luck. -- Rob
RE: [jQuery] Selector Help
Good, practical formatting for understand the chain From: Michael Geary [mailto:m...@mg.to] Sent: Monday, November 30, 2009 3:28 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Selector Help That's a nice solution. Let's make it easier to follow with some indentation: $('a.filter').click(function() { $(this) .closest('ul') .children() .removeClass('active') .end() .end() .closest('li') .addClass('active'); }); The basic indentation rules we're following here are: * Put each method call on a line by itself, with the . at the beginning of the line. (You can put more than one call on the same line, but only when they don't change the selection.) * Where a method creates the jQuery object or changes its element selection, indent the next line. * Where .end() is called, un-indent that line. You could even go overboard on readability and add the missing .end() calls at the very end: $('a.filter').click(function() { $(this) .closest('ul') .children() .removeClass('active') .end() .end() .closest('li') .addClass('active') .end() .end(); }); Now this looks a lot like the way we indent blocks in JavaScript and other languages. Each .closest() or .children() call is matched up with its own .end() call - as is the initial $(this) - and the indentation indicates the code affected by each of those calls. It's more customary to omit those trailing.end() calls, but with or without them, the indentation is a great help in visualizing the structure of a complex chain. -Mike On Sun, Nov 29, 2009 at 11:39 PM, Michel Belleville michel.bellevi...@gmail.com wrote: Even better : $('a.filter').click(function() { $(this).closest('ul').children().removeClass('active').end().end().closest(' li').addClass('active'); }); Michel Belleville 2009/11/29 Mauricio (Maujor) Samy Silva css.mau...@gmail.com Try this: $('a.filter').click(function(){ $(this).parent().siblings('li').removeClass('active'); $(this).parent('li').addClass('active'); }); Maurício -Mensagem Original- De: Charlie mailto:charlie...@gmail.com Para: jquery-en@googlegroups.com Enviada em: domingo, 29 de novembro de 2009 03:56 Assunto: Re: [jQuery] Selector Help ... Dave Maharaj :: WidePixels.com wrote: How would I go about adding class to the li in this set up? lia href=# class=filterspanall/span/a/li lia href=# class=filterspansome/span/a/li lia href=# class=filterspannone/span/a/li ...
RE: [jQuery] Weird hight issue with show/hide div
I'm not noticing any problem with the sliding/hiding div's id IE 8. All content seems to be showing, down to and including the Next button in each section... -Original Message- From: youradds [mailto:andy.ne...@gmail.com] Sent: Wednesday, November 25, 2009 10:31 AM To: jQuery (English) Subject: [jQuery] Weird hight issue with show/hide div Hi, Got a bit of a weird one here, and not sure how to fix it :/ Basically - I'm using this code: table width=100% tr !-- td align=center class=trip_header width=100% colspan=3a href=javascript: void(0); onclick=jQuery ('#chichen_itza_plus').slideToggle() style=color: white;CHICHEN- ITZA PLUS/a (click for more information)/td-- td align=center class=trip_header width=100% colspan=3a href=javascript: void(0); onclick=jQuery ('#chichen_itza_plus').slideToggle() style=color: white;CHICHEN- ITZA PLUS/a (click for more information)/td /tr /table div id=chichen_itza_plus style=display: none; content is here /div The problem is, as you can see here (click on one of the headers in the main content area) http://www.cancunandrivieramaya.com/new/chichen-itza.htm ...you will notice the main container div doesn't get any higher (so all the content gets cut off after a certain point :/) Anyone got any ideas how I can fix that? TIA! Andy
RE: [jQuery] JQuery and ColdFusion
I just set my session variables in the method I'm calling via jQuery/ajax ...any reason you can think of why that would be a bad idea? Rick -Original Message- From: Dave Evartt [mailto:da...@wehali.com] Sent: Friday, November 20, 2009 4:27 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] JQuery and ColdFusion I use ColdFusion and jQuery all the time with no problems. In fact, I use it with mach-ii. Looks like you're using fusebox? Just a guess. Calling the CFC directly is your problem. When you do that, it bypasses the application.cfm/cfc, which is normally where your session scope is defined. Because you are not going through the same application scope, your session variables won't be there. Better to create an event (in mach-ii terms) that your application engine can understand and just pass it through that way, just like a normal browser call. instead of: /myapp/model/System.cfc?method=authenticatereturnFormat=json Something like index.cfm?fuseaction=authenticate Then let your framework do the rest. -dave evartt Westside wrote: Hi, I'm trying to use ColdFusion and JQuery but I'm having some problems setting/reading session variables. I have a login box that I use jquery to do the ajax work. In my ajax call I have this snippet $(form).ajaxSubmit({ type: 'POST', dataType: 'json', url: '/myapp/model/System.cfc?method=authenticatereturnFormat=json' success: function(resp, textStatus){ if(resp[0]==true){ window.location.href = 'index.cfm?fuseaction=myapp.home'; } }); So within System.cfc there is a method called authenticate, in this method I'm trying to set some session variables (e.g, session.email, session.title) that I can reference once the user is logged in. So if the response from the ajax call returns true, the user gets redirected to this other page using window.location.href shown above. For some reason though, these session variables don't exist (session.email, session.title) when I try to cfdump them out on the 'index.cfm?fuseaction=myapp.home' page. I can dump them in the CFC and see that they are getting set correctly, but outside the CFC, they dont show up. Can anyone please shed some light on why I can't see my session variables? It mus thave something to do with calling the CFC directly or something Thanks
RE: [jQuery] I want join this group
Unless there's some level of joining that I've missed, it seems that you've already joined! Welcome! :o) Rick -Original Message- From: Miccel [mailto:maohong...@gmail.com] Sent: Sunday, November 22, 2009 1:17 AM To: jQuery (English) Subject: [jQuery] I want join this group Hi guys: I would like to join see group. To learn jquery
RE: [jQuery] JQuery and ColdFusion
Did you ever get this worked out? Rick -Original Message- From: Westside [mailto:malik.robin...@gmail.com] Sent: Friday, November 20, 2009 2:29 AM To: jQuery (English) Subject: [jQuery] JQuery and ColdFusion Hi, I'm trying to use ColdFusion and JQuery but I'm having some problems setting/reading session variables. I have a login box that I use jquery to do the ajax work. In my ajax call I have this snippet $(form).ajaxSubmit({ type: 'POST', dataType: 'json', url: '/myapp/model/System.cfc?method=authenticatereturnFormat=json' success: function(resp, textStatus){ if(resp[0]==true){ window.location.href = 'index.cfm?fuseaction=myapp.home'; } }); So within System.cfc there is a method called authenticate, in this method I'm trying to set some session variables (e.g, session.email, session.title) that I can reference once the user is logged in. So if the response from the ajax call returns true, the user gets redirected to this other page using window.location.href shown above. For some reason though, these session variables don't exist (session.email, session.title) when I try to cfdump them out on the 'index.cfm?fuseaction=myapp.home' page. I can dump them in the CFC and see that they are getting set correctly, but outside the CFC, they dont show up. Can anyone please shed some light on why I can't see my session variables? It mus thave something to do with calling the CFC directly or something Thanks
[jQuery] Why would jQuery be undefined in IE, but not FF???
Hi, all. Anyone have any idea about this? First time I've seen it. I using Mike Alsup's cycle plug-in to cross fade three photos. When I first set this up, it worked fine in IE and FF. Now, however, the code only works in FF. IE7 IE8 (at a minimum), return the error messages: 'jQuery' is undefined jquery.cycle.all.2.65.min.js (line 16) Line 16 refers to the first line of code in jquery.cycle.all.2.65.min.js, that starts: ;(function($){var ver=2.65;if($.support==undefined){$.support={opacity:!($.browser.msie)};}f unction log(){if(window.consolewindow.console.log){ etc. The next error message returned by IE is: 'jQuery' is undefined www.holtzmanrealestate.com (line 85) That's referencing this code on index.cfm: script type=text/javascript $(document).ready(function(){ $('#photoMontage').cycle({ fx: 'fade', speed: 2000, timeout: 6000 }); }); /script Again, this code works fine in FF and did in IE when I first wrote the code and created the site. The HTML looks like this for the photos cycling: div id=photoMontage img src=graphics/rotation_01.jpg width=860 height=425 / img src=graphics/rotation_02.jpg width=860 height=425 / img src=graphics/rotation_03.jpg width=860 height=425 / /div In IE, the first photo above shows, then nothing else happens except the error message in the lower right corner of the browser window. Anyone know of anything that could be happening to cause this? Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
RE: [jQuery] Why would jQuery be undefined in IE, but not FF???
Even stranger. I went back to another site where I have the cycle plug-in successfully running on IE and FF to retrieve the versions of jquery core and cycle plug-in that are working. I put those into the site at www.holtzmanrealestate.com and I get the same problem as before. 'jQuery' is undefined (line 10 of jquery.cycle.2.03.pack.js) and 'jQuery' is undefined (line 90 www.holtzmanrealestate.com, which refers to the cycle plug-in script as defined below.) What could possibly be the issue? Rick From: Rick Faircloth [mailto:r...@whitestonemedia.com] Sent: Friday, November 20, 2009 11:36 AM To: jquery-en@googlegroups.com Subject: [jQuery] Why would jQuery be undefined in IE, but not FF??? Hi, all. Anyone have any idea about this? First time I've seen it. I using Mike Alsup's cycle plug-in to cross fade three photos. When I first set this up, it worked fine in IE and FF. Now, however, the code only works in FF. IE7 IE8 (at a minimum), return the error messages: 'jQuery' is undefined jquery.cycle.all.2.65.min.js (line 16) Line 16 refers to the first line of code in jquery.cycle.all.2.65.min.js, that starts: ;(function($){var ver=2.65;if($.support==undefined){$.support={opacity:!($.browser.msie)};}f unction log(){if(window.consolewindow.console.log){ etc. The next error message returned by IE is: 'jQuery' is undefined www.holtzmanrealestate.com (line 85) That's referencing this code on index.cfm: script type=text/javascript $(document).ready(function(){ $('#photoMontage').cycle({ fx: 'fade', speed: 2000, timeout: 6000 }); }); /script Again, this code works fine in FF and did in IE when I first wrote the code and created the site. The HTML looks like this for the photos cycling: div id=photoMontage img src=graphics/rotation_01.jpg width=860 height=425 / img src=graphics/rotation_02.jpg width=860 height=425 / img src=graphics/rotation_03.jpg width=860 height=425 / /div In IE, the first photo above shows, then nothing else happens except the error message in the lower right corner of the browser window. Anyone know of anything that could be happening to cause this? Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
RE: [jQuery] Why would jQuery be undefined in IE, but not FF???
Thanks for the reminder on that one, Michel...I checked that to make sure the load sequence was correct, and it is… script type=text/javascript src=js/jquery-1.2.1.pack.js/script script type=text/javascript src=js/jquery.cycle.2.03.pack.js/script Rick From: Michel Belleville [mailto:michel.bellevi...@gmail.com] Sent: Friday, November 20, 2009 12:29 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Why would jQuery be undefined in IE, but not FF??? Well, the most obvious idea that's coming to my mind would be to check wether your jQuery script loader line comes before the plugin's loading line. If not, the code of the plugin, which requires jQuery, will lack jQuery and fail. Michel Belleville 2009/11/20 Rick Faircloth r...@whitestonemedia.com Even stranger… I went back to another site where I have the cycle plug-in successfully running on IE and FF to retrieve the versions of jquery core and cycle plug-in that are working. I put those into the site at www.holtzmanrealestate.com and I get the same problem as before… ‘jQuery’ is undefined (line 10 of jquery.cycle.2.03.pack.js) and ‘jQuery’ is undefined (line 90 www.holtzmanrealestate.com, which refers to the cycle plug-in script as defined below.) What could possibly be the issue? Rick From: Rick Faircloth [mailto:r...@whitestonemedia.com] Sent: Friday, November 20, 2009 11:36 AM To: jquery-en@googlegroups.com Subject: [jQuery] Why would jQuery be undefined in IE, but not FF??? Hi, all… Anyone have any idea about this? First time I’ve seen it… I using Mike Alsup’s cycle plug-in to cross fade three photos. When I first set this up, it worked fine in IE and FF. Now, however, the code only works in FF. IE7 IE8 (at a minimum), return the error messages: ‘jQuery’ is undefined jquery.cycle.all.2.65.min.js (line 16) Line 16 refers to the first line of code in jquery.cycle.all.2.65.min.js, that starts: ;(function($){var ver=2.65;if($.support==undefined){$.support={opacity:!($.browser.msie)};}function log(){if(window.consolewindow.console.log){ etc… The next error message returned by IE is: ‘jQuery’ is undefined www.holtzmanrealestate.com (line 85) That’s referencing this code on index.cfm: script type=text/javascript $(document).ready(function(){ $('#photoMontage').cycle({ fx: 'fade', speed: 2000, timeout: 6000 }); }); /script Again, this code works fine in FF and did in IE when I first wrote the code and created the site. The HTML looks like this for the photos cycling: div id=photoMontage img src=graphics/rotation_01.jpg width=860 height=425 / img src=graphics/rotation_02.jpg width=860 height=425 / img src=graphics/rotation_03.jpg width=860 height=425 / /div In IE, the first photo above shows, then nothing else happens except the error message in the lower right corner of the browser window. Anyone know of anything that could be happening to cause this? Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
RE: [jQuery] Re: Why would jQuery be undefined in IE, but not FF???
Nice catch, Z! That was the problem. I never even thought to check that. Thanks! My weekend will be much better without that continuing irritation! Rick -Original Message- From: MorningZ [mailto:morni...@gmail.com] Sent: Friday, November 20, 2009 12:31 PM To: jQuery (English) Subject: [jQuery] Re: Why would jQuery be undefined in IE, but not FF??? http://www.holtzmanrealestate.com/ One issue right away seen by doing a view source is that you are not closing the tag: meta name = keywords which happens to be the line right before the jquery (1.2.1 ??) include that would definitely be an issue... one that perhaps Firefox can get by, but apparently not the case with IE
RE: [jQuery] Why would jQuery be undefined in IE, but not FF???
Yep…that was it. Thanks for your input, Michel! Rick From: Michel Belleville [mailto:michel.bellevi...@gmail.com] Sent: Friday, November 20, 2009 12:38 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Why would jQuery be undefined in IE, but not FF??? The missing issue mentionned by MorningZ might be your killer then. Michel Belleville 2009/11/20 Rick Faircloth r...@whitestonemedia.com Thanks for the reminder on that one, Michel...I checked that to make sure the load sequence was correct, and it is… script type=text/javascript src=js/jquery-1.2.1.pack.js/script script type=text/javascript src=js/jquery.cycle.2.03.pack.js/script Rick From: Michel Belleville [mailto:michel.bellevi...@gmail.com] Sent: Friday, November 20, 2009 12:29 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Why would jQuery be undefined in IE, but not FF??? Well, the most obvious idea that's coming to my mind would be to check wether your jQuery script loader line comes before the plugin's loading line. If not, the code of the plugin, which requires jQuery, will lack jQuery and fail. Michel Belleville 2009/11/20 Rick Faircloth r...@whitestonemedia.com Even stranger… I went back to another site where I have the cycle plug-in successfully running on IE and FF to retrieve the versions of jquery core and cycle plug-in that are working. I put those into the site at www.holtzmanrealestate.com and I get the same problem as before… ‘jQuery’ is undefined (line 10 of jquery.cycle.2.03.pack.js) and ‘jQuery’ is undefined (line 90 www.holtzmanrealestate.com, which refers to the cycle plug-in script as defined below.) What could possibly be the issue? Rick From: Rick Faircloth [mailto:r...@whitestonemedia.com] Sent: Friday, November 20, 2009 11:36 AM To: jquery-en@googlegroups.com Subject: [jQuery] Why would jQuery be undefined in IE, but not FF??? Hi, all… Anyone have any idea about this? First time I’ve seen it… I using Mike Alsup’s cycle plug-in to cross fade three photos. When I first set this up, it worked fine in IE and FF. Now, however, the code only works in FF. IE7 IE8 (at a minimum), return the error messages: ‘jQuery’ is undefined jquery.cycle.all.2.65.min.js (line 16) Line 16 refers to the first line of code in jquery.cycle.all.2.65.min.js, that starts: ;(function($){var ver=2.65;if($.support==undefined){$.support={opacity:!($.browser.msie)};}function log(){if(window.consolewindow.console.log){ etc… The next error message returned by IE is: ‘jQuery’ is undefined www.holtzmanrealestate.com (line 85) That’s referencing this code on index.cfm: script type=text/javascript $(document).ready(function(){ $('#photoMontage').cycle({ fx: 'fade', speed: 2000, timeout: 6000 }); }); /script Again, this code works fine in FF and did in IE when I first wrote the code and created the site. The HTML looks like this for the photos cycling: div id=photoMontage img src=graphics/rotation_01.jpg width=860 height=425 / img src=graphics/rotation_02.jpg width=860 height=425 / img src=graphics/rotation_03.jpg width=860 height=425 / /div In IE, the first photo above shows, then nothing else happens except the error message in the lower right corner of the browser window. Anyone know of anything that could be happening to cause this? Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
RE: [jQuery] Re: Why would jQuery be undefined in IE, but not FF???
Really...I didn't realize it would point out syntax errors like that. Good to know... Thanks! Rick -Original Message- From: MorningZ [mailto:morni...@gmail.com] Sent: Friday, November 20, 2009 2:05 PM To: jQuery (English) Subject: [jQuery] Re: Why would jQuery be undefined in IE, but not FF??? I never even thought to check that. Firefox's View Source highlighted that line in red
RE: [jQuery] Konami Code :]
What is this? Something unexpected happens when someone presses designated keys? Easter Eggs? Got an example site? Rick -Original Message- From: Marc Henson [mailto:m...@marchenson.co.uk] Sent: Wednesday, November 18, 2009 5:35 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Konami Code :] Can I just say Brilliant!! I think this will probably make it's way onto my site/s at some point fairly soon!! Thanks On 16 Nov 2009, at 21:03, Ash wrote: Every body loves a little treat in their websites... Well I believe jQuery holds the PERFECT javascript library for doing the Konami Code. A fan of Konami, and having such a cool little hidden feature to your websites, I decided i'd share my code with the world, or at least those people who'd like it.. Just like the PHP logo change, creativity with this little beauty will keep your mind going for ever ;) [code] $(function (){ var press = 0, keys = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; $(document).keydown(function (e){ if (e.which == keys[press]) press++; else press = 0; if (press == keys.length) (function (){ // your little treat... }); }); }); [/code]
RE: [jQuery] Re: Konami Code :]
Thanks! -Original Message- From: MorningZ [mailto:morni...@gmail.com] Sent: Wednesday, November 18, 2009 6:05 PM To: jQuery (English) Subject: [jQuery] Re: Konami Code :] Got an example site? www.facebook.com http://www.google.com/search?q=facebook+konami+code On Nov 18, 5:56 pm, Rick Faircloth r...@whitestonemedia.com wrote: What is this? Something unexpected happens when someone presses designated keys? Easter Eggs? Got an example site? Rick -Original Message- From: Marc Henson [mailto:m...@marchenson.co.uk] Sent: Wednesday, November 18, 2009 5:35 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Konami Code :] Can I just say Brilliant!! I think this will probably make it's way onto my site/s at some point fairly soon!! Thanks On 16 Nov 2009, at 21:03, Ash wrote: Every body loves a little treat in their websites... Well I believe jQuery holds the PERFECT javascript library for doing the Konami Code. A fan of Konami, and having such a cool little hidden feature to your websites, I decided i'd share my code with the world, or at least those people who'd like it.. Just like the PHP logo change, creativity with this little beauty will keep your mind going for ever ;) [code] $(function (){ var press = 0, keys = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; $(document).keydown(function (e){ if (e.which == keys[press]) press++; else press = 0; if (press == keys.length) (function (){ // your little treat... }); }); }); [/code]
RE: [jQuery] build menu on a 'event' location ?
I wasn’t familiar with .offsetParent()…good stuff to know, Michel! Rick From: Michel Belleville [mailto:michel.bellevi...@gmail.com] Sent: Tuesday, November 10, 2009 7:46 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] build menu on a 'event' location ? As for locating the element, you can use .offset() http://docs.jquery.com/CSS/offset to get its coordinates in the document and .position() http://docs.jquery.com/CSS/position for its position relative to the offset parent (which can be accessed by .offsetParent() http://docs.jquery.com/Traversing/offsetParent ). After that it's just a matter of adding an element at the right position relatively to the right parent (through css for example). Michel Belleville 2009/11/10 Michel Belleville michel.bellevi...@gmail.com Yes it probably can, depending on what exactly you'd like to do with it. Could you be a little bit more specific please ? Michel Belleville 2009/11/10 neandr gnea...@googlemail.com I would like to build a popup menu at/above the location of an img .. element. Using $(img).hover could start it, but I'm not sure if JQ has to ability to build a whole popup menu at that place the img .. is located. Any ideas/pointers?
RE: [jQuery] My jQuery Pumpkin... Jealous?
Great, Matt! :o) Rick -Original Message- From: Matt Kruse [mailto:m...@thekrusefamily.com] Sent: Sunday, November 01, 2009 12:01 AM To: jQuery (English) Subject: [jQuery] My jQuery Pumpkin... Jealous? Just a little fun for Halloween 2009. I carved my pumpkin this year as the jQuery logo. I hope some in this group can appreciate it! :) http://mattkruse.com/2009/10/31/jquery-pumpkin/ Matt Kruse
[jQuery] Re: Basic help with selectors
How about using a class instead of ID's? $('a.toggle_effect_button').click(function() { $(this).toggle('blind',500); return false; }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Tuesday, October 27, 2009 12:11 PM To: jQuery (English) Subject: [jQuery] Re: Basic help with selectors $(a[id=^='toggle_effect_button']).click(function() { var id = this.id.replace(toggle_effect_button, ); $(#toggle_effect + id).toggle('blind',500); return false; }); On Oct 27, 12:06 pm, Simon Morris moz...@gmail.com wrote: Hello, I'm new to jQuery and would appreciate some help with Selectors. At the moment I know enough to write some clunky repetitive code that violates the DRY (Don't Repeat Yourself) principle // Toggle Divs $(a#toggle_effect_button).click(function(){ $(#toggle_effect).toggle('blind',500); return false; }); $(a#toggle_effect_button2).click(function(){ $(#toggle_effect2).toggle('blind',500); return false; }); $(a#toggle_effect_button3).click(function(){ $(#toggle_effect3).toggle('blind',500); return false; }); $(a#toggle_effect_button4).click(function(){ $(#toggle_effect4).toggle('blind',500); return false; }); $(a#toggle_effect_button5).click(function(){ $(#toggle_effect5).toggle('blind',500); return false; }); $(a#toggle_effect_button6).click(function(){ $(#toggle_effect6).toggle('blind',500); return false; }); $(a#toggle_effect_button7).click(function(){ $(#toggle_effect7).toggle('blind',500); return false; }); $(a#toggle_effect_button8).click(function(){ $(#toggle_effect8).toggle('blind',500); return false; }); How can I boilerplate code like this? They all refer to similar links that controller the jQueryUI toggle action on DIV containers. If I assign a class to the toggle_effect_button hyperlinks is there a way to locate the correct DIV and toggle it? Or am I already doing this in the most concise way? Thanks for your help ~sm
[jQuery] Re: Basic help with selectors
Gotcha... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Tuesday, October 27, 2009 12:31 PM To: jQuery (English) Subject: [jQuery] Re: Basic help with selectors On Oct 27, 12:16 pm, Rick Faircloth r...@whitestonemedia.com wrote: How about using a class instead of ID's? $('a.toggle_effect_button').click(function() { $(this).toggle('blind',500); return false; }); That would hide the a itself (which is not what his repetitive code does)
[jQuery] Re: take 3 values at time for fade in fade out effect.
What about index_news = index_news + 3 ? hth Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of deep Sent: Monday, October 26, 2009 9:40 AM To: jQuery (English) Subject: [jQuery] Re: take 3 values at time for fade in fade out effect. I have tried something like this index_news +=3; but its not working. can anyone please help me how can i increase my index_new value by 3? On Oct 26, 5:07 pm, deep deeps...@gmail.com wrote: Hello I have following code which i am using for fade in fade out effect. with this code at time only one image is coming. I want at time it should show 3 images. like 1,2,3 then 4,5,6 Here is my code. var index_news = 0; // function initNews() { $('div#feed-ticker') .slideDown('slow', function() { $('div#feed-ticker li').eq( index_news ).fadeIn(); setTimeout( next_news, 5000 ); } ); } function next_news() { $('div#feed-ticker li') .eq( index_news ) .fadeOut(1000, function() { index_news++; if( index_news $('div#feed-ticker li').length-1 ) index_news = 0; $('div#feed-ticker li').eq( index_news ).fadeIn(); setTimeout( next_news, 5000 ); } ); } Can anyone tell me how can i set the value here. May be because of this index_news++; its taking one value at time. but how can i increase it by 3? Thanks in advance.
[jQuery] Re: take 3 values at time for fade in fade out effect.
Can you show me the html and jQuery involved? I'm not sure what your code setup is and how you're trying to manipulate it... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of deep Sent: Monday, October 26, 2009 10:05 AM To: jQuery (English) Subject: [jQuery] Re: take 3 values at time for fade in fade out effect. Thanks for your reply Rick i was trying something similar index_news =0; index_news =+3; but that value is belong to li. so its taking 3 values but showing me one by one. do i need to write definition for ul then. i am new to jquery could you please tell me how can i write that? On Oct 26, 6:48 pm, Rick Faircloth r...@whitestonemedia.com wrote: What about index_news = index_news + 3 ? hth Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of deep Sent: Monday, October 26, 2009 9:40 AM To: jQuery (English) Subject: [jQuery] Re: take 3 values at time for fade in fade out effect. I have tried something like this index_news +=3; but its not working. can anyone please help me how can i increase my index_new value by 3? On Oct 26, 5:07 pm, deep deeps...@gmail.com wrote: Hello I have following code which i am using for fade in fade out effect. with this code at time only one image is coming. I want at time it should show 3 images. like 1,2,3 then 4,5,6 Here is my code. var index_news = 0; // function initNews() { $('div#feed-ticker') .slideDown('slow', function() { $('div#feed-ticker li').eq( index_news ).fadeIn(); setTimeout( next_news, 5000 ); } ); } function next_news() { $('div#feed-ticker li') .eq( index_news ) .fadeOut(1000, function() { index_news++; if( index_news $('div#feed-ticker li').length-1 ) index_news = 0; $('div#feed-ticker li').eq( index_news ).fadeIn(); setTimeout( next_news, 5000 ); } ); } Can anyone tell me how can i set the value here. May be because of this index_news++; its taking one value at time. but how can i increase it by 3? Thanks in advance.
[jQuery] Re: new to this list
Thanks for the plug-ins, Nivanka and welcome to the list! :o) Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Nivanka Sent: Saturday, October 24, 2009 12:46 AM To: jQuery (English) Subject: [jQuery] new to this list Though I am new to this mailing list, I have been a jquery user for some time now. and have published some plugins for the community on the jquery website as well as on my company website http://open.whynotonline.com. I would like to join the jquery community to build more connections with the developers and to seek opportunities to join for significant developments, to help and to enjoy my spare time.. Hope to hear more from you all
[jQuery] Re: loading message shows up after page has loaded
Mike! Crawl back under your rock, you fathead!!! There...how's that? :o) Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike Alsup Sent: Wednesday, October 21, 2009 7:51 PM To: jQuery (English) Subject: [jQuery] Re: loading message shows up after page has loaded Hope that helps. --Karl Bah, this is getting entirely too civil. Snooze... :-)
[jQuery] Re: new autosuggestion plug-in. need comments/feedback
Very responsive, George! I'll definitely take a look at this. I have been wanting to implement autocomplete, but just haven't gotten around to it. Thanks for sharing! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of George Sent: Friday, October 16, 2009 11:11 AM To: jQuery (English) Subject: [jQuery] new autosuggestion plug-in. need comments/feedback I have developed the autosuggestion plug-in. Looks pretty cool (for me). I actually made is like it's done on Facebook. (code is 100% mine). Please take a look and leave me comments/feedback. Only list of names are working as autosuggestion. Other fields on the form are just for example. Also you can have more that one name in the input box. http://www.tersaakov.com/default.htm
[jQuery] Re: new autosuggestion plug-in. need comments/feedback
Thanks for letting me know. I would definitely need ajax support. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of George Sent: Friday, October 16, 2009 3:09 PM To: jQuery (English) Subject: [jQuery] Re: new autosuggestion plug-in. need comments/feedback Well, it does not support AJAX yet. the list comes from Javascript array already in the page. So responsiveness probably has something to do with it. I just like the way how it looks. I would actually call it tokenizer and not the autosuggestion. George. On Oct 16, 2:53 pm, Rick Faircloth r...@whitestonemedia.com wrote: Very responsive, George! I'll definitely take a look at this. I have been wanting to implement autocomplete, but just haven't gotten around to it. Thanks for sharing! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of George Sent: Friday, October 16, 2009 11:11 AM To: jQuery (English) Subject: [jQuery] new autosuggestion plug-in. need comments/feedback I have developed the autosuggestion plug-in. Looks pretty cool (for me). I actually made is like it's done on Facebook. (code is 100% mine). Please take a look and leave me comments/feedback. Only list of names are working as autosuggestion. Other fields on the form are just for example. Also you can have more that one name in the input box. http://www.tersaakov.com/default.htm- Hide quoted text - - Show quoted text -
[jQuery] Re: new autosuggestion plug-in. need comments/feedback
Thanks...let us know on the list when the ajax is done! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of George Sent: Friday, October 16, 2009 3:26 PM To: jQuery (English) Subject: [jQuery] Re: new autosuggestion plug-in. need comments/feedback It's fairly easy to add. I will do that later this week. I just wanted to iron out all visual/appearance bugs. So you can check this link next week. George. On Oct 16, 3:23 pm, Rick Faircloth r...@whitestonemedia.com wrote: Thanks for letting me know. I would definitely need ajax support. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of George Sent: Friday, October 16, 2009 3:09 PM To: jQuery (English) Subject: [jQuery] Re: new autosuggestion plug-in. need comments/feedback Well, it does not support AJAX yet. the list comes from Javascript array already in the page. So responsiveness probably has something to do with it. I just like the way how it looks. I would actually call it tokenizer and not the autosuggestion. George. On Oct 16, 2:53 pm, Rick Faircloth r...@whitestonemedia.com wrote: Very responsive, George! I'll definitely take a look at this. I have been wanting to implement autocomplete, but just haven't gotten around to it. Thanks for sharing! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of George Sent: Friday, October 16, 2009 11:11 AM To: jQuery (English) Subject: [jQuery] new autosuggestion plug-in. need comments/feedback I have developed the autosuggestion plug-in. Looks pretty cool (for me). I actually made is like it's done on Facebook. (code is 100% mine). Please take a look and leave me comments/feedback. Only list of names are working as autosuggestion. Other fields on the form are just for example. Also you can have more that one name in the input box. http://www.tersaakov.com/default.htm-Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: (validate) - How do I validate required fields before form submit
Does Jorn's plug-in still not work on blur? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Josh Sent: Tuesday, October 13, 2009 4:28 PM To: jQuery (English) Subject: [jQuery] Re: (validate) - How do I validate required fields before form submit Alex, I am having the same issue. I have been working on this for hours, and I might have a solution. Hopefully, somebody more knowledge about how the Validate plugin works can speak up and help us both. What I found is that if a field (input, select, etc) has not been validated yet, it calls the optional method, which in turn calls the required method to check if the field is empty. To get around this, I override the optional method to NOT call the required method to check the field length. I'm sure this will cause other issues, but it is a start. I just added the following to my page's javascript file. jQuery.validator.prototype.optional = function(element) { // no longer calling required to check string size // return !$.validator.methods.required.call(this, $.trim (element.value), element) dependency-mismatch; return false; }; If you find a better solution, please let me know. Josh On Oct 9, 9:09 am, Alex alex.ha...@biglotteryfund.org.uk wrote: Hi I am trying to use jquery:validationplugin by Jörn Zaefferer. Which works really well I have to say. The one limitation I am trying to work around is how I can runvalidationforrequiredfields before I submit a form. At the moment I have to submit the form before I see the error messages forrequiredfields I would like to see them prior as the user tabs through the form. Thanks in advance Alex
[jQuery] Re: mouseenter/mouseover timeout
Not getting any flicker in IE8... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of JLHeidecker Sent: Tuesday, October 13, 2009 10:16 PM To: jQuery (English) Subject: [jQuery] mouseenter/mouseover timeout Regarding: Preview images at http://www.templateharvest.com/ Problem: Larger preview images appear at mouseenter event on thumbnail images. If mouse stays still, then moves again, the preview image flickers away and reappears. This jittery effect is not desired. Using mouseover instead of mouseenter produces identical results. Thoughts on how to keep preview image steady, even if mouse pointer sits still over the thumbnail image for a second or two?
[jQuery] Re: My code is not working getting an error missing )
Hi, again, Jessie... Just wanted to let you know I haven't given up on you. It's was about midnight here and time for some sleep. Now I'm up again and I'll be able to take a look at your code later today and see if we can figure things out. I'm not the brightest knot on the jQuery log, but I'm persistent, as I can tell you are. I don't code in PHP, (I use ColdFusion) so I'll have trouble understanding that code, but maybe we can figure out a solution. I'll have to get the pngFix code, too. Can you email me directly and attach the images you're using so I can at least try to get the rollover part working? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jessie Sent: Sunday, October 11, 2009 8:31 AM To: jQuery (English) Subject: [jQuery] Re: My code is not working getting an error missing ) bump* anyone? ;) On Oct 11, 4:43 pm, jessie mi...@optusnet.com.au wrote: Ok so this is what i want to do and can't achieve. I have images that i'd like to rollover here is the markup for both of those instances, 1 is a button and the other is just a hyperlink div class=LPButtona href=index.php?act=viewProdamp;productId= {VAL_PRODUCT_ID} target=_selfimg src=skins/{VAL_SKIN}/ styleImages/buttons/LPmore.png alt=More border=0 //a/div form action={FORM_METHOD} method=post input name=email type=text size=14 maxlength=255 class=textboxMail value={LANG_EMAIL_ADDRESS} onclick=this.value=''; / input type=hidden name=act value=mailList / br / input type=image src=skins/{VAL_SKIN}/styleImages/buttons/joinnow- off.gif alt=Join Now / /form it was all working fine until i applied the png fix. which is jquery.pngFix which i downloaded from herehttp://jquery.andreaseberhard.de/pngFix/ Now i don't know how to fix this i have tried and tried and can't understand what i would need to do to make this all work. I need to use jquery because i want to keep my alt and title tags behind my images. Here is the code i have. which is not working in IE jQuery(function($) { function getLeaf(url) { var splited=url.split('?');// remove all the parameter from url url=splited[0]; return url.substring(url.lastIndexOf(/)+1);// return file name} jQuery.fn.extend({ enter: function() {//plugins creation return this.each(function() { var pth = $(this).find(img)[0]; //alert($(this).children().attr(href)); if($(this).children().attr(href)==getLeaf (document.location.href)){// check that the link url and document url $(pth).attr(src,pth.src.replace(/.png/g, '_active.png')); } else{ $(this).hover(function(){ $(pth).attr(src,pth.src.replace(/.png/ g,'_active.png'));// mouse over Image },function(){ $(pth).attr(src,pth.src.replace(/_active.png/ g,'.png')); }); } }); }}); $(function(){ // Document is ready $(.LPButton,.CatMoreBtn).enter();// call the function}); $('input[type=image]').hover( function () { $(this).attr(src, $(this).attr(src).split('- off').join('-on')); }, function () { $(this).attr(src, $(this).attr(src).split('- on').join('-off')); } );}); jQuery(document).ready(function($){ $('div.LPButton, div.CatMoreBtn, div.CatBuyBtn').pngFix( ); }); Jess On Oct 11, 2:18 pm, jessie mi...@optusnet.com.au wrote: Hi Rick Thank-you very much yes it did get rid of the error. I'm also checking it in firebug and i can't see the other error your getting ie. $(div.LPButton, div.CatMoreBtn, div.CatBuyBtn).pngFix() is not a function Nevertheless the error is gone but now my hovering images don't work! Any reason why this is happening? Thank-you! Jess On Oct 11, 1:15 pm, Rick Faircloth r...@whitestonemedia.com wrote: Well, let's check the bracketing... (I need to format this so I can read it more easily...) jQuery(function($) { function getLeaf(url) { var splited=url.split('?'); url=splited[0]; return url.substring(url.lastIndexOf(/)+1); } jQuery.fn.extend({ enter: function() { return this.each(function() { var pth = $(this).find(img)[0]; if ( $(this).children().attr(href) == getLeaf(document.location.href) ) { $(pth).attr(src,pth.src.replace(/.png/g, '_active.png')); } else { $(this).hover(function() { $(pth).attr(src,pth.src.replace(/.png/g,'_active.png')); },function() { $(pth).attr(src,pth.src.replace(/_active.png/g,'.png')); }); } }); } }); }); jQuery(document
[jQuery] Re: My code is not working getting an error missing )
I'm not sure what the code surrounding your code looks like, but from the code below, it looks like you're missing a ) at the end to close the first ( after .hover ... This should work: $(.button).hover(function() { $(.button).addClass(imgbuttonhover); $(.button).removeClass(imgbutton); }, function() { $(.button).addClass(imgbutton); $(.button).removeClass(imgbuttonhover); } ) The code above, I guess, is surrounded by $(document).ready(function() { ? As in: $(document).ready(function() { $(.button).hover(function() { $(.button).addClass(imgbuttonhover); $(.button).removeClass(imgbutton); }, function() { $(.button).addClass(imgbutton); $(.button).removeClas(imgbuttonhover); } ) }); A few observations about the code above that might be helpful... - consider using an ID for the button instead of a class, say, myButton (Unless for some reason you have multiple buttons you want to rollover at the same time) - then use two classes to swap the img: .button and .buttonHover - also, after the first reference to the button in the second line above, you can refer to the button as this, which according to my understanding will speed up jQuery's reference to the button, keeping it from having to search the DOM for a match by having a ready reference to it by using this The code would then look like this: (A div used for the rollover, would work like this using color instead of an img) HTML: div id=myButton class=button/div CSS: .button { background:#abc; width:50opx; height:50px; } .buttonHover { background:#def; width:50px; height:50px; } JQUERY: $(document).ready(function() { $(#myButton).hover(function() { $(this).removeClass(button); $(this).addClass(buttonHover); }, function () { $(this).removeClass(buttonHover); $(this).addClass(button); } ) }); Of course, to use images for the rollover, just modify the CSS. hth, Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jessie Sent: Saturday, October 10, 2009 9:03 PM To: jQuery (English) Subject: [jQuery] My code is not working getting an error missing ) Hi Everyone I have been given this code to add to my effects.js $(.button).hover(function() { $(.button).addClass(imgbuttonhover); $(.button).removeClass(imgbutton); }, function() { $(.button).addClass(imgbutton); $(.button).removeClass(imgbuttonhover); } But when i add it to my file i get this error via firefox. missing ) after argument list [Break on this error] }\n Can someone please tell me what i'm missing? Thank-you. Jess
[jQuery] Re: My code is not working getting an error missing )
Now, Matt! I just knew by the time I typed up a long-winded reply, someone would come along and give the short, to-the-point, answer. :op :o) Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Matt Quackenbush Sent: Saturday, October 10, 2009 9:32 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: My code is not working getting an error missing ) Add a ) to the end. You have to close the opening hover() function call.
[jQuery] Re: Assigning CSS 'display:block' by jquery not working
According to Firebug, the class, selected is being applied to #home-subnav. However, the CSS ul#sitenav li ul { display:none; }, is taking precedence over the CSS of class, selected. Are you trying to get the sub-menu (#home-subnav) to show up when you hover over Home ? Or what is the effect you're after? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Caisys Sent: Saturday, October 10, 2009 4:02 PM To: jQuery (English) Subject: [jQuery] Assigning CSS 'display:block' by jquery not working Hi, I am trying to display a hidden ul by using the $(id).addClass() method. For some reason the ul stays hidden. Can someone please help me?? Thanks ##mystyle.css ul#sitenav { padding:0; } ul#sitenav li{ display:inline; list-style-type:none; } ul#sitenav li ul{ display:none; } .selected { display:block; } -- ##sitenav.html ul id=sitenav liHomeul id=home-subnav liEvents/li liRestaurants/li liMovies/li liNighlife/li liStage/li /ul /li liVisitingul id=visiting-subnav liBasic Information/li liHotels/li liAttractions/li liEssential/li liTransportation/li liInquiries/li /ul /li liBlog/li liClassifieds/li /ul - ##script in index.html $(document).ready(function() { $(#home-subnav).addClass(selected); });
[jQuery] Re: My code is not working getting an error missing )
and the only error you're getting is that a ) is missing? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jessie Sent: Saturday, October 10, 2009 9:57 PM To: jQuery (English) Subject: [jQuery] Re: My code is not working getting an error missing ) ok thanx guys, except that didn't resolve the problem. I've posted about this before, and still can't get a way around it all. For starters this is what i currently have. jQuery(function($) { function getLeaf(url) { var splited=url.split('?');// remove all the parameter from url url=splited[0]; return url.substring(url.lastIndexOf(/)+1);// return file name } jQuery.fn.extend({ enter: function() {//plugins creation return this.each(function() { var pth = $(this).find(img)[0]; //alert($(this).children().attr(href)); if($(this).children().attr(href)==getLeaf (document.location.href)){// check that the link url and document url $(pth).attr(src,pth.src.replace(/.png/g, '_active.png')); } else{ $(this).hover(function(){ $(pth).attr(src,pth.src.replace(/.png/ g,'_active.png'));// mouse over Image },function(){ $(pth).attr(src,pth.src.replace(/_active.png/ g,'.png')); }); } }); } }); jQuery(document).ready(function($){ $('div.LPButton, div.CatMoreBtn, div.CatBuyBtn').pngFix( ); }); jQuery(document).ready(function($) { $(.button).hover(function() { $(.button).addClass(imgbuttonhover); $(.button).removeClass(imgbutton); }, function() { $(.button).addClass(imgbutton); $(.button).removeClass(imgbuttonhover); } ) and its still spitting out an error. Second of all this is what i want to do. I want any image that is not associated with a form and is only a hyperlink to rollover using a png fix for ie6. I also have forms on my ecommerce site and i need to style these the same way. So my *buttons within a form* need to also rollover using a png fix. I have been at this for the past week and a half and still can't get it to work for all. The code i have above i've put together from other ppl who have helped me with my problem of rolling images and buttons. Hope someone can help me figure this one out once and for all. I'm very very new to jquery and the reason i'd like to use it is because i want to keep my alt and title text behind my image rollovers such as buttons ;-) Jess :) On Oct 11, 11:45 am, Rick Faircloth r...@whitestonemedia.com wrote: Now, Matt! I just knew by the time I typed up a long-winded reply, someone would come along and give the short, to-the-point, answer. :op :o) Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Matt Quackenbush Sent: Saturday, October 10, 2009 9:32 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: My code is not working getting an error missing ) Add a ) to the end. You have to close the opening hover() function call.
[jQuery] Re: My code is not working getting an error missing )
Well, let's check the bracketing... (I need to format this so I can read it more easily...) jQuery(function($) { function getLeaf(url) { var splited=url.split('?'); url=splited[0]; return url.substring(url.lastIndexOf(/)+1); } jQuery.fn.extend({ enter: function() { return this.each(function() { var pth = $(this).find(img)[0]; if ( $(this).children().attr(href) == getLeaf(document.location.href) ) { $(pth).attr(src,pth.src.replace(/.png/g, '_active.png')); } else { $(this).hover(function() { $(pth).attr(src,pth.src.replace(/.png/g,'_active.png')); },function() { $(pth).attr(src,pth.src.replace(/_active.png/g,'.png')); }); } }); } }); }); jQuery(document).ready(function($){ $('div.LPButton, div.CatMoreBtn, div.CatBuyBtn').pngFix(); }); jQuery(document).ready(function($) { $(.button).hover(function() { $(.button).addClass(imgbuttonhover); $(.button).removeClass(imgbutton); }, function() { $(.button).addClass(imgbutton); $(.button).removeClass(imgbuttonhover); } ) }); After working with this in my editor, this is the bracketing that I used to eliminate the error you were getting. Now, however, I get this error in Firebug: $(div.LPButton, div.CatMoreBtn, div.CatBuyBtn).pngFix() is not a function If you copy the code above and put it in your editor, does the bracketing error go away? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jessie Sent: Saturday, October 10, 2009 10:12 PM To: jQuery (English) Subject: [jQuery] Re: My code is not working getting an error missing ) yes the only error now i'm getting is missing } after function body [Break on this error] ) Jess On Oct 11, 12:08 pm, Rick Faircloth r...@whitestonemedia.com wrote: and the only error you're getting is that a ) is missing? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jessie Sent: Saturday, October 10, 2009 9:57 PM To: jQuery (English) Subject: [jQuery] Re: My code is not working getting an error missing ) ok thanx guys, except that didn't resolve the problem. I've posted about this before, and still can't get a way around it all. For starters this is what i currently have. jQuery(function($) { function getLeaf(url) { var splited=url.split('?');// remove all the parameter from url url=splited[0]; return url.substring(url.lastIndexOf(/)+1);// return file name } jQuery.fn.extend({ enter: function() {//plugins creation return this.each(function() { var pth = $(this).find(img)[0]; //alert($(this).children().attr(href)); if($(this).children().attr(href)==getLeaf (document.location.href)){// check that the link url and document url $(pth).attr(src,pth.src.replace(/.png/g, '_active.png')); } else{ $(this).hover(function(){ $(pth).attr(src,pth.src.replace(/.png/ g,'_active.png'));// mouse over Image },function(){ $(pth).attr(src,pth.src.replace(/_active.png/ g,'.png')); }); } }); } }); jQuery(document).ready(function($){ $('div.LPButton, div.CatMoreBtn, div.CatBuyBtn').pngFix( ); }); jQuery(document).ready(function($) { $(.button).hover(function() { $(.button).addClass(imgbuttonhover); $(.button).removeClass(imgbutton); }, function() { $(.button).addClass(imgbutton); $(.button).removeClass(imgbuttonhover); } ) and its still spitting out an error. Second of all this is what i want to do. I want any image that is not associated with a form and is only a hyperlink to rollover using a png fix for ie6. I also have forms on my ecommerce site and i need to style these the same way. So my *buttons within a form* need to also rollover using a png fix. I have been at this for the past week and a half and still can't get it to work for all. The code i have above i've put together from other ppl who have helped me with my problem of rolling images and buttons. Hope someone can help me figure this one out once and for all. I'm very very new to jquery and the reason i'd like to use it is because i want to keep my alt and title text behind my image rollovers such as buttons ;-) Jess :) On Oct 11, 11:45 am, Rick Faircloth r...@whitestonemedia.com wrote: Now, Matt! I just knew by the time I typed up a long-winded reply, someone would come along and give the short, to-the-point, answer. :op :o) Rick From: jquery-en@googlegroups.com [mailto:jquery
[jQuery] Re: Multiple checkbox validation
If you only want to force only one checkbox to be checked at any given time, why not just use radio inputs? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of OOps Sent: Wednesday, October 07, 2009 2:48 AM To: jQuery (English) Subject: [jQuery] Multiple checkbox validation div ul id=sortable li id=1span/span Item1 input type=checkbox id=chk1 value=1 /img src=images/close.gif onclick=ClearSearchDataOnClose1() / /li li id=2span/span Item 2 input type=checkbox id=Checkbox1 value=2 /img src=images/close.gif onclick=ClearSearchDataOnClose2() //li li id=3span/span Item 3input type=checkbox id=Checkbox2 value=3 / img src=images/close.gif onclick=ClearSearchDataOnClose3() //li li id=4span/span Item 4input type=checkbox id=Checkbox3 value=4 / img src=images/close.gif onclick=ClearSearchDataOnClose4() //li li id=5span/span Item 5input type=checkbox id=Checkbox4 value=5 / img src=images/close.gif onclick=ClearSearchDataOnClose5() //li li id=6span/span Item 6input type=checkbox id=Checkbox5 value=6 / img src=images/close.gif onclick=ClearSearchDataOnClose6() //li li id=7span/span Item 7input type=checkbox id=Checkbox6 value=7 / img src=images/close.gif onclick=ClearSearchDataOnClose7() //li /ul /div I need to validate the checkbox given above... My requirement is only one check box is checked at a time on button submit... If more than one check box is checked i want to show the alert message. i want to validate the checkbox using jquery
[jQuery] Re: tooltip - how do i remove an existing tooltip
How about giving the tooltip an identifier, such as a class name, and remove the class once the validation is satisfied. -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of cgipson Sent: Friday, October 02, 2009 1:51 PM To: jQuery (English) Subject: [jQuery] tooltip - how do i remove an existing tooltip Hi, I am using tooltip in my application as a way to notify the user as to what kind of error was found in thier input field. My question is, once that error is resolved and validated correctly, is there a way i can remove the tooltip?
[jQuery] Re: XXX hot sexy banned movie XXX
Yeah, right...we know you just sent out the notice to the wrong group in your contacts list! :o) -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike Alsup Sent: Tuesday, September 29, 2009 7:09 PM To: jQuery (English) Subject: [jQuery] Re: XXX hot sexy banned movie XXX Sigh.. this message was *not* sent by me. And I've just changed my Google password so hopefully it won't happen again. Mike On Sep 30, 6:24 am, mal...@gmail.com mal...@gmail.com wrote: hot sexy banned movie
[jQuery] Re: Every post I make, I get an mail error.
I got some of those, too, not long ago, but haven't had any recently. From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Charlie Griefer Sent: Sunday, September 27, 2009 10:05 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Every post I make, I get an mail error. Karl - This was happening to me a few weeks ago (from a different @localhost address). Rey took care of it. He may have taken care of this one as well. On Sun, Sep 27, 2009 at 5:51 PM, Karl Swedberg k...@englishrules.com wrote: Hmmm. I just searched through all jquery-en members and couldn't find r...@localhost listed. Maybe one of the other admins already deleted it? --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Sep 26, 2009, at 4:38 PM, Scott Haneda wrote: I believe what happens, is there is a bad address in the group, so when you post a message to the list, it is sent out to all subscribers. Final-Recipient: rfc822; r...@localhost Original-Recipient: rfc822;r...@localhost Action: failed Status: 5.3.0 If an email is sent from the group to r...@localhost, it will bounce, and I am guessing it is bouncing back to the group. Some people are getting this backscatter, and others are not. If I were to look at my server logs, I would bet I see it, but I have my server set to block messages that are backscatter, or have bogus recipients and destinations. The list admin needs to find r...@localhost I believe, that would solve it, though I think the issue is technically deeper than that quick fix. -- Scott * If you contact me off list replace talklists@ with scott@ * On Sep 26, 2009, at 8:10 AM, Charlie wrote: I posted this issue into Google Groups help forum yesterday, only response so far group won't recognize your email address which is not true Will see what happens Bertilo Wennergren wrote: evo wrote: Everytime I post to this group through thunderbird, I get a undelivered mail message sent back, everytime. This has only started happening recently and I can't find any info about it anywhere. Just want to know if this is happening to anyone else (as it's only when I post to this group) I get those too. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Prevent jagged text in IE
Much appreciated, Mike! It's been of tremendous benefit! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike Alsup Sent: Saturday, September 26, 2009 9:26 AM To: jQuery (English) Subject: [jQuery] Re: Prevent jagged text in IE On Sep 25, 8:17 pm, Rick Faircloth r...@whitestonemedia.com wrote: I include a reference to a file with this jQuery code in every page to solve that problem, Dave. Best solution I've found so far. I got it from someone, somewhere, but don't remember who. http://www.malsup.com/jquery/fadetest.html
[jQuery] Re: getJSON callback not firing?
Hang in there, Charlie! My head was very bloody from banging it against the wall when I first started down the AJAX road. Now I'm finally getting some work done with it! I almost gave up several times. fwiw, I have always used the $.ajax method without any problems and typically specify the method as post, occasionally venturing to use get when just retrieving data, just to see what might happen.nothing different. (and actually, I recognized that censored expression, having been there! :o) Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Charlie Griefer Sent: Friday, September 25, 2009 2:06 PM To: jQuery (English) Subject: [jQuery] getJSON callback not firing? Hey all: I've read the docs and googled the heck out of this, but not seeing what the problem is. I'm trying to get some data from the server via the getJSON() method. I do see a response in firebug and I've validated the response data at JSONLint.com. However, the callback function simply will not fire. I've tried to simplify things as much as possible. The CFC returning the data is in the same directory as the calling page. The callback function, for now, should only alert a simple text string (which has evolved from hi to foo to a censored version below as the hours have passed). $(document).ready(function() { $('a.players').click(function() { $.getJSON( 'data.cfc?method=getPlayerByIDreturnformat=JSONqueryformat=columnplayerID =' + this.id, function(data) { alert('i %!%##%* hate you'); }); return false; }); }); Here's the response I receive: {ROWCOUNT:1,COLUMNS:[PLAYERID,PLAYERNAME,PLAYERNUMBER,PLAYERPOSIT ION,PLAYERIMG,PLAYERCOLLEGE],DATA:{PlayerID:[1],PlayerName:[Bard en, Ramses],PlayerNumber:[13],PlayerPosition:[WR],PlayerImg:[http:\/\/ assets.giants.com\/uploads\/players\/2FE2D3BDF4FB443D949D1D39B69ADC03.gif], PlayerCollege:[Cal Poly]}} ...which when pasted into JSONLint returns valid. If anyone has any ideas, or if there's any additional information that I can provide, I'm all ears. Thanks! Charlie -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Prevent jagged text in IE
I include a reference to a file with this jQuery code in every page to solve that problem, Dave. Best solution I've found so far. I got it from someone, somewhere, but don't remember who. Rick jQuery.fn.fadeIn = function(speed, callback) { return this.animate({opacity: 'show'}, 750, function() { if (jQuery.browser.msie) this.style.removeAttribute('filter'); if (jQuery.isFunction(callback)) callback(); }); }; jQuery.fn.fadeOut = function(speed, callback) { return this.animate({opacity: 'hide'}, 750, function() { if (jQuery.browser.msie) this.style.removeAttribute('filter'); if (jQuery.isFunction(callback)) callback(); }); }; jQuery.fn.fadeTo = function(speed,to,callback) { return this.animate({opacity: to}, 750, function() { if (to == 1 jQuery.browser.msie) this.style.removeAttribute('filter'); if (jQuery.isFunction(callback)) callback(); }); }; From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Michael Geary Sent: Friday, September 25, 2009 8:07 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Prevent jagged text in IE Make sure the text opacity is 100%. Don't fade it in. IE renders non-antialiased text when opacity is less than 100%. If that's not it, post a link to a test page. -Mike On Fri, Sep 25, 2009 at 4:56 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I have content that loads into a div and in every browser except IE it renders fine. In the wonderful IE it comes in jagged...sometimes it snaps after and looks normal but for the most part its all jagged. The page is a white bg with text rendering into of it. Howcan I fix this so it looks normal? Not using a crazy font, just font-family:Helvetica, Arial, sans-serif; 1em Ideas? Suggestions? Thanks Dave
[jQuery] Re: getJSON callback not firing?
Well...I'm a self-taught, learn-it-as-I-go, programmer. So there are a lot of fundamentals that I probably don't know that would be in the programming 101 class. I was just speaking from the limited experience of changing a post which was being used to just get some info from a query, to a get method to see if the results were the same. They were, so I just commented on the face that the performance of that query with either method was the same. I'll have to study up on get vs post so I can consider myself at least a well-versed, basic programmer. -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Friday, September 25, 2009 11:19 PM To: jQuery (English) Subject: [jQuery] Re: getJSON callback not firing? the method as post, occasionally venturing to use get when just retrieving data, just to see what might happen.nothing different. Wow, really? knowing the difference between GET an POST are pretty fundamental things to know as a programmer http://www.google.com/search?q=get+vs+post It's very important to understand the difference as browsers (mainly IE) have issues with GET in some cases, and all browsers handle caching differently between the two On Sep 25, 6:28 pm, Rick Faircloth r...@whitestonemedia.com wrote: Hang in there, Charlie! My head was very bloody from banging it against the wall when I first started down the AJAX road. Now I'm finally getting some work done with it! I almost gave up several times. fwiw, I have always used the $.ajax method without any problems and typically specify the method as post, occasionally venturing to use get when just retrieving data, just to see what might happen.nothing different. (and actually, I recognized that censored expression, having been there! :o) Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Charlie Griefer Sent: Friday, September 25, 2009 2:06 PM To: jQuery (English) Subject: [jQuery] getJSON callback not firing? Hey all: I've read the docs and googled the heck out of this, but not seeing what the problem is. I'm trying to get some data from the server via the getJSON() method. I do see a response in firebug and I've validated the response data at JSONLint.com. However, the callback function simply will not fire. I've tried to simplify things as much as possible. The CFC returning the data is in the same directory as the calling page. The callback function, for now, should only alert a simple text string (which has evolved from hi to foo to a censored version below as the hours have passed). $(document).ready(function() { $('a.players').click(function() { $.getJSON( 'data.cfc?method=getPlayerByIDreturnformat=JSONqueryformat=columnplayerID =' + this.id, function(data) { alert('i %!%##%* hate you'); }); return false; }); }); Here's the response I receive: {ROWCOUNT:1,COLUMNS:[PLAYERID,PLAYERNAME,PLAYERNUMBER,PLAYERPOSIT ION,PLAYERIMG,PLAYERCOLLEGE],DATA:{PlayerID:[1],PlayerName:[Bard en, Ramses],PlayerNumber:[13],PlayerPosition:[WR],PlayerImg:[http:\/\/ assets.giants.com\/uploads\/players\/2FE2D3BDF4FB443D949D1D39B69ADC03.gif], PlayerCollege:[Cal Poly]}} ...which when pasted into JSONLint returns valid. If anyone has any ideas, or if there's any additional information that I can provide, I'm all ears. Thanks! Charlie -- Charlie Grieferhttp://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Need a callback function to delay processing...
How can I make a callback function that delays the functioning of the last 4 lines below until after the form that's submitted by this code is completely processed. Images are being processed on the server side and that takes a few seconds. Right now my response dialog ( last line) is appearing before the image processing is complete and if the Close button that is a part of that response dialog is clicked, then it interrupts the images processing. So I need for the form to be completely processed before the response dialog appears. Thanks for any help and suggestions! Rick Here's the code: function processAddRentalPropertyForm() { var addNewRentalPropertyForm = $('#addNewRentalPropertyForm'); addNewRentalPropertyForm.submit(function(objEvent) { var jThis = $(this); var strName = (uploader + (new Date()).getTime()); var jFrame = $(iframe name=\ + strName + \ src=\about:blank\ / ); jFrame.css(display, none); jFrame.load(function(objEvent) { var objUploadBody = window.frames[strName].document.getElementsByTagName(body)[0]; var jBody = $(objUploadBody); }); $(body:first).append(jFrame); jThis .attr(action, rentalProperties.cfc?method=mAddRentalPropertyreturnFormat=json ) .attr(method, post) .attr(enctype, multipart/form-data) .attr(encoding, multipart/form-data) .attr(target, strName) }); var dialogPosition = $(window).scrollTop(); var dialogPosition = dialogPosition + 100; $('.rentalPropertyAddResponseDialog').css('top', dialogPosition); $('.rentalPropertyAddResponseDialog').fadeIn(250); } --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Need a callback function to delay processing...
Hi, Mark, and thanks for the reply... put them as something like an event handler on an element and have the form response include some code to trigger the event This is what I'm not sure how to accomplish in my code below. Can you provide a code example? Thanks for any suggestions! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Wednesday, September 23, 2009 10:45 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Need a callback function to delay processing... Put the stuff you want to have happen after the form loads either in the response page from the form submission, or else put them as something like an event handler on an element and have the form response include some code to trigger the event. If you submit stuff with the jQuery AJAX routines, those APIs give you the ability to run functions when the xhr is complete. On Wed, Sep 23, 2009 at 9:37 AM, Rick Faircloth r...@whitestonemedia.com wrote: How can I make a callback function that delays the functioning of the last 4 lines below until after the form thats submitted by this code is completely processed. Images are being processed on the server side and that takes a few seconds. Right now my response dialog ( last line) is appearing before the image processing is complete and if the Close button that is a part of that response dialog is clicked, then it interrupts the images processing. So I need for the form to be completely processed before the response dialog appears. Thanks for any help and suggestions! Rick Heres the code: function processAddRentalPropertyForm() { var addNewRentalPropertyForm = $(#addNewRentalPropertyForm); addNewRentalPropertyForm.submit(function(objEvent) { var jThis = $(this); var strName = (uploader + (new Date()).getTime()); var jFrame = $(iframe name=\ + strName + \ src=\about:blank\ / ); jFrame.css(display, none); jFrame.load(function(objEvent) { var objUploadBody = window.frames[strName].document.getElementsByTagName(body)[0]; var jBody = $(objUploadBody); }); $(body:first).append(jFrame); jThis .attr(action, rentalProperties.cfc?method=mAddRentalPropertyreturnFormat=json ) .attr(method, post) .attr(enctype, multipart/form-data) .attr(encoding, multipart/form-data) .attr(target, strName) }); var dialogPosition = $(window).scrollTop(); var dialogPosition = dialogPosition + 100; $(.rentalPropertyAddResponseDialog).css(top, dialogPosition); $(.rentalPropertyAddResponseDialog).fadeIn(250); } --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Re: Need a callback function to delay processing...
I think there is an event listener right in the code below: By placing additional processes in this block: jFrame.load(function(objEvent) { the processing is delayed until after the files are loaded. I think I'm on the right track. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Wednesday, September 23, 2009 12:07 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Need a callback function to delay processing... Hi, Mark, and thanks for the reply... put them as something like an event handler on an element and have the form response include some code to trigger the event This is what I'm not sure how to accomplish in my code below. Can you provide a code example? Thanks for any suggestions! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Wednesday, September 23, 2009 10:45 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Need a callback function to delay processing... Put the stuff you want to have happen after the form loads either in the response page from the form submission, or else put them as something like an event handler on an element and have the form response include some code to trigger the event. If you submit stuff with the jQuery AJAX routines, those APIs give you the ability to run functions when the xhr is complete. On Wed, Sep 23, 2009 at 9:37 AM, Rick Faircloth r...@whitestonemedia.com wrote: How can I make a callback function that delays the functioning of the last 4 lines below until after the form thats submitted by this code is completely processed. Images are being processed on the server side and that takes a few seconds. Right now my response dialog ( last line) is appearing before the image processing is complete and if the Close button that is a part of that response dialog is clicked, then it interrupts the images processing. So I need for the form to be completely processed before the response dialog appears. Thanks for any help and suggestions! Rick Heres the code: function processAddRentalPropertyForm() { var addNewRentalPropertyForm = $(#addNewRentalPropertyForm); addNewRentalPropertyForm.submit(function(objEvent) { var jThis = $(this); var strName = (uploader + (new Date()).getTime()); var jFrame = $(iframe name=\ + strName + \ src=\about:blank\ / ); jFrame.css(display, none); jFrame.load(function(objEvent) { var objUploadBody = window.frames[strName].document.getElementsByTagName(body)[0]; var jBody = $(objUploadBody); }); $(body:first).append(jFrame); jThis .attr(action, rentalProperties.cfc?method=mAddRentalPropertyreturnFormat=json ) .attr(method, post) .attr(enctype, multipart/form-data) .attr(encoding, multipart/form-data) .attr(target, strName) }); var dialogPosition = $(window).scrollTop(); var dialogPosition = dialogPosition + 100; $(.rentalPropertyAddResponseDialog).css(top, dialogPosition); $(.rentalPropertyAddResponseDialog).fadeIn(250); } --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Can't seem to figure out this simple toggle situation...
I've got this HTML: tr id=propertyID-#propertyID# td style=width:20px; padding:10px 6px 0 0; cfif qCheckFeatured.recordCount eq 0 img src=../../site_images/icon_accept.gif style=visibility:hidden; cfelse img src=../../site_images/icon_accept.gif style=visibility:visible; /cfif /td td style=width:480px; padding:10px 0 0 0; a href= onClick=return false; class=featured#streetNumber# #streetName#, #city#, #state#/a /td /tr The icon_accept.gif at the beginning of each row in the table is either hidden or visible. I want to be able toggle the visibility by clicking on the address, which has the class of featured. I've tried this jQuery (and many other variations). function selectFeaturedProperties() { $('.featured').live('click', function() { var img = $(this).parent().previous().find('img'); if( img.css('visiblity', 'visible') ) { img.fadeOut(250); } else { img.fadeIn(250); } }); } Something's obviously wrong, but I don't know which part. Ideas? (Seems like this should be simple, but I'm just not getting it.) Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Can't seem to figure out this simple toggle situation...
Thanks Anantha...that worked well. I don't understand this line, however: if ( test.find('img:visible').attr('src') ) It's the .attr('src'), in particular, that I don't understand. What does that part do? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of morris...@ingenious.org Sent: Wednesday, September 23, 2009 11:12 PM To: jQuery (English) Subject: [jQuery] Re: Can't seem to figure out this simple toggle situation... Rick, lets assume that you are calling your function on document read ... and your select statement is getting the correct image ... with this line ... (if its not getting called and your not getting the correct image then this needs to be fixed first) var img = $(this).parent().previous().find('img'); this is the main line that is wrong ... if( img.css('visiblity', 'visible') ) as it is actually setting the style to visible ... let try this assuming you are calling this function and selecting the correct image. function selectFeaturedProperties() { $('.featured').live('click', function() { /* select the td wrapping the image */ var test = $(this).parent().previous(); /* select the img thats visible and grab the src of the image, i would normally do .html() to see if the object had something in it to return true but this should work since the img tag would not have that */ if( test.find('img:visible').attr('src') ){ /* grab the visible image and fade out */ test.find('img').fadeOut(250); } else { /* grab the hidden image and fade in */ test.find('img').fadeIn(250); } }); } On Sep 23, 9:46 pm, Rick Faircloth r...@whitestonemedia.com wrote: I've got this HTML: tr id=propertyID-#propertyID# td style=width:20px; padding:10px 6px 0 0; cfif qCheckFeatured.recordCount eq 0 img src=../../site_images/icon_accept.gif style=visibility:hidden; cfelse img src=../../site_images/icon_accept.gif style=visibility:visible; /cfif /td td style=width:480px; padding:10px 0 0 0; a href= onClick=return false; class=featured#streetNumber# #streetName#, #city#, #state#/a /td /tr The icon_accept.gif at the beginning of each row in the table is either hidden or visible. I want to be able toggle the visibility by clicking on the address, which has the class of featured. I've tried this jQuery (and many other variations). function selectFeaturedProperties() { $('.featured').live('click', function() { var img = $(this).parent().previous().find('img'); if ( img.css('visiblity', 'visible') ) { img.fadeOut(250); } else { img.fadeIn(250); } }); } Something's obviously wrong, but I don't know which part. Ideas? (Seems like this should be simple, but I'm just not getting it.) Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: [Attrib external not working...]
Now why would target=_blank be deprecated without a suitable HTML substitute, requiring coders to have to resort to js for the functionality? Odd... Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Liam Potter Sent: Tuesday, September 22, 2009 10:20 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: [Attrib external not working...] Except that target=_blank is deprecated in xhtml 1.1, so to make sure you're markup validates, you need to use javascript to make links open in a new window/tab. One way to do it is like this. $(a[rel='external']).click(function(){ this.target = _blank; }); Liam Byrne wrote: Maybe because 'rel=external' doesn't have any meaning or functionality ? The proper syntax with functionality would be a target=_blank href=http://www.google.com;google/a but that's just HTML; it has nothing to do with jQuery Liam Lord Gustavo Miguel Angel wrote: Hi, Why this code not working? a rel=external href=www.google.comgoogle/a url www.google.com http://www.google.com open in same windows. Thank´s No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.112/2388 - Release Date: 09/22/09 05:51:00
[jQuery] Re: saving values from a multi select list.
I don't have the original message in my email any longer. Can you post the code involved? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of shaded Sent: Tuesday, September 15, 2009 9:42 AM To: jQuery (English) Subject: [jQuery] Re: saving values from a multi select list. Still stuck on this.no one has even a suggestion as to what maybe wrong?
[jQuery] Re: Twitter for support?
+100 -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ashley Sent: Monday, September 14, 2009 12:21 PM To: jQuery (English) Subject: [jQuery] Re: Twitter for support? Twitter is highly ephemeral and I don't think it's a good idea to split support out into a series of venues. I see this same thing in other software groups with IRC instead of Twitter and I think it's *much* better to use something like Google groups for discussion or a permanent page on a jQuery (or your own) site for anything which is boiled down to an answer. Every time I see that was answered on IRC or come ask us on IRC I cringe because I know that valuable information was just lost to the community (searching irc logs for 100 different channels to find an answer is unreasonable) while it was disseminated to a single user or a clique. Any time something like this comes up don't consider how you're helping an individual but how your work could be leveraged to help everyone involved for the foreseeable future and with the least amount of repetition. To me Twitter is right out for this. (By the way, love your plugins and really appreciate how much support you give on them; very impressive). -Ashley On Sep 13, 11:53 am, Mike Alsup mal...@gmail.com wrote: Over the past few months I've been fielding an increasing number of support requests via Twitter (for Cycle, BlockUI, and Form plugins). In some ways it's a nice way to respond to simple questions but obviously it's not well-suited for more in-depth questions and responses. I generally direct people to this Google Group for anything non-trivial but I'm wondering what others think about leveraging Twitter for simple QA. Thoughts? Mike http://twitter.com/malsup
[jQuery] Re: Hide/Show based on radio button selected
Just off the top of my head, but may work... $(document).ready(function() { $('#offices_checkboxes').hide(); $('input:radio[name=radioName]:checked').click(function() { $('#offices_checkboxes').show(); }); $('input:radio[name=radioName]:not(:checked)'.click(function() { $('#offices_checkboxes').hide(); }); }); This code makes use of the name of the radio button group, as well. hth, Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of mtuller Sent: Monday, September 14, 2009 11:14 AM To: jQuery (English) Subject: [jQuery] Hide/Show based on radio button selected I am trying to create a script that will display content based on if a radio button is selected, and if the other is selected would hide the content. Now, each of these radio buttons are part of a radio group, so their names are the same. Most examples show input:radio [...@name=item] Since I have 2 items that have the same name, I can't use name, so I thought I would try id or value. It isn't working. If I add only the show, whenever you select either radio button, it shows, and if I add the hide code, it doesn't work at all. Here is what I have right now. $(document).ready(function(){ $('#offices_checkboxes').hide(); $(input:rad...@value=1]).click(function() { $(#offices_checkboxes).show(); }); $(input:rad...@value=0]).click(function() { $(#offices_checkboxes).hide(); }); }); Anybody have an idea of how I could get this to work?
[jQuery] Re: Does anyone see any problem with this code that might cause IE not to work with it?
I just wrote that piece of code to see if it would work like I was hoping it would to get and create a comma-delimited list of the same-named checkbox values. I'll move it out when I clean up the code. No ideas about the rest of the code being a problem for IE? I think I'm just going to have to break down the jquery and coldfusion to a very simple version with only one or two values to see if somehow it's the values or processing of them that's giving IE fits. Thanks for looking. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Sunday, September 13, 2009 5:16 PM To: jQuery (English) Subject: [jQuery] Re: Does anyone see any problem with this code that might cause IE not to work with it? i don't know about the rest of the code, but are you aware you are redefining and reattaching the plugin code getCheckboxVals on *each and every .live() call* ? On Sep 13, 4:08 pm, Rick Faircloth r...@whitestonemedia.com wrote: There are more pieces to the code puzzle than this section, but for some reason , once I click the #addButton referenced at the start of the code, IE will go all the way down through the code, firing the alerts properly, until it gets to the $.ajax section. After it gets to that point in the code, nothing happens. Now I know there could be other code involved that could be a problem, but I just wanted to focus on this section for now and not ask too much of any reviewer. FF processes everything correctly; all alerts, ajax function, including inserting data into the database. But IE just hits a wall at $.ajax. I've been over the code, modified the code, done everything I can think of to get this to work, but can't figure out what could be the problem. Any ideas, anyone? Anything at all? Thanks for taking the time to look over this. Rick $(document).ready(function() { $('#addButton').live('click', function() { // --- [ to get multiple carStorage checkbox values ] --- // alert('addButton clicked'); jQuery.fn.getCheckboxVals = function() { alert('running getCheckboxVals'); var checkboxVals = []; var i = 0; this.each(function(i) { checkboxVals[i] = $(this).val(); }); var checkboxVals = checkboxVals.join(', '); return checkboxVals; } values = { dsn: 'mydsn', streetNumber: $('#streetNumber').val(), streetName: $('#streetName').val(), city: $('#city').val(), state: $('#state').val(), zipCode: $('#zipCode').val(), propertyType: $('#propertyType, option:selected').val(), county: $('#county').val(), subdivision: $('#subdivision').val(), totalRooms: $('#totalRooms').val(), bedrooms: $('#bedrooms').val(), fullBaths: $('#fullBaths').val(), halfBaths: $('#halfBaths').val(), rent: $('#rent').val(), yearBuilt: $('#yearBuilt').val(), securityDeposit: $('#securityDeposit').val(), leaseTerm: $('#leaseTerm').val(), availabilityDate: $('#availabilityDate').val(), petsAllowed: $('#petsAllowed:checked').val(), petDeposit: $('#petDeposit').val(), livingRoom: $('#livingRoom:checked').val(), diningRoom: $('#diningRoom:checked').val(), familyRoom: $('#familyRoom:checked').val(), fireplace: $('#fireplace:checked').val(), appliances: $('#appliances').val(), waterIncluded: $('#waterIncluded:checked').val(), fence: $('#fence:checked').val(), fenceDescription: $('input:checkbox[name=fenceDescription]:checked').getCheckboxVals(), carStorage: $('input:checkbox[name=carStorage]:checked').getCheckboxVals(), utilities: $('#utilities, option:selected').val(), alarmSystem: $('#alarmSystem:checked').val(), washerDryerIncluded: $('#washerDryerIncluded:checked').val(), washerDryerHookups: $('#washerDryerHookups:checked').val
[jQuery] Re: event coordination problem
if you put the focus in the textbox (#id1) then click the button (#id2) both events get fired Jim... Preventing this occurrence is what I was talking about. What I do is keep the submit button disabled until all required fields have been validated on blur. That way you can't have a field that hasn't been validated and have the submit button fire, too. The user has to blur out of the field to achieve validation and enabling of the submit button. Am I misunderstanding? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mr Speaker Sent: Sunday, September 13, 2009 10:07 PM To: jQuery (English) Subject: [jQuery] Re: event coordination problem I pasted your code into a new HTML doc and it ran as expected: if you put the focus in the textbox (#id1) then click the button (#id2) both events get fired (blur event fires first, click event fires second). Is there anything else in your page? Are you getting any JS errors? On Sep 13, 4:27 am, jhm jmay...@gmail.com wrote: Not sure how this helps, and in fact I'm pretty much already doing that. The problem is that if the focus is in the field, when the button is clicked I get the blur event only and not the click event on the button. If you try the code in the OP, you'll see this happening. Remember to click into the text box before clicking on the button. I need the click event for sure. I could live without the blur event in this situation, but I'd also like to understand the dynamics of what is happening for the future. Jim On Sep 12, 10:39 am, Rick Faircloth r...@whitestonemedia.com wrote: How about setting the field to invalid to start with and force the user to blur the field for a validation routine to declare it valid. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jhm Sent: Saturday, September 12, 2009 1:04 PM To: jQuery (English) Subject: [jQuery] event coordination problem Hi- In a form, I'm trying to validate a field when they move off it. But this causes a problem when the field has the focus and they click a button to process the form. In this case, only the field's blur event (or change event) gets fired and nothing for the button click event. Seems like a reasonable thing to want to do, so I figure I'm missing something in they way I've coded this. Any suggestions? Here's the very simple code that exhibits the behavior: head script type=text/javascript src=./js/jquery.js/script script type=text/javascript $(document).ready( function() { $('#id1').blur( function() { alert('blur in id1'); }); $('#id2').click( function() { alert('click in id2'); }); }); /script /head body /body input type=text value=Sample Text name=id1 id=id1 / input type=button name=Finish value=Finish id=id2 / /html
[jQuery] Why would this code cause this error in IE?
Code: $(document).ready(function() { streetNumber = 'valid'; streetName = 'valid'; city = 'valid'; state= 'valid'; bedrooms = 'valid'; fullBaths= 'valid'; rent = 'valid'; securityDeposit = 'valid'; }); Error: Object doesn't support this property or method This doesn't cause an error in FF. Thoughts? Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Why would this code cause this error in IE?
That did it…seems to satisfy IE that way, too. Thanks, Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Dhruva Sagar Sent: Saturday, September 12, 2009 6:06 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? You should use the keyword 'var' before each variable. Thanks Regards, Dhruva Sagar. Charles de Gaulle http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html - The better I get to know men, the more I find myself loving dogs. On Sat, Sep 12, 2009 at 3:33 PM, Rick Faircloth r...@whitestonemedia.com wrote: Code: $(document).ready(function() { streetNumber = 'valid'; streetName = 'valid'; city = 'valid'; state= 'valid'; bedrooms = 'valid'; fullBaths= 'valid'; rent = 'valid'; securityDeposit = 'valid'; });
[jQuery] Re: Why would this code cause this error in IE?
Hmmm...that could explain the sudden error I just now received running that code that city is not defined and state is not defined, etc., when validation tries to run. I guess using var causes the variable to be local within that piece of code instead of applicable there and in other pieces of code that references those variables? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Saturday, September 12, 2009 9:12 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Well, putting var before the variables will probably make IE happy, but it also makes the function useless. On Sat, Sep 12, 2009 at 7:12 AM, Rick Faircloth r...@whitestonemedia.com wrote: That did it seems to satisfy IE that way, too. Thanks, Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Dhruva Sagar Sent: Saturday, September 12, 2009 6:06 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? You should use the keyword 'var' before each variable. Thanks Regards, Dhruva Sagar. Charles de Gaulle - The better I get to know men, the more I find myself loving dogs. On Sat, Sep 12, 2009 at 3:33 PM, Rick Faircloth r...@whitestonemedia.com wrote: Code: $(document).ready(function() { streetNumber = 'valid'; streetName = 'valid'; city = 'valid'; state = 'valid'; bedrooms = 'valid'; fullBaths = 'valid'; rent = 'valid'; securityDeposit = 'valid'; }); -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Re: Why would this code cause this error in IE?
But...now IE throws an error again: Object doesn't support this property or method What's the solution? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Saturday, September 12, 2009 11:48 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Hmmm...that could explain the sudden error I just now received running that code that city is not defined and state is not defined, etc., when validation tries to run. I guess using var causes the variable to be local within that piece of code instead of applicable there and in other pieces of code that references those variables? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Saturday, September 12, 2009 9:12 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Well, putting var before the variables will probably make IE happy, but it also makes the function useless. On Sat, Sep 12, 2009 at 7:12 AM, Rick Faircloth r...@whitestonemedia.com wrote: That did it seems to satisfy IE that way, too. Thanks, Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Dhruva Sagar Sent: Saturday, September 12, 2009 6:06 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? You should use the keyword 'var' before each variable. Thanks Regards, Dhruva Sagar. Charles de Gaulle - The better I get to know men, the more I find myself loving dogs. On Sat, Sep 12, 2009 at 3:33 PM, Rick Faircloth r...@whitestonemedia.com wrote: Code: $(document).ready(function() { streetNumber = 'valid'; streetName = 'valid'; city = 'valid'; state = 'valid'; bedrooms = 'valid'; fullBaths = 'valid'; rent = 'valid'; securityDeposit = 'valid'; }); -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Re: Why would this code cause this error in IE?
Well...they're for form validation purposes. Those variables are the form fields that I am validating. I initially set them to valid (for updates), then as a user works with the form fields, upon blur of each field, I run a function which scans all fields that are being validated to see if they are all still valid. If they are, then the submit button is enabled. If any of the fields are invalid, the submit button remains or becomes disabled. Here's the code that does that: function ValidateForm() { if ( streetNumber == 'valid' streetName== 'valid' city == 'valid' state == 'valid' bedrooms == 'valid' fullBaths == 'valid' rent == 'valid' securityDeposit == 'valid') { $('#addButton').removeAttr('disabled'); $('.validationError:visible').fadeOut(250); } else { $('#addButton').attr('disabled', 'disabled'); $('.validationError').fadeIn(250); }; }; And, for an example of how an individual field is being validated: $('#streetNumber').livequery('blur', function() { if (this.value.length == 0) { $('#' + this.id + '_requiredError').fadeIn(250); $(this).css('backgroundColor', '#ffeaea'); streetNumber = 'invalid'; } else { $('#' + this.id + '_requiredError').fadeOut(250); $(this).css('backgroundColor', '#fff'); streetNumber = 'valid'; }; ValidateForm(); }); This works well, except for IE not liking the variable without var... And, for my edification, why are global variables frowned upon? Suggestions? Thanks, Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Saturday, September 12, 2009 11:53 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Yes, that's correct. It would probably help to know what it is that those (apparently global) variables are, or rather where it is that they come from (and, from curiosity, why the page would set things up that way - global variables are as ugly in web pages as they are in any other programming domain). On Sat, Sep 12, 2009 at 10:47 AM, Rick Faircloth r...@whitestonemedia.com wrote: Hmmm...that could explain the sudden error I just now received running that code that city is not defined and state is not defined, etc., when validation tries to run. I guess using var causes the variable to be local within that piece of code instead of applicable there and in other pieces of code that references those variables? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Saturday, September 12, 2009 9:12 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Well, putting var before the variables will probably make IE happy, but it also makes the function useless. On Sat, Sep 12, 2009 at 7:12 AM, Rick Faircloth r...@whitestonemedia.com wrote: That did it seems to satisfy IE that way, too. Thanks, Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Dhruva Sagar Sent: Saturday, September 12, 2009 6:06 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? You should use the keyword 'var' before each variable. Thanks Regards, Dhruva Sagar. Charles de Gaulle - The better I get to know men, the more I find myself loving dogs. On Sat, Sep 12, 2009 at 3:33 PM, Rick Faircloth r...@whitestonemedia.com wrote: Code: $(document).ready(function() { streetNumber = 'valid'; streetName = 'valid'; city = 'valid'; state = 'valid'; bedrooms = 'valid'; fullBaths = 'valid'; rent = 'valid'; securityDeposit = 'valid'; }); -- Turtle, turtle, on the ground, Pink and shiny, turn around. -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Re: Pics from jQuery Conference
Thanks for shareing the pics! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Saturday, September 12, 2009 9:49 AM To: jQuery (English) Subject: [jQuery] Pics from jQuery Conference Some early pics from today's festivities that is about to start Signup and a little early snack-age http://i26.tinypic.com/31779l1.jpg Way cool Surface Computer http://i31.tinypic.com/2rohpo5.jpg Bad weather today, but it's all good http://i25.tinypic.com/350uqys.jpg Ready for John Resig to give the keynote totally full house http://i32.tinypic.com/2hfur06.jpg More to come !
[jQuery] Re: event coordination problem
How about setting the field to invalid to start with and force the user to blur the field for a validation routine to declare it valid. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jhm Sent: Saturday, September 12, 2009 1:04 PM To: jQuery (English) Subject: [jQuery] event coordination problem Hi- In a form, I'm trying to validate a field when they move off it. But this causes a problem when the field has the focus and they click a button to process the form. In this case, only the field's blur event (or change event) gets fired and nothing for the button click event. Seems like a reasonable thing to want to do, so I figure I'm missing something in they way I've coded this. Any suggestions? Here's the very simple code that exhibits the behavior: head script type=text/javascript src=./js/jquery.js/script script type=text/javascript $(document).ready( function() { $('#id1').blur( function() { alert('blur in id1'); }); $('#id2').click( function() { alert('click in id2'); }); }); /script /head body /body input type=text value=Sample Text name=id1 id=id1 / input type=button name=Finish value=Finish id=id2 / /html
[jQuery] Re: Why would this code cause this error in IE?
Well...just fyi in case anyone is interested, here is the solution. IE doesn't like global variables (I think it just applies to global variables and not local variables) that have the same name as element ID's. A blog I read on this suggested adding var + variableName; as the solution, which, after initial testing, works fine: $(document).ready(function() { var streetNumber; var streetName; var city; var state; var bedrooms; var fullBaths; var rent; var securityDeposit; streetNumber = 'valid'; streetName= 'valid'; city = 'valid'; state = 'valid'; bedrooms = 'valid'; fullBaths = 'valid'; rent = 'valid'; securityDeposit = 'valid'; }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Saturday, September 12, 2009 12:29 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Well...they're for form validation purposes. Those variables are the form fields that I am validating. I initially set them to valid (for updates), then as a user works with the form fields, upon blur of each field, I run a function which scans all fields that are being validated to see if they are all still valid. If they are, then the submit button is enabled. If any of the fields are invalid, the submit button remains or becomes disabled. Here's the code that does that: function ValidateForm() { if ( streetNumber == 'valid' streetName== 'valid' city == 'valid' state == 'valid' bedrooms == 'valid' fullBaths == 'valid' rent == 'valid' securityDeposit == 'valid') { $('#addButton').removeAttr('disabled'); $('.validationError:visible').fadeOut(250); } else { $('#addButton').attr('disabled', 'disabled'); $('.validationError').fadeIn(250); }; }; And, for an example of how an individual field is being validated: $('#streetNumber').livequery('blur', function() { if (this.value.length == 0) { $('#' + this.id + '_requiredError').fadeIn(250); $(this).css('backgroundColor', '#ffeaea'); streetNumber = 'invalid'; } else { $('#' + this.id + '_requiredError').fadeOut(250); $(this).css('backgroundColor', '#fff'); streetNumber = 'valid'; }; ValidateForm(); }); This works well, except for IE not liking the variable without var... And, for my edification, why are global variables frowned upon? Suggestions? Thanks, Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Saturday, September 12, 2009 11:53 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Yes, that's correct. It would probably help to know what it is that those (apparently global) variables are, or rather where it is that they come from (and, from curiosity, why the page would set things up that way - global variables are as ugly in web pages as they are in any other programming domain). On Sat, Sep 12, 2009 at 10:47 AM, Rick Faircloth r...@whitestonemedia.com wrote: Hmmm...that could explain the sudden error I just now received running that code that city is not defined and state is not defined, etc., when validation tries to run. I guess using var causes the variable to be local within that piece of code instead of applicable there and in other pieces of code that references those variables? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Saturday, September 12, 2009 9:12 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? Well, putting var before the variables will probably make IE happy, but it also makes the function useless. On Sat, Sep 12, 2009 at 7:12 AM, Rick Faircloth r...@whitestonemedia.com wrote: That did it seems to satisfy IE that way, too. Thanks, Rick From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Dhruva Sagar Sent: Saturday, September 12, 2009 6:06 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Why would this code cause this error in IE? You should use the keyword 'var' before each variable. Thanks Regards, Dhruva Sagar. Charles de Gaulle - The better I get to know men
[jQuery] How can I get IE developer tools to display xmlHTTPRequests as in Firebug?
Is it possible? Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Anything wrong with this ajax syntax?
Thanks, Shawn Nick for the replies. Making those changes got it working. Can't believe I didn't catch the = in the $.ajax line...to used to starting with values = for my ajax routines. This one doesn't have values to be passed along. Thanks, again! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Nick Fitzsimons Sent: Tuesday, September 08, 2009 6:16 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Anything wrong with this ajax syntax? 2009/9/8 Rick Faircloth r...@whitestonemedia.com: Is there something missing that would keep it from functioning? No, but there's something _extra_ that will keep it from functioning ;-) $.ajax = ({ cache: false, That equals sign means that you are assigning a new value to $.ajax - to be precise, the result of the expression on the right hand side of the equals sign, which in your case is returning an object. I think you want $.ajax({ cache: false, ... which will invoke the jQuery ajax method with your object as an argument. Regards, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/
[jQuery] Anything wrong with this ajax syntax?
Is there something missing that would keep it from functioning? This ajax function only serves to cause a ColdFusion function to create HTML that is then loaded as specified in the code. However, the success part of the function is not executed. No errors or anything.it's as if the ajax function just doesn't work at all. If I put alert('Inside function'); just after the first line of the function and before the $.ajax line below, the alert fires properly. If I add an alert in the response section in the first line of the if section, the alert doesn't fire. Again, no errors from my server-side code or for the jQuery. So, the question is whether or not the $.ajax function will work as coded, or are other parameters needed? (I tried 'post' for type, as well.) Here's the $.ajax function: script type=text/javascript function buildLoginDialog() { $.ajax = ({ cache: false, type: 'get', url: 'components/login.cfc?method=mBuildLoginDialogreturnType=json', success: function(response) { if ( (response.STATUS = 'Login Dialog Build Successful') ) { var loginDialogHTML = 'components/loginDialogHTML.cfm?' + new Date().getTime(); $('.loginDialog').load(loginDialogHTML); login(); } else { alert('Login Dialog Build Failed'); } } }); } /script Thoughts or suggestions, anyone? Thanks, Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Is this quirk of jQuery still true?
Saving state for positioned elements, etc. (other than just form field data) is an interesting problem, as you say, with the complexity of apps using user-positioned elements or other manipulations. I've no solution at this point...haven't run into that situation...yet... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Scott Haneda Sent: Wednesday, September 02, 2009 11:43 PM To: jquery-en@googlegroups.com Cc: jquery-en@googlegroups.com Subject: [jQuery] Re: Is this quirk of jQuery still true? This is an intersting problem though. Without the ability to edit the HTML, a page refresh is going to kill any work you did. Granted, in most cases, the need for a page refresh would not matter, as the browser is going to drop the input form data anyway. One advantage would be you could potentially store the form data. As web apps become more complex, it may not be form data, but positioned elements. What is the best way to save this state in hopes of protecting the user from a refresh? Is it even worth it? I can see three ways. Local browser data store, not currently supported by all browsers. Second is appending to a refresh link, or the URL directly, some data that can store the last state. Third is use of cookies to store state. Curious what others chose to use in solving this, or if it is even something considered a problem worth solving. -- Scott Iphone says hello. On Sep 2, 2009, at 7:29 PM, Rick Faircloth r...@whitestonemedia.com wrote: Thanks for the reply, Ricardo... After thinking about it, it really doesnft matter if the HTML is cha nged. It'll process fine, as you said. What I was really trying to avoid was a problem with the newly entered data being removed if I focused on the field with the cursor again. I came up with a better solution that deleted the error message I put into the field, but didn't delete the new typed in code.
[jQuery] Re: Is this quirk of jQuery still true?
It is impossible to know the OP was just a bit lazy or doesn't fully understand the concepts. The latter...I'm the OP and I can promise you that I don't fully understand all the concepts. :o) Anyway, back to the DOM HTML... If, as you state, there is no HTML in the DOM, from a technical standpoint, then I suppose it's technically inaccurate to speak of traversing the DOM, since what is really being done is traversing of the HTML elements. Would that be a fair statement? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of RobG Sent: Thursday, September 03, 2009 1:43 AM To: jQuery (English) Subject: [jQuery] Re: Is this quirk of jQuery still true? On Sep 3, 1:25 pm, Rick Faircloth r...@whitestonemedia.com wrote: Thanks for the explanation, Rob. I'll have to check into setAttribute...am I correct in assuming that setAttribute is a Javascript function, but not jQuery? setAttribute is a DOM Core method of the Element interface[1]. jQuery wraps a great many such methods, but not this one. There is rarely any need to use it for HTML documents, particularly as it is broken in parts in IE. There is also little use for it as setting the DOM property directly is simpler (and likely much faster as it doesn't require a method call). setAttribute may handy for XML documents though. Also, your statement, There is no 'HTML in the DOM'. HTML is used to create a DOM. seems like semantics. Yes, it is, but in a technical group I think it is important. It is impossible to know the OP was just a bit lazy or doesn't fully understand the concepts. Better to be sure than make a wrong assumption. So is it correct to say that a DOM contains no HTML? Yes. HTML is a markup language, it is interpreted by browsers to generate a DOM. Javascript interacts with the DOM, not the markup. An analogy is that a plan is used to build a house. Instructions to tradesmen to change the design might be reflected in the house, but aren't automatically reflected in the plans unless you also tell the draughtsman to change them. innerHTML and other DOM inspection tools are like an as built plan of part of the house. 1. URL: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68F082 -- Rob
[jQuery] How do I prevent the newly entered text in the text input from disappearing upon focus?
I posted this yesterday, but didn't see my original in my email, so didn't know if it never made it, or if it was perhaps just not answered.but I thought I'd post it again so if anyone has any ideas. Rick --- In code prior to this, if an empty text input is found in a form upon submission, the text Entry required. is put into the text input. Once all the text inputs have been validated, then the function below is run to address handling the error messages and user text input: function validation() { $(':input.inputError').each(function() { $(this).focus(function() { $(this).val(''); }); }); $(':input.inputError').each(function() { $(this).blur(function() { if ( $(this).val().length 0) { $(this).removeClass('inputError').css({'background-color':'#ddd' , 'color':'#000'});} if ( $(this).val().length == 0 ) { $(this).val('Entry required...'); } }); }); } It all works well, except for the fact that once I do make an entry into an invalid field, and blur out of that field, then re-focus the cursor in that same field, my valid data entry is removed. With the code above, I try to avoid that happening by removing the class, input error, which is happening according to Firebug, so I'm not sure why the val is being reset to '' or nothing upon re-focus. Is it the order or structure of the code that's the problem? Thoughts? Have I missed another fundamental javascript coding principle, MZ? ;o) Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Is this quirk of jQuery still true?
I read that in an article dated October 17, 2008, that it was not possible to change the actual HTML in the DOM of the value attribute of a text input using $(this).val('myNewValue'); My experiments just now bear this out. Is this still true? The writer of the article developed a work-around using a hidden input and manipulating its value with a rel to the original input. Is this still the best way? Thanks for any insights. Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Why is console.log(valid) returning yes in this code?
Here's the code: var valid = 'yes'; $(':input').each(function() { if ( $(this).val().length == 0 ) { alert('in!'); var valid = 'no'; alert(valid); $('#rentalAppErrors').fadeIn(500); $(this).addClass('inputError'); $(this).css({'background-color':'red','color':'#fff'}); $(this).val('Entry required...'); } }); console.log(valid); When I run this code making the if statement true, I get the alert('in!') properly, letting me know that I'm inside the conditional block. I also get the second alert, alert(valid), and the value of valid in the alert is no.as it should be. But when the code gets to the console.log(valid) function, valid shows in the console as having the value 'yes'. ??? Why? This is throwing the rest of my code off. Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Is this quirk of jQuery still true?
Thanks for the reply, Ricardo... After thinking about it, it really doesnt matter if the HTML is changed. It'll process fine, as you said. What I was really trying to avoid was a problem with the newly entered data being removed if I focused on the field with the cursor again. I came up with a better solution that deleted the error message I put into the field, but didn't delete the new typed in code. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Ricardo Sent: Wednesday, September 02, 2009 9:09 PM To: jQuery (English) Subject: [jQuery] Re: Is this quirk of jQuery still true? The change in value won't appear in the HTML (in firebug for example), but the value *will* change and be submitted with the form. That's standard DOM scripting behaviour. There is no reason to change the attribute in the HTML unless you want to print it somewhere. On Sep 2, 5:55 pm, Rick Faircloth r...@whitestonemedia.com wrote: I read that in an article dated October 17, 2008, that it was not possible to change the actual HTML in the DOM of the value attribute of a text input using $(this).val('myNewValue'); My experiments just now bear this out. Is this still true? The writer of the article developed a work-around using a hidden input and manipulating its value with a rel to the original input. Is this still the best way? Thanks for any insights. Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Why is console.log(valid) returning yes in this code?
you are stomping over the outside one Hmmm...that's what I'm trying to do. I assume you mean by the 'outside' one, the variable, valid, inside console.log(valid). I'm initially setting the variable valid to yes and using the conditional block to change valid to no if there's an invalid entry in any of the text fields. Would this not be a proper way to proceed? --Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Wednesday, September 02, 2009 10:36 PM To: jQuery (English) Subject: [jQuery] Re: Why is console.log(valid) returning yes in this code? Why? Because you are failing to understand variable scope Don't use the var keyword inside the if block, by using that, you are stomping over the outside one http://www.google.com/search?q=Javascript+variable+scope On Sep 2, 10:26 pm, Rick Faircloth r...@whitestonemedia.com wrote: Here's the code: var valid = 'yes'; $(':input').each(function() { if ( $(this).val().length == 0 ) { alert('in!'); var valid = 'no'; alert(valid); $('#rentalAppErrors').fadeIn(500); $(this).addClass('inputError'); $(this).css({'background-color':'red','color':'#fff'}); $(this).val('Entry required...'); } }); console.log(valid); When I run this code making the if statement true, I get the alert('in!') properly, letting me know that I'm inside the conditional block. I also get the second alert, alert(valid), and the value of valid in the alert is no.as it should be. But when the code gets to the console.log(valid) function, valid shows in the console as having the value 'yes'. ??? Why? This is throwing the rest of my code off. Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] Re: Why is console.log(valid) returning yes in this code?
Ahhh...that did it. As MorningZ mentioned, it was a misunderstanding of the scoping of the variable: inside vs outside the function. I thought, too, being a learn as I code programmer, that anytime I defined a variable, I needed to precede it with var... live and learn...or rather, code and learn... Thanks, James and MZ... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of James Sent: Wednesday, September 02, 2009 10:45 PM To: jQuery (English) Subject: [jQuery] Re: Why is console.log(valid) returning yes in this code? I think you mean: by using that, you are -NOT- stomping over the outside one. Rick, If you don't understand, using var is a variable declaration. Setting: var valid = 'no'; inside the each() callback function will have that variable exist locally only inside that function. It will not overwrite what you have set globally. Since you're doing the console.log outside of that function, it'll use the one you set in the global scope, var valid = 'yes'; To fix that, remove the var in: var valid = 'no'; On Sep 2, 4:36 pm, MorningZ morni...@gmail.com wrote: Why? Because you are failing to understand variable scope Don't use the var keyword inside the if block, by using that, you are stomping over the outside one http://www.google.com/search?q=Javascript+variable+scope On Sep 2, 10:26 pm, Rick Faircloth r...@whitestonemedia.com wrote: Here's the code: var valid = 'yes'; $(':input').each(function() { if ( $(this).val().length == 0 ) { alert('in!'); var valid = 'no'; alert(valid); $('#rentalAppErrors').fadeIn(500); $(this).addClass('inputError'); $(this).css({'background-color':'red','color':'#fff'}); $(this).val('Entry required...'); } }); console.log(valid); When I run this code making the if statement true, I get the alert('in!') properly, letting me know that I'm inside the conditional block. I also get the second alert, alert(valid), and the value of valid in the alert is no.as it should be. But when the code gets to the console.log(valid) function, valid shows in the console as having the value 'yes'. ??? Why? This is throwing the rest of my code off. Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson