[jQuery] Re: Passing value from function

2010-02-18 Thread RobG
On Feb 18, 9:15 pm, Charlie22 wrote: > Hi all, > I have trouble passing value as selector value to other function. > > $(document).ready(function(){ >         var id = 'Test'; >         $('#Name').keyup(function(){ >                 id = '#Mobil'; If you want variables to be local to their encl

[jQuery] Re: ANNOUNCE: new rev of credit card validation extension

2010-01-13 Thread RobG
On Jan 14, 3:29 am, Jack Killpatrick wrote: > Hi All, > > We've released a new version of our jQuery Validation plugin credit card > extension. It is likely that such validation is more hassle than it's worth... > Changes include: > > 1. updated card prefixes (including latest Discover Card ch

[jQuery] Re: What is the proper way to write this if statement?

2010-01-13 Thread RobG
On Jan 14, 11:00 am, Matt Maxwell wrote: [...] > var that = this; // scope The value of the this keyword has nothing whatever to do with scope. -- Rob

[jQuery] Re: long-term browser support strategy

2010-01-12 Thread RobG
On Jan 12, 1:24 pm, Nathan Klatt wrote: > > IE 6 use is 3 times that of Safari (all versions) depending on whose > > statistics you believe. Why not drop support for Safari while you're > > at it? And Opera and Chrome? > > Because you don't have to do anything to support Safari or Chrome or > Op

[jQuery] Re: long-term browser support strategy

2010-01-11 Thread RobG
On Jan 11, 10:47 pm, mikewse wrote: > What is jQuery's long-term strategy for browser support - cut off > browsers after a certain number of years or when going below a certain > market share? > > [I'm asking because of the current trend (among some webdevs and also > library developers) advocat

[jQuery] Re: Argh!! IE8!

2010-01-11 Thread RobG
On Jan 12, 5:51 am, Valerij wrote: > Hey guys, I have this popup menu that works.. great! In Chrome, > Safari, Firefox AND it USED to work in IE8, until I added just 1 div. [...] > This works in all the browsers great even after I added this div, but > in IE8 it suddenly stopped. > > class="te

[jQuery] Re: looping through form elements.

2010-01-09 Thread RobG
On Jan 8, 8:33 am, rich wrote: > Hello all, I'm relatively new to JavaScript.  I would like to loop > through all the elements within a form and grab their values and what > type of input they are.  So far I came up with: > > $(':input').each(function(idx, item) { >      alert(idx); > }); There

[jQuery] Re: Convert a string version of a json array to an actual json array

2010-01-05 Thread RobG
On Jan 5, 8:10 pm, Dave wrote: > Hi > > Wonder how I can convert a string to a json array. >From what you've posted below, you want to process a string and treat parts of it as JSON objects. > > //start code > > var arrCss = ["a___{'color':'red','font-weight':'bold'}", "h1,h2___ > {'color':'bl

[jQuery] Re: js function to jQuery

2009-12-23 Thread RobG
On Dec 23, 6:58 am, jqHunter wrote: > Hi All, > > I have the following js function used in an old web app. How can I > translate this to equivalent jQuery code? Appreciate your help! > > function expandCollapse_onclick() > { >     var treeCell = document.getElementById("TreeviewTd"); >     var t

[jQuery] Re: js function to jQuery

2009-12-23 Thread RobG
On Dec 23, 2:06 pm, Leonardo Balter wrote: > Nah, make it sexier, use parenteses (tip from the new John Resig's ebook): > > ( var $ = window.jQuery; >    $("#CollapseExpandTd").click( >    function() { >       $("#TreeviewTd").toggle(); >       $("#MenuBarTd").toggle(); >     }); > ); > > $ will

[jQuery] Re: jQuery website search function

2009-12-22 Thread RobG
On Dec 22, 10:51 pm, Schalk Neethling wrote: > Hi there, > > I was wondering whether anyone knows if the jQuery website has some sort > of API to access the search functionality of the site? Stimulus, response... function searchDocs(el) { document.location =

[jQuery] Re: Selectors and Internet Explorer

2009-12-10 Thread RobG
On Dec 11, 7:12 am, "Josh Nathanson" wrote: > Maybe try closing the option tag? The closing tag is optional, there are numerous elements that don't need closing tags in HTML. -- Rob

[jQuery] Re: AND OR Expression

2009-12-10 Thread RobG
On Dec 11, 5:46 am, MorningZ wrote: > > This isn't working out for me " > > Expecting it to? > > First post you were comparing:  string > string...  which isn't going > to work Why not? If the strings are digits that convert to numbers, it will "work". Granted it isn't particularly robust, but:

[jQuery] Re: Replacing brs in a div

2009-12-09 Thread RobG
On Dec 10, 3:24 am, "T.J. Simmons" wrote: > Yeah, I wasn't really sure it would work, but thought it was worth a try. > > And the thing I think depends on the browser used and the > rendering mode it's forced into. What doctype are you using? > > And for some more thought, Firefox (using ) ren

Re: [jQuery] New site with jquery: Cpluv

2009-12-08 Thread RobG
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

[jQuery] Re: New site with jquery: Cpluv

2009-12-07 Thread RobG
On Dec 8, 10:51 am, Escape-Artist wrote: > Hey all! > We just finished a site that is using a whole lot of jquery ( for ajax > submit, tabs, dialogs, transitions, DOM manipulations, ... ) Yeah! Great site! All I got was: "Sorry, you need the flash player to see this page! ( or upgrade your fla

[jQuery] Re: Stop a button within an li taking the li event?

2009-12-02 Thread RobG
On Dec 2, 8:33 pm, Rich wrote: > I have an unordered list which slidesdown to reveal a sub list on > click event. In the first li there is also a button that takes you to > another page. > When this button is pressed I don't want the slide down > to start, which it currently does as the button

[jQuery] Re: Best Practices or unobtrusive Javascript

2009-11-30 Thread RobG
On Dec 1, 12:41 am, Scott Sauyet wrote: > On Nov 29, 8:21 pm, breadwild wrote: > > > I have seen several examples on jQuery plugin sites that have the > >

[jQuery] Re: selector performance

2009-11-12 Thread RobG
On Nov 12, 6:11 am, Karl Swedberg wrote: > Are those tests really using jQuery 1.1.4? If so, they're hardly   > relevant now, unless you're using a very old version of jQuery. The "tests" are relevant in the context of the article. The point is really about improving performance by not making c

[jQuery] Re: How to determine number of elements after dom manipulation ?

2009-11-05 Thread RobG
On Nov 4, 6:22 am, bakman wrote: > I am generating elements (img's) based on data from an xml file. > Once that is done, I want to determine the number of icons that were > generated. > > as naive as i am, i do a: alert($('img').size()) > result: 0, which isn't the case > > how can i determine t

[jQuery] Re: How to tell if is selected when it always defaults to first value?

2009-10-26 Thread RobG
On Oct 25, 4:37 pm, Giovanni Battista Lenoci wrote: > nick ha scritto:> > >    one > >    two > >    three > > > > The right syntax is : > > one Only if the OP is serving XHTML as XHTML, which is rare on the web. If the markup is being served as HTML (which covers the vast majority of web pa

[jQuery] Re: Jquery issue with IE 6 (works in chrome and firefox)

2009-10-26 Thread RobG
On Oct 25, 12:06 am, ram wrote: > This works fine in chrome and firefox but does not in IE6. i am yet to > try it out in IE 7. As you can see, i have an input field and when > user enters a value and clicks on Save, Jquery $("span.saveLink").click > (function() gets invoked which populates the

[jQuery] Re: Don't use onclick

2009-10-13 Thread RobG
On Oct 13, 1:34 pm, expresso wrote: > I don't think it's too hyped.  Having calls to javascript in your > elements defeats the purpose of unobtrusively maintaining and using > libraries like jQuery. The mechanism frequently used to attach such listeners is to add a class, id, name or some othe

[jQuery] Re: Don't use onclick

2009-10-12 Thread RobG
On Oct 13, 10:49 am, CoffeeAddict wrote: > Am I wrong to say you should never use onclick in an element as this would be > contrary to the purpose of using jQuery I think you have your design priorites backward. Firstly determine the functionality required, then how to best implement it. If th

[jQuery] Re: Select element in form?

2009-10-11 Thread RobG
On Oct 12, 7:12 am, zephyr wrote: > Hi, > I have a form and want to select a text input element _in that > specific form_. This is my code: > > $("form [name=" +formName + "] :text[name=" +textInputField+ "]")) Why not: $(document.forms[formName].elements[inputName]) -- Rob

[jQuery] Re: Unexpected $(document).ready() behavior when jQuery is loaded after the page

2009-10-07 Thread RobG
On Oct 8, 10:04 am, Ryan Crumley wrote: > I am experiencing unexpected behavior using $(document).ready() on a > page where I inject jQuery after the page has loaded and then attach > listeners to the ready event. The ready() event is never called using > Firefox and Safari however it is called

[jQuery] Re: textContent attribute problem with ie

2009-10-05 Thread RobG
On Oct 6, 2:37 am, "m.ugues" wrote: > HAllo all. > This piece of code works fine in FIrefox but does not work in IE. > > http://pastie.org/642444 > > The problem is on textContent attribute that in IE is undefined. The textContent property is part of the W3C DOM 3 Core specification, so likely

[jQuery] Re: format number

2009-10-05 Thread RobG
On Oct 5, 12:13 am, Donny Kurnia wrote: [...] > 15,000 should only displayed to user. You should keep 15000 somewhere in > the document. My favorite is using alt > > 15,000 alt is not a valid attribute for span elements. -- Rob

[jQuery] Re: jQuery - Random Selection

2009-10-03 Thread RobG
On Oct 4, 2:45 pm, RobG wrote: [...] > which is the same as using Math.floor. To return a random integer > between 0 and n, use: That should have been: between 0 and n-1 inclusive. > >   function getRandomInt(n) { >     return Math.random()*n | 0; >   } > > -- > Rob

[jQuery] Re: jQuery - Random Selection

2009-10-03 Thread RobG
On Oct 4, 7:06 am, Charlie wrote: > put all the bios in  containers with same class, use javascript random() > function to create a random index to show one of the bios > $('.bioClass').hide() > var bioIndex=Math.round(Math.random()*5) Using that formula, indices 0 and 5 have only half the ch

[jQuery] Re: window close function >_

2009-09-29 Thread RobG
On Sep 30, 2:02 pm, Mike McNally wrote: > In that it handles the case where distinct independent (mutually > unaware, even) portions of the page may want their own unload > callbacks invoked, I'd say so. If you like breaking fast history navigation, go for it. Better to avoid unload listeners

[jQuery] Re: window close function >_

2009-09-29 Thread RobG
On Sep 30, 11:21 am, -JD- wrote: > Al cerrar una pagina necesito llamar a otra para poder hacer algunos > cambios en mi DB. Intenté con esto: >                                 $(window).unload( function () { alert("Bye > now!"); } ); Which is so much simpler than: window.onunload = functio

[jQuery] Re: Strip out all of the commas in numeric text field

2009-09-29 Thread RobG
On Sep 30, 6:27 am, "factoringcompare.com" wrote: > Thank you. JQuery is completly new to me. OK how des the belo code > look? > >

[jQuery] Re: keepp getting NaN vlue

2009-09-28 Thread RobG
On Sep 28, 9:21 pm, runrunforest wrote: > Hi, I'm making a calculator for freight customer > > It seems I'm on the right path. But there is two bugs i need help. > > The TOTAL TO PAY value always seem to appear as NaN at first instead > of default 3. > > And the function of TOTAL TO PAY onl

[jQuery] Re: dans blog jquery calculate installment

2009-09-27 Thread RobG
On Sep 28, 1:26 pm, runrunforest wrote: > Hi, > > I've got a script from dansblog (link > herehttp://blog.pengoworks.com/index.cfm/2008/1/23/jQuery-Calculation-Plu...) > > I copied and presented it as below, its doesn't work. What I've done > incorrectly ? Most such scripts are worth what you

[jQuery] Re: 'this' keyword in a custom object

2009-09-22 Thread RobG
On Sep 22, 9:04 pm, RobG wrote: [...] > e.g. something like > >  function addOne() { >     numChanged++; >  } >  var numChanged = 0; >  var inputs = document.getElementsByTagName('input'); >  var i = inputs.length; >  while (i--) { >   inputs[i].onch

[jQuery] Re: 'this' keyword in a custom object

2009-09-22 Thread RobG
On Sep 22, 8:17 pm, Alex Wibowo wrote: > Hi... > > I'm trying to write object-oriented style javascript as follows: > > - > function HtmlFormUtil(formId){ >     this.formId=formId; >     this.dirtyInputs=new Array();} > > HtmlFormUtil.prototype.trackForChanges=functi

[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread RobG
On Sep 22, 1:30 am, Mike McNally wrote: > Advice to "never" use browser detection is good advice, but in my > experience it's simply impossible to follow. The bad behaviors of old > IE browsers - behaviors that are, in effect, bugs, and therefore not > "features" that obey any particular logic

[jQuery] Re: Browser sniffing - the correct way?

2009-09-20 Thread RobG
On Sep 18, 1:32 am, ldexterldesign wrote: [...] > This still leaves the issue of targeting browsers with JS/jQuery. You still seem to be missing the message: trying to compensate for browser quirks by detecting specific browsers is a flawed strategy. Browser detection is usually based on the u

[jQuery] Re: How do you make text selectable when using IE browser?

2009-09-20 Thread RobG
On Sep 19, 6:53 am, amtames wrote: > Hi, > > We recently had our site redeveloped by a professional firm. We > originally requested that users not be able to copy and paste text > from our site. This has created an outcry and we would like to have > text be selectable. I see that they achieved

[jQuery] Re: Get the onclick method of an element

2009-09-15 Thread RobG
On Sep 15, 6:09 pm, sirrocco wrote: > Let's say you have a : > > asd > > I want to get the onclick text in a variable - something like > > var onclick = $('a').attr('onclick'); > > The problem is that the onclick variable now is a function and if I > try to execute , this wil be the document

[jQuery] Re: HTML code inside script tag, how access to it with DOM???

2009-09-09 Thread RobG
On Sep 10, 9:49 am, Mr Speaker wrote: > I think it's perfectly valid to have a div inside a script tag (or at It is never valid markup in an HTML document, a div element can't be a child of a script element. > least useful), if a div makes sense to the TYPE you defined for the > script. If y

[jQuery] Re: remove() and empy() not work for xml

2009-09-07 Thread RobG
On Sep 7, 3:42 pm, "g...@iec" wrote: > Hi.can anybody  help me out to come out of this You many need to use getElementsByTagNameNS('*',tagName). To remove nodes try: this.parentNode.removeChild(this); -- Rob

[jQuery] Re: jQuery.support : Test if browser return nodes of type Text_Node

2009-09-06 Thread RobG
On Sep 6, 1:38 am, jeanph01 wrote: > Using jQuery.support and without using jQuery.browser how would I know > if the browser would return nodes of Type of Text_Node ? I don't think you need to know that at all - why do you think you need to? > IE do not return text nodes. > > My only idea wou

[jQuery] Re: How can I get current Index?

2009-09-06 Thread RobG
On Sep 6, 12:28 pm, din wrote: > > 1 > JM-53 > -- > -- > -- > ROHs > > 2 > JM-54 > ROHs > -- > -- > ROHs > > I want the value of "href" in first tag A is equal to "JM-53_5.htm". > And the the value of "href" in 2nd tag A is equal to "JM-54_2.h

[jQuery] Re: Is this "quirk" of jQuery still true?

2009-09-03 Thread RobG
On Sep 4, 11:28 am, p_W wrote: > I just wanted to address setAttribute real quick...correct me if I'm > wrong, but I was under the impression that IE does not support > setAttribute(), that you had to use dot notation for IE (so > element.attribute = value instead of element.setAttribute("attribu

[jQuery] Re: Strange behaviour when de-activating form

2009-09-03 Thread RobG
On Sep 3, 3:32 am, burlistic wrote: > Hi All, > > Not sure this is the best place for this question, but I hope someone > can help. > > I have a form which requires a lot of client side validation. As this > takes a while I am using an overlay to stop access to the form. That is probably point

[jQuery] Re: Is this "quirk" of jQuery still true?

2009-09-02 Thread RobG
On Sep 3, 1:25 pm, "Rick Faircloth" 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

[jQuery] Re: validation: how do I make sure a radio button is picked?

2009-09-02 Thread RobG
On Sep 3, 6:17 am, Matt Wilson wrote: > I have a list of radio buttons, all with the same name, and each has a > different value. > > I want a validator that tests if one is picked.  How do I do this? Set one as checked by default (as suggested by the W3C HTML specification), no script or vali

[jQuery] Re: Is this "quirk" of jQuery still true?

2009-09-02 Thread RobG
On Sep 3, 6:55 am, "Rick Faircloth" wrote: > I read that in an article dated October 17, 2008, that it was not possible > to change the actual > > HTML in the DOM There is no "HTML in the DOM". HTML is used to create a DOM. > of the "value" attribute of a text input using > $(this).val('myNe

[jQuery] Re: .html() ignoring updated input value

2009-08-18 Thread RobG
On Aug 19, 3:29 am, resetstudio wrote: > Hi everybody, how are you? > I have to save the state of a form in a var before submitting it with > the whole html, but if I alert the var, I get the original html > without the updated input fields. > > Example: > I have > >     > > > and I fill tha

[jQuery] Re: How to access the member of $.each() when Key has space?

2009-08-12 Thread RobG
On Aug 12, 2:23 pm, Ming wrote: [...] > For example: > > $.each(eval(response),function(key, item) { >     alert(item.Account); //Work >     alert(item.Amount); //Work >     alert(item.Reference Date); //Fail > > }); > > I have try > alert(item('Reference Date')); > alert(item['Reference Date']

[jQuery] Re: can't return value after $.ajax call

2009-08-10 Thread robg
Thank you, that has worked. I tried exactly the same thing before because i though that returning the boolean from within the $.ajax method might not work. However instead of using "bool = true;" i was using "var bool = true;". Have you any idea why using the prefix of var would stop this worki

[jQuery] Re: can't return value after $.ajax call

2009-08-10 Thread robg
Hi Steven, Thank you for your reply but i'm not sure i understand what you mean? By having async set to false the script does wait for the value to come back from the server before executing the rest of the script (i can tell it does this because all the alerts i run to test it, run in the order

[jQuery] can't return value after $.ajax call

2009-08-10 Thread robg
Hi i'm currently using the dialog functionality (modal form) from UI library to submit data to the database. All the validation checks have been running ok until one of the validation checks requires a ajax call to check if a username exsist in the database. I'm fairly new to both javascript and

[jQuery] Re: jQuery and the 'this' keyword

2009-07-30 Thread RobG
On Jul 31, 5:44 am, "#micah" wrote: > I've created a javascript object like so: > > var myObj={ >      //    internally used >      OtherFunction: function(){ alert('hi');}, > >      //    externally used >      EditInfo: function(){ >            this.OtherFunction(); >      } > > }; > > if i b

[jQuery] Re: newbie question.

2009-07-27 Thread RobG
On Jul 28, 5:53 am, James wrote: > This: > (function() { do some stuff } )(); > > is known as a closure. You have a warped view of a closure. It is an example of the module pattern, which can create closures, but doesn't necessarily do so. URL: http://www.jibbering.com/faq/faq_notes/closures.

[jQuery] Re: How to deterine number of words in a string?

2009-07-27 Thread RobG
On Jul 28, 5:09 am, Liam Byrne wrote: > A letter count is FAR easier - just get the string's length. The length of the string will give you a *character* count. I would not inlcude punctuation, white space, etc. in a *letter* count. For number of letters, try: s.replace(/[^a-zA-Z]/g,'').le

[jQuery] Re: Looking for some help converting this to jquery

2009-07-23 Thread RobG
On Jul 24, 3:20 am, sleepwalker wrote: > Eric you rock that's what I'm talking about!! Beautiful code man > thanks so much. > Learning is fun. Don't confuse less with better, it is often slower to execute and harder to maintain. The code I posted could be written as: function setButtonClass(

[jQuery] Re: Looking for some help converting this to jquery

2009-07-22 Thread RobG
On Jul 23, 6:42 am, sleepwalker wrote: > Hi, > I have a old script that adds a class to a button/submit/reset based > on the length of its value and I'd like to convert it to jquery. I'm > just looking for any suggestions on the best way to rewrite it. Instead of code, can you provide a concis

[jQuery] Re: My new website AllJobsXChange.com developed with Jquery

2009-07-18 Thread RobG
On Jul 18, 9:40 am, son wrote: > Thank you Rob. > > I can't remember what make me use the XHTML doctype, I thought I had > some problem with running some jquery stuff, but not sure. > > what is the ideal doctype the will work well with JQuery? jQuery is irrelevant, the best (and only) DOCTYPE

[jQuery] Re: My new website AllJobsXChange.com developed with Jquery

2009-07-17 Thread RobG
On Jul 17, 11:19 am, son wrote: > Hi. My website,www.alljobsxchange.comwas developed with the use of > JQuery. Yet another site using an XHTML doctype served as text/html, even to browsers that understand XML. The W3C validator found 62 errors: http://validator.w3.org/check?uri=http%3A%2F%2F

[jQuery] Re: How to add an element to an object?

2009-07-14 Thread RobG
On Jul 15, 3:25 am, yasmine wrote: > Thanks, I didn't know about the javascript associative arrays. Because javascript doesn't have them, it has objects that are simple name/value pairs. -- Rob

[jQuery] Re: Determine content type in $.post callback

2009-07-12 Thread RobG
On Jul 13, 9:29 am, dnagir wrote: > Anybody? > How can I check the ContentType header in the $.post callback? Try the W3C XMLHttpRequest Object specification: http://www.w3.org/TR/2006/WD-XMLHttpRequest-20060405/#dfn-getresponseheader > -- Rob

[jQuery] Re: how to change 2,5 to 2,50 ?

2009-07-07 Thread RobG
On Jul 7, 9:14 pm, Massimo Lombardo wrote: [...] > As I see you're dealing with cents, money and stuff, I have to > remember you that JavaScript use IEEE 754 Floating Points as its own > internal number type, so 0.1 + 0.2 !== 0.3: people tend to be very > picky when dealing with money, especial

[jQuery] Re: how to change 2,5 to 2,50 ?

2009-07-07 Thread RobG
On Jul 8, 1:59 am, mkmanning wrote: > There are also some currency formatting plugins: > > http://plugins.jquery.com/project/currencyFormat That appears to make extensive use of toFixed(), which is known to be buggy in some browsers for certain values. Try: alert( (0.0625).toFixed(1) ); F

[jQuery] Re: how to change 2,5 to 2,50 ?

2009-07-07 Thread RobG
On Jul 7, 8:11 pm, weidc wrote: > hi, > > thats my code: > > endpreis =Math.round(endpreis*100)/100; > > to round the price of something but i'd like to have 2,00 or 2,50 > instead of 2 and 2,5. > > i'd be happy about any help. To format a number in javascript with exactly two decimal places i

[jQuery] Re: function scope

2009-07-07 Thread RobG
On Jul 7, 11:04 am, "Josh Nathanson" wrote: > You can't.   Of course you can. > You'll have to create a global variable outside document.ready: > > var myFuncs = {}; Or just: var foo; or from within the ready function: var global = (function(){return this;})(); global.foo = functio

[jQuery] Re: Object as Function argument

2009-06-24 Thread RobG
On Jun 24, 4:07 pm, Nic Hubbard wrote: > I have used an object in the past as a function argument, but this was > for a plugin that I wrote.  Using it in the architecture of a plugin > it worked. > > BUT, this time, I just want to write a normal function, but still use > an object to set defaul

[jQuery] Re: return value of nested functions is always undefined

2009-06-23 Thread RobG
On Jun 23, 4:31 pm, anawak82 wrote: > Hi Rob, > > thank you for your quick reply! > > > Add a return statement to getPrice, maybe something like: > > >   function getPrice(id) { > >     return $.get('db.xml', function(d){ > >       ... > >     }); > > I am sorry to say that this only return a X

[jQuery] Re: return value of nested functions is always undefined

2009-06-22 Thread RobG
On Jun 23, 6:24 am, anawak82 wrote: > Hi, > I am just trying to learn a little bit about jQuery. Now I have a > problem with returning a value from a function. > > The following code works fine, when I tested it with alert(price) or > any other way of echoing the value directly. But if I try so

[jQuery] Re: selector, second to last row of table

2009-06-16 Thread RobG
On Jun 17, 3:46 am, theprodigy wrote: > I've been trying for a while to alter the second to last row of a > table. I've tried several ways. The number of rows is dynamic so I > can't hard code a number into nth-child. I used $rowNeeded = > $thisRow.parents('table:first').children().children().l

[jQuery] Re: Loop only handling last item in the array

2009-06-09 Thread RobG
On Jun 10, 7:44 am, psc wrote: > I am very new to javascript/jquery so bare with me. I am using this > loop code below with a populated array called "listarray": > >         for(var i in listarray){ Don't use for..in to iterate over an Array, it can be problematic unless you have complete cont

[jQuery] Re: How to get option's position

2009-06-08 Thread RobG
On Jun 9, 11:23 am, "David .Wu" wrote: > if I have a menu, how to get the position of the option after I select > one of it? > > for example, if I choose b, and the position should b 2. > > a > b > c > Select elements have a (zero indexed) selectedIndex property that tells you which option i

[jQuery] Re: Even Odd Rows

2009-06-06 Thread RobG
On Jun 6, 11:25 pm, Karl Swedberg wrote: > You can make that first line a bit more compact: > > $("li").removeClass("even odd") It's still very inefficient. All that is required is for the LIs below the deleted one to have their class swapped from odd to even and vice versa. -- Rob

[jQuery] Re: looping through all elements of a form and keeping track of different font size

2009-06-03 Thread RobG
On Jun 3, 6:48 pm, Mr J wrote: > hi all, > here is the scenario: > i have created an option on a website to give the possibity to the > user to change the font size (smaller, bigger, reset), A complete waste of time. Modern browsers allow the user to control the size of text using one or more

[jQuery] Re: a jQuery solution for an MSIE problem?

2009-05-31 Thread RobG
On May 31, 8:56 am, "planetv...@gmail.com" wrote: > Hi everyone, I have been struggling with a MSIE related problem and I > was wondering if using jQuery will help me find an asnwer. Basically, > the code words wonderfully in all other browsers except MSIE. > > Basically, I want to render somet

[jQuery] Re: calling functions between multiple document ready events

2009-05-30 Thread RobG
On May 31, 8:10 am, Ricardo wrote: > myFunction() > and > window.myFunction > > are not necessarily the same. the first one will look up the scope > chain and use the first ocurrence, it doesn't go directly to the > window object. The second looks up the scope chain too and uses the first prop

[jQuery] Re: Selecting lowest element containing text

2009-05-28 Thread RobG
On May 29, 5:32 am, David wrote: > I need to select the lowest element containing a given string. What does "lowest" mean? The one with the most ancestors, or the one whose ancestors have the largest index of their siblings? e.g. Given the document tree

[jQuery] Re: inline script html vs xhtml

2009-05-27 Thread RobG
On May 27, 10:31 pm, dhoover wrote: > I am a bit perplexed at why a simple bit of code I have is firing in > HTML but not in the equivalent XHTML. Because it is extremely likely that your XHTML markup is being treated as HTML, in which case... [...] > And here is the XHTML file (that does not

[jQuery] Re: input field name include "." jquery cann't parse

2009-05-27 Thread RobG
On May 28, 4:07 am, Karl Swedberg wrote: > On May 26, 2009, at 9:05 PM, RobG wrote: > > > The choice is clear - the OP can simply stop using jQuery selectors > > for those elements, or stop using jQuery (or any other CSS selector- > > based framework) at all. > >

[jQuery] Re: input field name include "." jquery cann't parse

2009-05-26 Thread RobG
On May 27, 6:21 am, MorningZ wrote: > So if you had: > > > > how would you apply a style to that? Using a class or a selector other than the id. > > can't say: > > #user.name { > } > > because that would look for > > > > yeah, "poor choice" sure is relative, but why make things more > diffi

[jQuery] Re: Read "Pro JavaScript Techniques"?

2009-05-25 Thread RobG
On May 25, 4:13 pm, Ricardo wrote: > On May 24, 2:01 am, RobG wrote: > > > > Still good /  applicable? > > > It is not on the recommended list at the comp.lang.javascript FAQ: > > > http://www.jibbering.com/faq/#books> > > The guys at comp.lang.ja

[jQuery] Re: Read "Pro JavaScript Techniques"?

2009-05-23 Thread RobG
On May 23, 1:12 am, finneycanhelp wrote: > Have you read the book "Pro JavaScript Techniques" Published December > 2006? No. > Still good /  applicable? It is not on the recommended list at the comp.lang.javascript FAQ: http://www.jibbering.com/faq/#books > > > (book image and links athttp

[jQuery] Re: What happen with jQuery? Is it slow?

2009-05-22 Thread RobG
On May 23, 6:48 am, Josh Powell wrote: [...] > Also, many of the jQuery examples are poorly constructed, Depending on your point of view. > take the > 'table' instance: > > for (var i = 0; i < 40; i++) { >         $("").appendTo("body").html > ("first").find("tr").prepend("before");} > > retu

[jQuery] Re: Rollover Effects instead of alternate images

2009-05-22 Thread RobG
On May 22, 2:43 pm, dnagir wrote: > Hi, > > Just wondering if there's some effect in JQ that we can use to > simulate rollover. It doesn't require any javascript at all. > Usually when user hovers a mouse over a link/image it changes its src/ > background to another one (for example arrow.png

[jQuery] Re: traverse complete DOM of a webpage

2009-05-20 Thread RobG
On May 20, 8:35 pm, Sourabh wrote: > Hi > > I am new to jQuery.I have a problem where I want to traverse through > DOM.For example a complete webpage.Is there any jQuery way to traverse > complete DOM of the current page where the jQuery script resides ? Traversing the DOM is trivial, using rec

[jQuery] Re: A better way of writing this code?

2009-05-15 Thread RobG
On May 15, 5:22 pm, Karthikraj wrote: > But CSS :hover will not work in IE6. So better use script Rubbish. The OP wants to use it on an A element, which supports :hover in probably every browser since Navigator and IE 4, if not older. -- Rob

[jQuery] Re: A better way of writing this code?

2009-05-14 Thread RobG
On May 15, 11:35 am, Calvin wrote: >   Hi, > >   I was able to get this script to work and was wondering if there was > a better/proper/more efficient way of writing it. Here is the script: > >   $(document).ready(function() { >       $('li.a').hover(function() { >          $(this).addClass('mo

[jQuery] Re: jQuery too slow on IE!!!

2009-05-12 Thread RobG
On May 12, 10:42 pm, Chandan wrote: > Hi, > > I recently started using jQuery, thinking that it is FASTER than usual > javascript, but i found it is too slow when used with IE. I am using > IE 6/7. jQuery is written in javascript, therefore it is unlikely that any jQuery function is faster tha

[jQuery] Re: val ( ) prefers labels over values?

2009-05-07 Thread RobG
On May 8, 12:20 pm, RobG wrote: > On May 7, 9:42 am, "Michael B.  Williams" wrote: > > > > > Consider the following select box: > > > > > > > XS > > S > > M > > L > > XL > > 0 > > 1 > > 2 > >

[jQuery] Re: val ( ) prefers labels over values?

2009-05-07 Thread RobG
On May 7, 9:42 am, "Michael B. Williams" wrote: > Consider the following select box: > > > > XS > S > M > L > XL > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > 11 > 12 > > > If I do a $("#test").val(2) on this I would hope it would select "S", > but instead it selects "2". Why is this setti

[jQuery] Re: val ( ) prefers labels over values?

2009-05-07 Thread RobG
On May 8, 10:52 am, Marv wrote: > You may be morally correct And technically correct. > but the label attribute of the option tag > is not widely supported: Irrelevant. -- Rob

[jQuery] Re: Disable input button, using wrong HTML code?

2009-05-06 Thread RobG
On May 7, 12:46 am, "Jonathan Vanherpe (T & T NV)" wrote: > Stephen Korecky wrote: > > I tried that too, has same results... > > > On May 6, 9:35 am, "Jonathan Vanherpe (T & T NV)" > > wrote: > >> stephen wrote: > >>> I created a test page > >>> here:http://clients.stephenkorecky.com/stephen_

[jQuery] Re: Performance of "parent > child" selector vs .children() method

2009-05-06 Thread RobG
On May 7, 11:54 am, Ricardo wrote: > On May 6, 10:23 am, Adam wrote: > > > Essentially, I'd like to know if there is any difference between > > > $("div.grandparent > div.parent > div.child") > > > and > > > $("div.grandparent").children("div.parent").children("div.child") > > > Does anyone kn

[jQuery] Re: Resetting the reset button

2009-05-06 Thread RobG
On May 1, 1:49 am, russellneufeld wrote: > Hi all, > >   I've got a set of forms which all act the same way - the form submit > is handled by the jQuery form plugin which redirects the output to a > div on the page.  That means that when the user hits submit, the page > in the browser doesn't c

[jQuery] Re: Simple next/prev controls for

2009-04-29 Thread RobG
On Apr 29, 6:56 am, René wrote: > Assuming: > > > Both > Red > Blue > Green > > > Prev > Next > > Just wondering if someone has figured a simple jQuery function for > moving through the a select list (using the above type of controls). > The idea is that the Prev anchor would disappear if the

[jQuery] Re: How to get file name

2009-04-28 Thread RobG
On Apr 28, 6:36 pm, "David .Wu" wrote: > > > $('img').attr('src') -> This will get images/xxx.gif > How to get xxx.gif by jQuery? img.src.replace(/.*\//, '')); -- Rob

[jQuery] Re: How to select one of the many forms i have

2009-04-26 Thread RobG
On Apr 25, 6:09 am, funkyasl wrote: > Hi all, > I'm a jquery newbie. I've been searching around the web a lot, but > could not find an answer. > > My page has multiple forms (forma, formb, formc, etc). I want to > select one particular form, say formb, without assigning an id to it, > just by i

[jQuery] Re: Get first child within an element

2009-04-24 Thread RobG
On Apr 24, 9:43 pm, dgb wrote: > Hi, > > I've got a reference to a TableCell and I'd like to use jQuery to get > the first instance of an tag within that TableCell, but can't > get the syntax right, I understand how it would work if I were to > reference the TableCell by and ID or class, but n

  1   2   3   >