[jQuery] Re: href value
On Thu, Sep 17, 2009 at 12:56:01PM -0400, brian wrote: Are you sure that this.href is not complete? I suspect it is and that the problem is that you're appending a URL that contains a query string to another query string. So, the various params are being mixed up with each other. You should urlencode the href before appending it as a query string. While there are javascript functions to simulate php's urlencode I found a better solution. The additional parameters were being placed each in its own $_GET[] element. The solution was to loop through the $_GET array and add each element to the initial url. On Thu, Sep 17, 2009 at 11:21 AM, Rick Pasotto r...@niof.net wrote: I have the following function defined: $(function () { $('a[href*=http:]').click(function() { open('/redirect.php?where=' + this.href); return false; }); }); When the href has only one GET parameter it works as expected however when there is more than one GET parameter it passes only the first. In other words, the following link: a href=http://spreadsheets.google.com/viewform?hl=enamp;formkey=dDVlOFk2cGlpSmR1Vl8zWWZaY0oxOGc6MA; this form/a will pass only 'http://spreadsheets.google.com/viewform?hl=en' to my redirect.php script. I suspect it's a quoting problem. How do I get all the GET parameters to be treated as a single string? -- Take a chance! All life is a chance. The man who goes farthest is generally the one who is willing to do and dare. -- Dale Carnegie Rick Pasotto r...@niof.net http://www.niof.net -- We can hardly exert direct action on the energy and frugality of our fellow men, except through public opinion, through an intelligent expression of our likes and our dislikes. But we can do a great deal for the creation of security, without which capital, far from expanding, goes into hiding, takes flight, or is destroyed; and consequently we see how almost suicidal is the ardour for disturbing the public peace that the working classes sometimes display. They must learn that capital has from the beginning of time worked to free men from the yoke of ignorance, want and tyranny. To frighten away capital is to rivet a triple chain around the arms of the human race. -- Frédéric Bastiat (1801-1850) Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] href value
I have the following function defined: $(function () { $('a[href*=http:]').click(function() { open('/redirect.php?where=' + this.href); return false; }); }); When the href has only one GET parameter it works as expected however when there is more than one GET parameter it passes only the first. In other words, the following link: a href=http://spreadsheets.google.com/viewform?hl=enamp;formkey=dDVlOFk2cGlpSmR1Vl8zWWZaY0oxOGc6MA; this form/a will pass only 'http://spreadsheets.google.com/viewform?hl=en' to my redirect.php script. I suspect it's a quoting problem. How do I get all the GET parameters to be treated as a single string? -- Take a chance! All life is a chance. The man who goes farthest is generally the one who is willing to do and dare. -- Dale Carnegie Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] Re: Guidelines on Graceful Degradation When JavaScript Disabled?
On Mon, Feb 16, 2009 at 08:16:49PM -0800, lerxst wrote: That's fine and all but the issue is how does one 'detect' those browsers that are incompatible with jQuery without sniffing? The answer is, you don't. Since 'detection' requires javascript, you can't 'detect' if javascript is not running. What I do is have a p/p or div/div with text like Additional features available with javascript enabled. Give it a class with display:block and then have javascript change it to display:none. If javascript is not running the user sees the message. If javascript *is* running the user does *not* see the message and all is well. -- A doctor can bury his mistakes but an architect can only advise his client to plant vines. -- Frank Lloyd Wright Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] disable column from sorting in tablesorter
I have a table in which the first column is the row number (always from 1 at the top to 100 at the bottom) so no matter how the other columns are sorted that first column should be the 'rank' for that particular sort. Is it possible to do this with tablesorter? Could I change the values in the first column after tablesorter did it's work? I see how to disable sorting on the first column but that is not what I want. Could someone suggest another way to achieve what I want? -- Everything that you can imagine is real. -- Pablo Picasso Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] Re: disable column from sorting in tablesorter
On Sat, Jan 17, 2009 at 10:02:01AM -0800, MorningZ wrote: So to clarify, you always want that column to be sequentially 1 to n where n is the number of rows? Yes. and if so, and the sort is descending, would it be n to 1 ? No. the first row should always rank #1. The user can reverse the sort order if he wants to. The user wants to know the rank of some row near the middle of the table without having to manually count the rows. On Jan 17, 12:10 pm, Rick Pasotto r...@niof.net wrote: I have a table in which the first column is the row number (always from 1 at the top to 100 at the bottom) so no matter how the other columns are sorted that first column should be the 'rank' for that particular sort. Is it possible to do this with tablesorter? Could I change the values in the first column after tablesorter did it's work? I see how to disable sorting on the first column but that is not what I want. Could someone suggest another way to achieve what I want? -- Everything that you can imagine is real. -- Pablo Picasso Rick Pasotto r...@niof.net http://www.niof.net -- Our doctrine is based on private property. Communism is based on systematic plunder, since it consists in handing over to one man, without compensation, the labor of another. If it distributed to each one according to his labor, it would, in fact, recognize private property and would no longer be communism. -- Frédéric Bastiat (1801-1850) Rick Pasottor...@niof.nethttp://www.niof.net
[jQuery] strange problem with cluetip
I am using cluetip on a section of my left menu. Each ajax call returns a small amount of text and possibly a picture. Sometimes it's the wrong picture. Is it possible that if someone moves the mouse over several menu items rather quickly such that several ajax calls are made in quick succession that the text for the second call gets matched with the picture from the first call? Looking at my log file, the sequence of entries supports this thesis. If that is the case, how can I prevent it? The website is http://lpnc.org and the menu section is the listing of candidates. -- I am only one. But I am one. I cannot do everything but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward E. Hule Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: strange problem with cluetip
On Thu, Jul 03, 2008 at 11:42:02AM -0400, Rick Pasotto wrote: I am using cluetip on a section of my left menu. Each ajax call returns a small amount of text and possibly a picture. Sometimes it's the wrong picture. Is it possible that if someone moves the mouse over several menu items rather quickly such that several ajax calls are made in quick succession that the text for the second call gets matched with the picture from the first call? Looking at my log file, the sequence of entries supports this thesis. If that is the case, how can I prevent it? The website is http://lpnc.org and the menu section is the listing of candidates. I think I've solved it. I hadn't included jquery.hoverIntent.js -- Speak softly, gently and sweetly; you might end up eating your words. -- Unknown Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] what should an hata script return?
I'm using jquery.cluetip.js with a 'rel=' attribute. The cluetip comes up with the 'title' attribute and then 'sorry, the contents could not be loaded'. What exactly does the script need to return? -- Ability can take you to the top, but it takes character to keep you there. -- Zig Zigler Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] ajax load()
I have a quote div that should return a random quote via ajax when it is clicked on. Some time ago I asked why I wasn't getting a new quote and how to force a new quote. The response was to add { nocache:Math.random() } to the load call. That has been working fine but now I'm trying to implement the same thing on another site and it no longer returns a new quote. The only difference is that the new site has the quotes stored in a mysql table instead of a flat file. Refreshing the page *does* get a different quote. The php page does an include of the same file that the load() function calls. I've tried mysql_free_resource() and mysql_close() and still the ajax calls return the same quote. The sql is: $result = mysql_query(select * from quotes order by rand() limit 1); Any suggestions? -- He who has never hoped can never despair. -- George Bernard Shaw Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: ajax load() *SOLVED*
On Sun, Jun 08, 2008 at 12:30:38AM -0400, Rick Pasotto wrote: I have a quote div that should return a random quote via ajax when it is clicked on. Some time ago I asked why I wasn't getting a new quote and how to force a new quote. The response was to add { nocache:Math.random() } to the load call. That has been working fine but now I'm trying to implement the same thing on another site and it no longer returns a new quote. The only difference is that the new site has the quotes stored in a mysql table instead of a flat file. Refreshing the page *does* get a different quote. The php page does an include of the same file that the load() function calls. I've tried mysql_free_resource() and mysql_close() and still the ajax calls return the same quote. The sql is: $result = mysql_query(select * from quotes order by rand() limit 1); Any suggestions? My stupid error. Pardon the interuption. -- Ability can take you to the top, but it takes character to keep you there. -- Zig Zigler Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] radio button value
How do I get the current value of a radio button? This is my html: input type=radio name=mem_type id=mem0 value=regular / input type=radio name=mem_type id=mem1 value=annual checked=checked / and the javascript: function showval() { var t = $(input[name='mem_type']).val(); alert(mem_type = + t); } $(function() { $(input[name='mem_type']).change(showval); }); This always gives me 'regular'. What am I getting wrong? -- If we think happy thoughts, we will be happy. If we think miserable thoughts, we will be miserable. -- Dale Carnegie Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: Presidential Websites
On Wed, Oct 03, 2007 at 06:11:29PM -0700, Glen Lipka wrote: I just did a quick review of all the presidential candidate websites. Apparently NO ONE is interested in the jQuery vote. tsk tsk. Everyone knows that the site with jQuery usually wins the election. Check this review a while back: http://www.nabble.com/jQuery-for-President-t3207252s15494.html Apparently Obama used jQuery and then switched away? http://phillies2008.org/ uses jquery. -- Our children are our only hope for the future, but we are their only hope for their present and their future. -- Zig Zigler Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: What does Unobtrusive Javascript mean?
On Thu, Aug 16, 2007 at 05:49:47PM -, Pops wrote: Word! I feel ya and I agree with you. :-) But unobstructive javascript? Why would anyone assume that software designs are naturally obstructive in the first place? Perhaps you should read more closely. unobtrusive != unobstructive -- Victory goes to the player who makes the next-to-last mistake, said chess master Savielly Grigorievitch Tartakower. Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
On Wed, Jul 18, 2007 at 03:46:58PM +0200, Christian Bach wrote: Could you please post a 'float' parser to the list? I think there was one in the old tablesorter release, but unfortionatley I've deleted There is a set of experimental parser available here: http://lovepeacenukes.com/tablesorter/2.0/jquery.tablesorter.parsers.js Exactly what is it that gets passed to a parser and what should it return? I haven't had the time to test them and there of the experimental status. /christian -- I don't need music, lobster or wine. Whenever your eyes look into mine; The things I long for are simple and few: A cup of coffee, a sandwich and you! Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
On Tue, Jul 17, 2007 at 03:04:59PM +0200, Christian Bach wrote: The new 2.0 release can be found here: http://lovepeacenukes.com/tablesorter/2.0/ Interesting that the packed version is twice as large as the unpacked. :-) -- When dealing with people, remember you are not dealing with creatures of logic, but creatures of emotion. -- Dale Carnegie Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
On Tue, Jul 17, 2007 at 03:04:59PM +0200, Christian Bach wrote: After another late night, fixing a few bugs, the code is finally ready for it's first beta release. The main new features include: * Multi-column sorting * In-line support for setting options done via the class attribute on the TH elements. * The plugin has been re-written from scratch. * Support for rowspan and colspan on TH elements. * New widget support, more information in the docs. Hopefully this will take care of all the issues that was related to the 1.xrelease. The new 2.0 release can be found here: http://lovepeacenukes.com/tablesorter/2.0/ Looks promising but I'm having a little problem with numeric sorting. Here's my invocation and the table header. $(function() { $(#listclubs).tablesorter(); }); theadtr th class={sorter:'integer'}ID#/th thClub Name/th thArea/th thType/th thCharter/th /tr/thead When the page first appears it is sorted the way I wrote it but if I click on the first column it does an alpha sort ('1055512' comes before '1312' and '1420'). Also, is it possible to apply a style to the table based on which column is sorted? And one more thing. I'm using cluetip.js on that first column and it no longer works. -- Those words, 'temperate' 'moderate', are words either of political cowardice, or of cunning, or seduction... A thing moderately good is not so good as it ought to be. Moderation in temper is always a virtue, but moderation in principle is a species of vice. -- Thomas Paine Letter to Addressors Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
On Tue, Jul 17, 2007 at 11:01:55AM -0400, Rick Pasotto wrote: On Tue, Jul 17, 2007 at 03:04:59PM +0200, Christian Bach wrote: After another late night, fixing a few bugs, the code is finally ready for it's first beta release. The main new features include: * Multi-column sorting * In-line support for setting options done via the class attribute on the TH elements. * The plugin has been re-written from scratch. * Support for rowspan and colspan on TH elements. * New widget support, more information in the docs. Hopefully this will take care of all the issues that was related to the 1.xrelease. The new 2.0 release can be found here: http://lovepeacenukes.com/tablesorter/2.0/ Looks promising but I'm having a little problem with numeric sorting. Here's my invocation and the table header. $(function() { $(#listclubs).tablesorter(); }); theadtr th class={sorter:'integer'}ID#/th thClub Name/th thArea/th thType/th thCharter/th /tr/thead When the page first appears it is sorted the way I wrote it but if I click on the first column it does an alpha sort ('1055512' comes before '1312' and '1420'). Also, is it possible to apply a style to the table based on which column is sorted? And one more thing. I'm using cluetip.js on that first column and it no longer works. Immediately after sending the above I think I realized what the problem is. Each of the numeric values in that first column is wrapped in a/a and you're probably sorting on that. Do I need to write a parser? If so, what might it be? -- There are 2 fools in every market: one asks too little, one asks too much. -- Russian proverb Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] load method nor getting new data on IE7
The following function works as it's supposed to on FF but IE7 is evidently caching the results because I always get the same quotation back. How can I force IE7 to do what I tell it to? $(function() {$(#quote).click(function(){ $(this).fadeOut(); $(this).load(getquote.php); $(this).fadeIn(); }); }); -- There will never be a really free and enlightened State, until the State comes to recognize the individual as a higher and independent power, from which all its own power and authority are derived, and treats him accordingly. -- Henry D. Thoreau, 1849 Resistance to Civil Government Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] syntax errors in jquery-1.1.3.1.js
I'm fairly new to javascript so this may or may not be important. One of the posts today led me to the jslint.js program. Running it with rhino on jquery-1.1.3.1.js reports many, many errors. It quit at line 275 complaining of 'too many errors'. Most of the errors were (caused by) missing semicolons. When it aborted, among the last few errors were: Lint at line 250 character 14: Use '!==' to compare with 'undefined'. t.length != undefined (!t.nodeName || t.nodeName == FORM) ? Lint at line 259 character 14: Use '===' to compare with 'undefined'. return val == undefined ? Reading other messages indicated to me that missing semicolons could cause the packer to give bad results. BTW, I really like jQuery and am looking for places to use it -- unobtrusively, of course. -- A great many people think they are thinking when they are merely rearranging their prejudices. -- William James Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] what do I have wrong?
The following code doesn't work. There are no errors reported but nothing happens. What have I misunderstood and therefore gotten wrong? Am I even on the right track to do what I want? The dimensions.js and cluetip.js plugins have been loaded. // have: td1420/td // want: tda class=ct href=oneclub.php?club=1420 rel=oneclub.php?club=14201420/a/td $(function() { // get the first cell of each table row $(tr+td).each(function(){ var clubnumber = $(this).text() $(this).empty() var url = 'oneclub.php?club=' + clubnumber + '' var h1 = ' href=' + url var h2 = ' rel=' + url $(this).html('a class=ct' + h1 + h2 + '' + clubnumber + '/a') }) $(.ct).cluetip() }) -- If you speak the truth, have a foot in the stirrup. -- Turkish proverb Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] Re: what do I have wrong?
On Sun, Jul 15, 2007 at 06:12:25PM +0200, Klaus Hartl wrote: Rick Pasotto wrote: The following code doesn't work. There are no errors reported but nothing happens. What have I misunderstood and therefore gotten wrong? Am I even on the right track to do what I want? The dimensions.js and cluetip.js plugins have been loaded. // have: td1420/td // want: tda class=ct href=oneclub.php?club=1420 rel=oneclub.php?club=14201420/a/td $(function() { // get the first cell of each table row $(tr+td).each(function(){ var clubnumber = $(this).text() $(this).empty() var url = 'oneclub.php?club=' + clubnumber + '' var h1 = ' href=' + url var h2 = ' rel=' + url $(this).html('a class=ct' + h1 + h2 + '' + clubnumber + '/a') }) $(.ct).cluetip() }) Your selector is wrong. tr+td would select any td that is following a tr element. But that is exactly what I want! Sort of. What I want is the first child (which would be a td) of every tr. tr+td would select for a td that was a *sibling* of a tr -- something that couldn't exist. Adjacent sibling selectors have the following syntax: E1 + E2, where E2 is the subject of the selector. The selector matches if E1 and E2 share the same parent in the document tree and E1 immediately precedes E2, ignoring non-element nodes (such as text nodes and comments). Try: $('trtd') Almost. The problem with that is that is selects *all* the tds that are children of the tr and I want only the first. When in doubt it is quite useful to log the jQuery object into the Firebug console for further inspection: console.log( $('trtd') ); My primary browser is SeaMonkey. I guess I'll have to get in the habit of checking things out in FireFox (actually, IceWeasel). Anyway, what I'm using now is td:first-child which works fine. Is that the most efficient way of selecting the tds in just the first column? Thanks for setting me on the right path. -- Making fun of born-again christians is like hunting dairy cows with a high powered rifle and scope. -- P.J. O'Rourke Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] tutorial needs additional material
In the main tutorial http://docs.jquery.com/How_jQuery_Works the third section is 3. Callbacks, Functions, and 'this' however there is no discussion or even a mention of 'this'. Could someone who understands it help this newbie out? The specific thing I'm trying to figure out is, given a lists of trs how can I attach a click() to the first td of each tr that does a show() on a div.class in the third td of that tr? -- I'll take unequal justice to equal injustice any day. Rick Pasotto[EMAIL PROTECTED]http://www.niof.net
[jQuery] can't get hoverTable to work
Could someone look at http://monday6o.org/assign.php and tell me what I have wrong? There is a pause when the page loads so I know the script runs but the rows don't get highlighted when hovered over. In the document head I have: script type=text/javascript src=/js/jquery.js/script script type=text/javascript src=/js/jquery.tableHover.js/script script type=text/javascript src=/js/m6o.js/script script type=text/javascript $(document).ready(function() { $('table.ruler').tableHover({}) } ) /script -- Humankind cannot stand very much reality. -- T. S. Eliot Rick Pasotto[EMAIL PROTECTED]http://www.niof.net