Re: [jQuery] Is it a bug
hi,guys i get a form in table by jquery. if the form like this: table form tbodytbody /form /table The table does not display in firefox(i use ff2.0), but it's ok in IE. and i can find the table of dom from DOM inspector add-on, it does exists!! i try some lots of ways to find what happened. And last i find. if html like this: formtabletbodytbody/table /form it can display in ff2. note: it just happens when you get html in ajax, but it's okay accessing directly by ff2 I'm sorry my poor English:) Johnny Johnny wrote: Hi, guys I have a problem when i use jquery's ajax module. My jquery code is here: $(document).ready(function() { $(div#test).load(xml_to_page.jsp,{class:Img,sn:1}); }); xml_to_page.jsp is file transform xml to html String xml = \\xml\\ + class + .xml; String xsl = \\xml\\item_attr_form.xsl; try { XSLTHelper.transform(xml, xsl, out); } catch ( Exception e ) { e.printStackTrace(response.getWriter()); } it works in IE, it can display html created by the xml_to_page.jsp , but it doesn't display in FireFox, and i use DOM Inspect, the div#test actually have content. So where is the problem? Thank you advance! Johnny -- View this message in context: http://www.nabble.com/Is-it-a-bug-tf2805700.html#a7848698 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Dynamically added click registration always returns the last value added
Hello, I'm parsing this JSON: {result:success,successText:Your changes have been saved successfully.,errorText:,memberID:49,mode:edit,jobs:[{jobID:1,companyName:SAIC},{jobID:2,companyName:Aspentech},{jobID:3,companyName:Cardinal Health}]} ...with this Javascript: $(#panelManageJobView).empty(); for (var i in json.jobs) { var j = json.jobs[i]; var div = div id='job + j.jobID + 'h1 id='jobTitle + j.jobID + ' style='display:inline;font-weight:normal' + j.companyName + /h1nbsp;| # edit ; div += div style='padding-top:10px;display:none' id='jobEdit + j.jobID + '/div/div; if (i 0) { div = div class='padLine'nbsp;/div + div; } $(#panelManageJobView).append(div); //now register click event on edit link $(#editJob + j.jobID).click(function() { alert(j.jobID); }); } Everything works fine, and is added to the page correctly. I even viewed the generated HTML and confirmed that the ID's are correct on each div that gets appended. However, when I click on the edit link next to each item, the alert always shows the last jobID that was received in the JSON - 3 in this example. I'm expecting to get 1 if I click the first edit link, 2 if I click the second, and so on. Any ideas what I'm doing wrong? Thanks, Chad -- View this message in context: http://www.nabble.com/Dynamically-added-%22click%22-registration-always-returns-the-last-value-added-tf2812575.html#a7848746 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dynamically added click registration always returns the last value added
The a tag that was in the var div line got rendered as an actual link. Here it is again with spaces to prevent it from being rendered as a link: var div = div id='job + j.jobID + 'h1 id='jobTitle + j.jobID + ' style='display:inline;font-weight:normal' + j.companyName + /h1nbsp;| a href='#' id='editJob + j.jobID + 'edit / a; Chad leftend wrote: Hello, I'm parsing this JSON: {result:success,successText:Your changes have been saved successfully.,errorText:,memberID:49,mode:edit,jobs:[{jobID:1,companyName:SAIC},{jobID:2,companyName:Aspentech},{jobID:3,companyName:Cardinal Health}]} ...with this Javascript: $(#panelManageJobView).empty(); for (var i in json.jobs) { var j = json.jobs[i]; var div = div id='job + j.jobID + 'h1 id='jobTitle + j.jobID + ' style='display:inline;font-weight:normal' + j.companyName + /h1nbsp;| # edit ; div += div style='padding-top:10px;display:none' id='jobEdit + j.jobID + '/div/div; if (i 0) { div = div class='padLine'nbsp;/div + div; } $(#panelManageJobView).append(div); //now register click event on edit link $(#editJob + j.jobID).click(function() { alert(j.jobID); }); } Everything works fine, and is added to the page correctly. I even viewed the generated HTML and confirmed that the ID's are correct on each div that gets appended. However, when I click on the edit link next to each item, the alert always shows the last jobID that was received in the JSON - 3 in this example. I'm expecting to get 1 if I click the first edit link, 2 if I click the second, and so on. Any ideas what I'm doing wrong? Thanks, Chad -- View this message in context: http://www.nabble.com/Dynamically-added-%22click%22-registration-always-returns-the-last-value-added-tf2812575.html#a7848789 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dynamically added click registration always returns the last value added
You're using the variable j to hold a reference to each element of the jobs array as you go through the loop. After the loop finishes, j is a reference to the last element of that array. Later, when the click function gets called, j still refers to that last element - regardless of which element triggers the event. You need to keep track of each of those elements separately. The easiest way to do that is with a closure. Also, you don't want to use for in to iterate over an array. Use a C-style loop instead. So, you could code this: for( var i = 0, n = json.jobs.length; i n; i++ ) { (function( job ) { // ... $(#editJob + job.jobID).click(function() { alert(job.jobID); }); })( json.jobs[i] ); } The inner function captures a separate job variable for each instance of the loop, so when the click function gets called later, it will have the correct reference. (I took the liberty of changing the name from j to job just to make the example more clear - I always think of j as an index variable like i.) Even better, jQuery has an iterator function you can use to simplify the code: $.each( json.jobs, function( i, job ) { // ... $(#editJob + job.jobID).click(function() { alert(job.jobID); }); }); Again, each click function will use its own copy of the job variable - not because of any jQuery magic, but simply because of the use of the inner function. $.each just runs the loop for you. -Mike The a tag that was in the var div line got rendered as an actual link. Here it is again with spaces to prevent it from being rendered as a link: var div = div id='job + j.jobID + 'h1 id='jobTitle + j.jobID + ' style='display:inline;font-weight:normal' + j.companyName + /h1nbsp;| a href='#' id='editJob + j.jobID + 'edit / a; I'm parsing this JSON: {result:success,successText:Your changes have been saved successfully.,errorText:,memberID:49,mode:edit,jobs:[{ jobID:1,companyName:SAIC},{jobID:2,companyName:Aspentech },{jobID:3,companyName:Cardinal Health}]} ...with this Javascript: $(#panelManageJobView).empty(); for (var i in json.jobs) { var j = json.jobs[i]; var div = div id='job + j.jobID + 'h1 id='jobTitle + j.jobID + ' style='display:inline;font-weight:normal' + j.companyName + /h1nbsp;| # edit ; div += div style='padding-top:10px;display:none' id='jobEdit + j.jobID + '/div/div; if (i 0) { div = div class='padLine'nbsp;/div + div; } $(#panelManageJobView).append(div); //now register click event on edit link $(#editJob + j.jobID).click(function() { alert(j.jobID); }); } Everything works fine, and is added to the page correctly. I even viewed the generated HTML and confirmed that the ID's are correct on each div that gets appended. However, when I click on the edit link next to each item, the alert always shows the last jobID that was received in the JSON - 3 in this example. I'm expecting to get 1 if I click the first edit link, 2 if I click the second, and so on. Any ideas what I'm doing wrong? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dynamically added click registration always returns the last value added
Wow, thanks very much. It worked like a charm. I hadn't used the $.each function in jQuery yet, so thank you for pointing me to it. I suspect I'll be using it a lot more now that I know how to! Chad Michael Geary wrote: You're using the variable j to hold a reference to each element of the jobs array as you go through the loop. After the loop finishes, j is a reference to the last element of that array. Later, when the click function gets called, j still refers to that last element - regardless of which element triggers the event. You need to keep track of each of those elements separately. The easiest way to do that is with a closure. Also, you don't want to use for in to iterate over an array. Use a C-style loop instead. So, you could code this: for( var i = 0, n = json.jobs.length; i n; i++ ) { (function( job ) { // ... $(#editJob + job.jobID).click(function() { alert(job.jobID); }); })( json.jobs[i] ); } The inner function captures a separate job variable for each instance of the loop, so when the click function gets called later, it will have the correct reference. (I took the liberty of changing the name from j to job just to make the example more clear - I always think of j as an index variable like i.) Even better, jQuery has an iterator function you can use to simplify the code: $.each( json.jobs, function( i, job ) { // ... $(#editJob + job.jobID).click(function() { alert(job.jobID); }); }); Again, each click function will use its own copy of the job variable - not because of any jQuery magic, but simply because of the use of the inner function. $.each just runs the loop for you. -Mike -- View this message in context: http://www.nabble.com/Dynamically-added-%22click%22-registration-always-returns-the-last-value-added-tf2812575.html#a7849617 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is it a bug
You may want to consider looking into using jXs: http://www.malsup.com/jquery/jxs/ The problem is XML doesn't work like HTML when inserted into the DOM, even though it looks like HTML. I hacked up some code from jXs to convert the XML into HTML and made it a little plugin called htmlify. I use it like this: $.get('/ajax/foo', params, function(data) { if($('success', data).size() 0) { $('#result').prepend($('success', data).children().htmlify()); } else { ... } }); The returned XML looks like: successdiv class=foospanSome stuff/span/div/success The plugin is just hacked up stuff from jXs: jQuery.fn.htmlify = function() { if(this.size() == 1) { return jQuery(makeElement(this.get(0))); } else { var htmlifyNodes = []; this.each(function() { var temp = makeElement(this); htmlifyNodes.push(temp); }); return jQuery(htmlifyNodes); } function makeElement(xmlNode) { switch(xmlNode.nodeType) { case 1: // element return element(xmlNode); case 3: // text case 4: // cdata -- Corrected by Mike Alsup 07/26/2006 var t = xmlNode.nodeValue.replace(/^\s+|\s+$/g, ); // condense white space return t.length 1 ? undefined : document.createTextNode (t); default: return undefined; // do nothing; } function element(xNode) { var node = document.createElement(xNode.tagName); for(var i = 0, a = xNode.attributes; i a.length; i++) { jQuery(node).attr(a[i].nodeName, a[i].nodeValue); } for(var i = 0, c = xNode.childNodes; i c.length; i++) { var child = makeElement(c[i]); if(child) { node.appendChild(child); } } if(node.metaDone) { node.metaDone = undefined; } return node; } } }; It probably totally breaks on IE. I haven't tried it yet. --Erik On 12/13/06, Johnny [EMAIL PROTECTED] wrote: hi,guys i get a form in table by jquery. if the form like this: table form tbodytbody /form /table The table does not display in firefox(i use ff2.0), but it's ok in IE. and i can find the table of dom from DOM inspector add-on, it does exists!! i try some lots of ways to find what happened. And last i find. if html like this: formtabletbodytbody/table /form it can display in ff2. note: it just happens when you get html in ajax, but it's okay accessing directly by ff2 I'm sorry my poor English:) Johnny Johnny wrote: Hi, guys I have a problem when i use jquery's ajax module. My jquery code is here: $(document).ready(function() { $(div#test).load(xml_to_page.jsp,{class:Img,sn:1}); }); xml_to_page.jsp is file transform xml to html String xml = \\xml\\ + class + .xml; String xsl = \\xml\\item_attr_form.xsl; try { XSLTHelper.transform(xml, xsl, out); } catch ( Exception e ) { e.printStackTrace(response.getWriter()); } it works in IE, it can display html created by the xml_to_page.jsp , but it doesn't display in FireFox, and i use DOM Inspect, the div#test actually have content. So where is the problem? Thank you advance! Johnny -- View this message in context: http://www.nabble.com/Is-it-a-bug-tf2805700.html#a7848698 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is it a bug
Johnny schrieb: hi,guys i get a form in table by jquery. if the form like this: table form tbodytbody /form /table The table does not display in firefox(i use ff2.0), but it's ok in IE. and i can find the table of dom from DOM inspector add-on, it does exists!! i try some lots of ways to find what happened. And last i find. if html like this: formtabletbodytbody/table /form it can display in ff2. note: it just happens when you get html in ajax, but it's okay accessing directly by ff2 I'm sorry my poor English:) Johnny tableform ... /form/table is invalid HTML. Put that into a static page and test it on the W3C validator. In a static page you can get away with that because the browsers tag soup parser will fix your bad HTML. It's another thing obviously if you try to append such broken HTML with JavaScript after the page has been loaded/rendered. Imagine you were a browser: You're expecting a tbody or tr element after the table has been opened but there comes a form suddenly - where to put it? After the table? Close the table immediatly and open the form? IE seems to be more error prone here but that doesn't matter. So it's not a jQuery bug, the bug is your HTML itself. As you already found out, just use formtable ... /table/form and you're fine. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Efforts to Convert Folks to jQuery
•More than cosmetic effects (Moo.fx) Just wondering - I don't know much about it - does Moo.fx really have only cosmetic effects? What is meant by that anyway? I guess I have to have a look into the slides... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Is it a bug
if the form like this: table form tbodytbody /form /table The table does not display in firefox(i use ff2.0), but it's ok in IE. and i can find the table of dom from DOM inspector add-on, it does exists!! i try some lots of ways to find what happened. And last i find. if html like this: formtabletbodytbody/table /form Hi Johnny, Your first code example is incorrect html markup, the second method is better. This is not a bug in jQuery. Cheers, Mike. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Apps used to reply to this list
Hi people, I seem to have problems creating a reply to the messages on this list, whenever I post a reply, it always creates a new thread rather than continue another, I'm using Thunderbird 1.5.0.8 on the mac. Does anyone else use this program/version and can tell me what I'm doing wrong. If not, can people tell me which app. they use so I can make a switch. Cheers, Mike. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Apps used to reply to this list
Michael Holloway schrieb: Hi people, I seem to have problems creating a reply to the messages on this list, whenever I post a reply, it always creates a new thread rather than continue another, I'm using Thunderbird 1.5.0.8 on the mac. Does anyone else use this program/version and can tell me what I'm doing wrong. If not, can people tell me which app. they use so I can make a switch. Cheers, Mike. Mike, I'm using exactly the same, but do not have that problem (do I?). Maybe you have set some aditional headers, but I couldn't spot any... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
On 13/12/06, Brice Burgess [EMAIL PROTECTED] wrote: Joan Piedra wrote: On 12/12/06, *Aaron Heimlich* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: div#myid = SLOW!! #myid = FAST!! .myclass = SLOW!! div.myclass = FAST(er)!! LOL, I think this is how it works in real CSS. div#myid = Faster #myid = Slow .myclass = Slow div.myclass = Fast Does anyone know of CSS best practice benchmarks? Is div#myid indeed faster in CSS? ~ Brice I don't know if you can even benchmark the CSS parsing speed of browsers. It's so fast that you don't notice anyway (and if you do, it is probably due to the stylesheet downloading slowly or the page being very big). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Show/Hide Buttons on one line
I'm sure I must be missing something basic, but I cannot persuade buttons which I'm showing and hiding with jQ to stay on one line. It works fine with instant show/hide, but not with speeds (slow/medium/fast). Any ideas/hints/help will be appreciated, Jez -- View this message in context: http://www.nabble.com/Show-Hide-Buttons-on-one-line-tf2813143.html#a7850364 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Apps used to reply to this list
Klaus Hartl schrieb: Michael Holloway schrieb: Hi people, I seem to have problems creating a reply to the messages on this list, whenever I post a reply, it always creates a new thread rather than continue another, I'm using Thunderbird 1.5.0.8 on the mac. Does anyone else use this program/version and can tell me what I'm doing wrong. If not, can people tell me which app. they use so I can make a switch. Cheers, Mike. Mike, I'm using exactly the same, but do not have that problem (do I?). Maybe you have set some aditional headers, but I couldn't spot any... -- Klaus I do use the same version, and it seems to work. Do you simply reply or reply all? I think somebody told me to always reply all when writing to mailinglists. I cannot say whether that fixes your problem. -- Marc ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] unload and unload
so no .click() then? ANdreas The best thing to do is always use .bind(event, fn) for your events. There is no ambiguity when you do that. Many of those confusing shortcuts will be going away in an upcoming version. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is it a bug
Johnny, If you really need that table in there, try rearranging your HTML so that the form element is inside one of the table's cells: table tbody tr td form ... /form /td /tr /tbody /table --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Dec 13, 2006, at 4:58 AM, Michael Holloway wrote: if the form like this: table form tbodytbody /form /table The table does not display in firefox(i use ff2.0), but it's ok in IE. and i can find the table of dom from DOM inspector add-on, it does exists!! i try some lots of ways to find what happened. And last i find. if html like this: formtabletbodytbody/table /form Hi Johnny, Your first code example is incorrect html markup, the second method is better. This is not a bug in jQuery. Cheers, Mike. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
Could you put together an example page? -- Brandon Aaron On 12/13/06, jazzle [EMAIL PROTECTED] wrote: I'm sure I must be missing something basic, but I cannot persuade buttons which I'm showing and hiding with jQ to stay on one line. It works fine with instant show/hide, but not with speeds (slow/medium/fast). Any ideas/hints/help will be appreciated, Jez -- View this message in context: http://www.nabble.com/Show-Hide-Buttons-on-one-line-tf2813143.html#a7850364 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] unload and unload
On Dec 13, 2006, at 6:54 AM, Andreas Wahlin wrote: so no .click() then? ANdreas The best thing to do is always use .bind(event, fn) for your events. There is no ambiguity when you do that. Many of those confusing shortcuts will be going away in an upcoming version. I think the decision about what to do with the shortcuts has not been finalized yet. Whatever happens to the other shortcuts, .toggle() and .hover() are going to stick around, because they're special cases. I'd be surprised if .click() went away anytime soon. It's just too quick, useful, and ubiquitous to get rid of it. Of course, none of these decisions are up to me, so take what I say with a grain of salt. However, a recent chat with John Resig led me to believe that .click () wasn't going to be relegated to a plugin, at least not in 1.1. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
Hey John... In the API docs, is there any reason why EVERY one of the listings has the word jQuery before it? Isn't that rather redundant? !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John Resig Sent: Tuesday, December 12, 2006 7:44 PM To: jQuery Discussion. Subject: [jQuery] jQuery 1.0.4 Released Hi Everyone - Another fantastic release of jQuery is ready for your consumption. This release includes a number of bug fixes (as usual) along with some much-needed improvements to jQuery's Ajax functionality. As always, if you have any questions or concerns with new release, please feel free to discuss it on the mailing list. If you think you've spotted a bug, please add it to the bug tracker (http://jquery.com/dev/bugs/new/). So, without further ado, here's jQuery 1.0.4: Download - Compressed JavaScript (Recommended Download!) http://jquery.com/src/jquery-1.0.4.pack.js - Uncompressed JavaScript http://jquery.com/src/jquery-1.0.4.js - 1.0.4 Documentation http://jquery.com/api/ - 1.0.4 Test Suite http://jquery.com/test/ - Full Release (jQuery, Test Suite, Documentation) http://jquery.com/src/jquery-1.0.4.release.zip - Build Files (Compile your own version of jQuery 1.0.4) http://jquery.com/src/jquery-1.0.4.build.zip Changes and Features - Tons of bug fixes Full List: http://jquery.com/dev/bugs/10/?sort=ticketasc=0 - Extensions to $.ajax(): $.ajax accepts additional options: beforeSend, async and processData; returns XMLHttpRequest to allow manual aborting of requests, see docs for details. Example: Add extra headers to an Ajax request using beforeSend $.ajax({ type: POST, url: /files/add/, beforeSend: function(xhr) { xhr.setRequestHeader( Content-type, text/plain ); }, data: This is the contents of my text file. }); Example: Perform a synchronous Ajax request. // Get the HTML of a web page and save it // to a variable (the browser will freeze until the // entire request is completed). var html = $.ajax({ type: GET, url: test.html, async: false }).responseText; // Add the HTML into the page $(#list).html( html ); Example: Sending a JavaScript object using processData. // The data to send to the server var params = { name: John, city: Boston }; $.ajax({ type: POST, url: /user/add/, processData: params }); Example: Aborting an Ajax request after a specific delay in time. // Perform a simple Ajax request var req = $.ajax({ type: GET, url: /user/list/, success: function(data) { // Do something with the data... // Then remove the request. req = null; } }); // Wait for 5 seconds setTimeout(function(){ // If the request is still running, abort it. if ( req ) req.abort(); }, 5000); - AJAX module: The public $.ajax API is now used internally (for $.get/$.post etc.); loading scripts works now much more reliably in all browsers (with the exception of Safari, which is a work in progress). - New global Ajax handler: ajaxSend - called before an Ajax request is sent. Example: Add extra headers to all Ajax requests using the ajaxSend event. $(document).ajaxSend(function(xhr){ xhr.setRequestHeader(X-Web-Request, MySite.com); }); Extensions to global Ajax handlers: ajaxSend, ajaxSuccess, ajaxError and ajaxComplete get XMLHttpRequest and settings passed as arguments. Example: Prevent any POST requests that are sending too much data. $(document).ajaxSend(function(xhr,options){ if ( options.type == POST options.data.length 1024 ) xhr.abort(); }); Example: Show a special message for requests submitted using an Ajax POST. $(#dataSent).ajaxSend(function(xhr,options){ if ( options.type == POST ) $(this).show(); }); Extensions to event handling: pageX and pageY are available in all browsers now. (IE does not provide native pageX/Y). Example: Have a tooltip follow a user's mouse around the page. $(document).mousemove(function(e){ $(#mousetip).css({ top: e.pageY + px, left: e.pageX + px }); }); Improved docs: $(String) method has now two separate descriptions, one for selecting elements, one for creating html on-the-fly. FX module: Most inline styles added by animations are now removed when the animation is complete, eg. height style when animating height (exception: display styles). (This message can also be found here: http://jquery.com/blog/2006/12/12/jquery-104/) --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
Have you double checked to make sure the widths are set correctly? Could be that when the buttons get longer/shorter, it bumps another button down to the next line? !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of jazzle Sent: Wednesday, December 13, 2006 4:25 AM To: discuss@jquery.com Subject: [jQuery] Show/Hide Buttons on one line I'm sure I must be missing something basic, but I cannot persuade buttons which I'm showing and hiding with jQ to stay on one line. It works fine with instant show/hide, but not with speeds (slow/medium/fast). Any ideas/hints/help will be appreciated, Jez -- View this message in context: http://www.nabble.com/Show-Hide-Buttons-on-one-line-tf2813143.html#a7850364 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
Andy Matthews schrieb: Hey John... In the API docs, is there any reason why EVERY one of the listings has the word jQuery before it? Isn't that rather redundant? That is how you know if a method is chainable or not. As most methods are it may seem redundant at first glance, but it isn't of course. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
I don't think that can be it - these are the only items on this line. Andy Matthews wrote: Have you double checked to make sure the widths are set correctly? Could be that when the buttons get longer/shorter, it bumps another button down to the next line? -- View this message in context: http://www.nabble.com/Show-Hide-Buttons-on-one-line-tf2813143.html#a7853795 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
I don't honestly think it'll help. The code is simple, just input type=button class=tohide ...input type=button class=tohide ... with jQ: $(.tohide).hide('slow'); Brandon Aaron wrote: Could you put together an example page? -- View this message in context: http://www.nabble.com/Show-Hide-Buttons-on-one-line-tf2813143.html#a7853847 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
I see now...apologies. !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Klaus Hartl Sent: Wednesday, December 13, 2006 8:25 AM To: jQuery Discussion. Subject: Re: [jQuery] jQuery 1.0.4 Released Andy Matthews schrieb: Hey John... In the API docs, is there any reason why EVERY one of the listings has the word jQuery before it? Isn't that rather redundant? That is how you know if a method is chainable or not. As most methods are it may seem redundant at first glance, but it isn't of course. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
In the process of animating, I think jQuery adds display:block to the inline style property. It probably doesn't do this with the instant show. My guess is this is what is happening. Joel. On 13/12/2006, at 9:24 PM, jazzle wrote: I'm sure I must be missing something basic, but I cannot persuade buttons which I'm showing and hiding with jQ to stay on one line. It works fine with instant show/hide, but not with speeds (slow/medium/fast). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
I'm sure I must be missing something basic, but I cannot persuade buttons which I'm showing and hiding with jQ to stay on one line. To use the effects jQuery has to make them block elements. Simple show/hide just changes display:none so it doesn't have the problem. Set up each button as a block element and lay them out using floats. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
Is there a changelog? John Resig wrote: Hi Everyone - Another fantastic release of jQuery is ready for your consumption. This release includes a number of bug fixes (as usual) along with some much-needed improvements to jQuery's Ajax functionality. As always, if you have any questions or concerns with new release, please feel free to discuss it on the mailing list. If you think you've spotted a bug, please add it to the bug tracker (http://jquery.com/dev/bugs/new/). So, without further ado, here's jQuery 1.0.4: Download - Compressed JavaScript (Recommended Download!) http://jquery.com/src/jquery-1.0.4.pack.js - Uncompressed JavaScript http://jquery.com/src/jquery-1.0.4.js - 1.0.4 Documentation http://jquery.com/api/ - 1.0.4 Test Suite http://jquery.com/test/ - Full Release (jQuery, Test Suite, Documentation) http://jquery.com/src/jquery-1.0.4.release.zip - Build Files (Compile your own version of jQuery 1.0.4) http://jquery.com/src/jquery-1.0.4.build.zip Changes and Features - Tons of bug fixes Full List: http://jquery.com/dev/bugs/10/?sort=ticketasc=0 - Extensions to $.ajax(): $.ajax accepts additional options: beforeSend, async and processData; returns XMLHttpRequest to allow manual aborting of requests, see docs for details. Example: Add extra headers to an Ajax request using beforeSend $.ajax({ type: POST, url: /files/add/, beforeSend: function(xhr) { xhr.setRequestHeader( Content-type, text/plain ); }, data: This is the contents of my text file. }); Example: Perform a synchronous Ajax request. // Get the HTML of a web page and save it // to a variable (the browser will freeze until the // entire request is completed). var html = $.ajax({ type: GET, url: test.html, async: false }).responseText; // Add the HTML into the page $(#list).html( html ); Example: Sending a JavaScript object using processData. // The data to send to the server var params = { name: John, city: Boston }; $.ajax({ type: POST, url: /user/add/, processData: params }); Example: Aborting an Ajax request after a specific delay in time. // Perform a simple Ajax request var req = $.ajax({ type: GET, url: /user/list/, success: function(data) { // Do something with the data... // Then remove the request. req = null; } }); // Wait for 5 seconds setTimeout(function(){ // If the request is still running, abort it. if ( req ) req.abort(); }, 5000); - AJAX module: The public $.ajax API is now used internally (for $.get/$.post etc.); loading scripts works now much more reliably in all browsers (with the exception of Safari, which is a work in progress). - New global Ajax handler: ajaxSend - called before an Ajax request is sent. Example: Add extra headers to all Ajax requests using the ajaxSend event. $(document).ajaxSend(function(xhr){ xhr.setRequestHeader(X-Web-Request, MySite.com); }); Extensions to global Ajax handlers: ajaxSend, ajaxSuccess, ajaxError and ajaxComplete get XMLHttpRequest and settings passed as arguments. Example: Prevent any POST requests that are sending too much data. $(document).ajaxSend(function(xhr,options){ if ( options.type == POST options.data.length 1024 ) xhr.abort(); }); Example: Show a special message for requests submitted using an Ajax POST. $(#dataSent).ajaxSend(function(xhr,options){ if ( options.type == POST ) $(this).show(); }); Extensions to event handling: pageX and pageY are available in all browsers now. (IE does not provide native pageX/Y). Example: Have a tooltip follow a user's mouse around the page. $(document).mousemove(function(e){ $(#mousetip).css({ top: e.pageY + px, left: e.pageX + px }); }); Improved docs: $(String) method has now two separate descriptions, one for selecting elements, one for creating html on-the-fly. FX module: Most inline styles added by animations are now removed when the animation is complete, eg. height style when animating height (exception: display styles). (This message can also be found here: http://jquery.com/blog/2006/12/12/jquery-104/) --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Using JQuery to manipulate href (URL params)
On 12/12/06, Robert James [EMAIL PROTECTED] wrote: 2. How do I use JQuery to manipulate hrefs? there are a number of security locks on modern browsers that don't allow dynamic manipulation of href. I haven't looked at your example in detail so I am not sure you will run into it, but a lot of basic code that would work with even 4.0 browsers no longer work to avoid spoofing attackes etc. This includes changing the href and status text dynamically. So be warned about odd behavior, with dom and href's. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
Happy dance, happy dance. Thank you all for this. Your efforts are truly appreciated. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Resig Sent: Tuesday, December 12, 2006 5:44 PM To: jQuery Discussion. Subject: [jQuery] jQuery 1.0.4 Released Hi Everyone - Another fantastic release of jQuery is ready for your consumption. This release includes a number of bug fixes (as usual) along with some much-needed improvements to jQuery's Ajax functionality. As always, if you have any questions or concerns with new release, please feel free to discuss it on the mailing list. If you think you've spotted a bug, please add it to the bug tracker (http://jquery.com/dev/bugs/new/). So, without further ado, here's jQuery 1.0.4: Download - Compressed JavaScript (Recommended Download!) http://jquery.com/src/jquery-1.0.4.pack.js - Uncompressed JavaScript http://jquery.com/src/jquery-1.0.4.js - 1.0.4 Documentation http://jquery.com/api/ - 1.0.4 Test Suite http://jquery.com/test/ - Full Release (jQuery, Test Suite, Documentation) http://jquery.com/src/jquery-1.0.4.release.zip - Build Files (Compile your own version of jQuery 1.0.4) http://jquery.com/src/jquery-1.0.4.build.zip Changes and Features - Tons of bug fixes Full List: http://jquery.com/dev/bugs/10/?sort=ticketasc=0 - Extensions to $.ajax(): $.ajax accepts additional options: beforeSend, async and processData; returns XMLHttpRequest to allow manual aborting of requests, see docs for details. Example: Add extra headers to an Ajax request using beforeSend $.ajax({ type: POST, url: /files/add/, beforeSend: function(xhr) { xhr.setRequestHeader( Content-type, text/plain ); }, data: This is the contents of my text file. }); Example: Perform a synchronous Ajax request. // Get the HTML of a web page and save it // to a variable (the browser will freeze until the // entire request is completed). var html = $.ajax({ type: GET, url: test.html, async: false }).responseText; // Add the HTML into the page $(#list).html( html ); Example: Sending a JavaScript object using processData. // The data to send to the server var params = { name: John, city: Boston }; $.ajax({ type: POST, url: /user/add/, processData: params }); Example: Aborting an Ajax request after a specific delay in time. // Perform a simple Ajax request var req = $.ajax({ type: GET, url: /user/list/, success: function(data) { // Do something with the data... // Then remove the request. req = null; } }); // Wait for 5 seconds setTimeout(function(){ // If the request is still running, abort it. if ( req ) req.abort(); }, 5000); - AJAX module: The public $.ajax API is now used internally (for $.get/$.post etc.); loading scripts works now much more reliably in all browsers (with the exception of Safari, which is a work in progress). - New global Ajax handler: ajaxSend - called before an Ajax request is sent. Example: Add extra headers to all Ajax requests using the ajaxSend event. $(document).ajaxSend(function(xhr){ xhr.setRequestHeader(X-Web-Request, MySite.com); }); Extensions to global Ajax handlers: ajaxSend, ajaxSuccess, ajaxError and ajaxComplete get XMLHttpRequest and settings passed as arguments. Example: Prevent any POST requests that are sending too much data. $(document).ajaxSend(function(xhr,options){ if ( options.type == POST options.data.length 1024 ) xhr.abort(); }); Example: Show a special message for requests submitted using an Ajax POST. $(#dataSent).ajaxSend(function(xhr,options){ if ( options.type == POST ) $(this).show(); }); Extensions to event handling: pageX and pageY are available in all browsers now. (IE does not provide native pageX/Y). Example: Have a tooltip follow a user's mouse around the page. $(document).mousemove(function(e){ $(#mousetip).css({ top: e.pageY + px, left: e.pageX + px }); }); Improved docs: $(String) method has now two separate descriptions, one for selecting elements, one for creating html on-the-fly. FX module: Most inline styles added by animations are now removed when the animation is complete, eg. height style when animating height (exception: display styles). (This message can also be found here: http://jquery.com/blog/2006/12/12/jquery-104/) --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Apps used to reply to this list
Hi Mike, I'm using TB 1.5.0.8 as well (though on a PC, so I'm not sure this will be of great help), and I just use the Reply to Sender Only option. It sends the email to discuss@jquery.com, and everything seems to go smoothly. Cheers, Chris Michael Holloway wrote: Hi people, I seem to have problems creating a reply to the messages on this list, whenever I post a reply, it always creates a new thread rather than continue another, I'm using Thunderbird 1.5.0.8 on the mac. Does anyone else use this program/version and can tell me what I'm doing wrong. If not, can people tell me which app. they use so I can make a switch. Cheers, Mike. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
On 12/13/06, jazzle [EMAIL PROTECTED] wrote: I don't honestly think it'll help. Nonsense, it does help and it helps to help those who want to help. It allows those willing to help with limited time to just check out the example in firebug. I was first thinking it would be display: block also but the fx .show/.hide methods use the same logic the normal .show/.hide metheds (both .show methods set display 'block'). So, there is something else causing the problem ... thus the reason for an example page so that I can check the properties quickly in firebug. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
Brandon Aaron wrote: On 12/13/06, jazzle [EMAIL PROTECTED] wrote: I don't honestly think it'll help. Nonsense, it does help and it helps to help those who want to help. That's why I did include some code. It was as dave suggested (http://www.nabble.com/Re%3A-Show-Hide-Buttons-on-one-line-p7854197.html). Simply float: lefting the buttons solved the problem. -- View this message in context: http://www.nabble.com/Show-Hide-Buttons-on-one-line-tf2813143.html#a7855077 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] interesting background issue in FF 2
Just a follow up, I made a bunch of changes to the style sheet, assuming it has something todo with background images, and still no luck. Attached is what I am seeing. thanks http://www.nabble.com/file/4566/Untitled-1.png -- View this message in context: http://www.nabble.com/interesting-background-issue-in-FF-2-tf2808387.html#a7855172 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] (Half-OffTopic) jQuery Firebug
Hi all, Sorry if this thread is partly offtopic, but anyone here knows if there's an easy way to populate jScript in a external webpage in order to use it in firebug ? Let's say i'm on google.com and I would like to make some research on their page, using jQuery in the firebug console would be handy. I know it's possible with greasemonkey but I wonder if there's an easier way to do this ? -- Fabien Meghazi Website: http://www.amigrave.com Email: [EMAIL PROTECTED] IM: [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] (Half-OffTopic) jQuery Firebug
Let's say i'm on google.com and I would like to make some research on their page, using jQuery in the firebug console would be handy. I know it's possible with greasemonkey but I wonder if there's an easier way to do this ? Here's an example. Type the following into the firebug console: var s = document.createElement('script'); s.src='http://jquery.com/src/jquery-1.0.4.js'; document.body.appendChild(s); Then do whatever you want with jq. For example: alert($('div').size()); Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] mirror of dean edwards packer anywhere?
Anybody know a mirror of dean edwards packer? The .NET application doesn have thesame compression results. Thanx Gilles ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
On 12/13/06, Dave Methvin [EMAIL PROTECTED] wrote: ... the fx .show/.hide methods use the same logic as the normal .show/.hide metheds (both .show methods set display 'block'). The non-fx show/hide try to preserve the original display value: show: function(){ this.style.display = this.oldblock ? this.oldblock : ; if ( jQuery.css(this,display) == none ) this.style.display = block; }, hide: function(){ this.oldblock = this.oldblock || jQuery.css(this,display); if ( this.oldblock == none ) this.oldblock = block; this.style.display = none; }, There could be problems if someone used the fx hide and the standard show or vice versa, since fx doesn't use oldblock. In the fx module the display property is stored as oldblock, then set to display: block and then finally reverted if it is not a 'hide' type animation. I am not sure why .show even needs that extra check for display:none; how could it be none when it was set on the line above and .hide() makes sure it isn't none as well? Nothing else in jQuery seems to mess with oldblock. If the stylesheet says that the element is display: none by default, then the check becomes necessary. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Width + Height of a Media
Hi All, i would load a Video on a Page after click a Link, works fine. What can i do, the width and height is not known. This is my Code: $(#content).append(object id='wmv' type='video/x-ms-wmv' width='' height='' data='+url+' and so on I must have the width and height of the File that saved under 'url' Is there a way? -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] iResizable with multiple resize problem
Hi all, I went through some issues with the iResizable plug-in, especially when dealing with multiple resizable instances. I already filed a bug some time ago (http://jquery.com/dev/bugs/bug/478/), but I would be interested in knowing if anybody has found workarounds to that. You can find a test case here http://svn.project-ojibwe.org/~sebastien/ iresize/resizable-bug.html. Thanks ! -- Sébastien ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] (Half-OffTopic) jQuery Firebug
var s = document.createElement('script'); s.src='http://jquery.com/src/jquery-1.0.4.js'; document.body.appendChild(s); Thanks ! I didn't knew the dom createElement's way would imply the load, parse and execution of a remote script. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
In the fx module the display property is stored as oldblock, then set to display: block and then finally reverted if it is not a 'hide' type animation. As I've confessed before, the fx code is a total mystery to me. I just searched the source for references to oldblock and assumed it wasn't used since I didn't find any. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] New Site: Hope Cottage
We just launched a new site that uses jQuery. http://www.hopecottage.org/ -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] New Site: Hope Cottage
On 13/12/06, Brandon Aaron [EMAIL PROTECTED] wrote: We just launched a new site that uses jQuery. http://www.hopecottage.org/ -- Brandon Aaron You don't get anything on the home page with JavaScript disabled, but the top links still work (so technically still accessible, but less search engine friendly). I notice you are using an SVN revision (585) after 1.0.3 and before 1.0.4 Does it use a CMS like Drupal or RoR? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Anyone who has experience with libraries other than JQ
Head over to WASP and chime in with any relevant thoughts. I'm sure they don't want their board spammed so please make it relevant to the article if you have any thoughts that pertain (I think JQuery's solution addresses them well). http://www.webstandards.org/2006/12/12/reducing-the-pain-of-adopting-a-javascript-library/ -- View this message in context: http://www.nabble.com/Anyone-who-has-experience-with-libraries-other-than-JQ-tf2815416.html#a7857246 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] mirror of dean edwards packer anywhere?
On Dec 13, 2006, at 18:16, Webunity|Gilles van den Hoven wrote: Anybody know a mirror of dean edwards packer? The .NET application doesn have thesame compression results. Not a mirror, but I use this from commandline: http://homepages.nildram.co.uk/~9jack9/download/packer.perl.zip -- Mika Tuupola http://www.appelsiini.net/~tuupola/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] mirror of dean edwards packer anywhere?
If you download the jQuery source, you'll find the packer.js file, the javascript.jar and the associated ant build files to run the packer. Take a look at the pack.js file in the build directory. Rich On 12/13/06, Webunity | Gilles van den Hoven [EMAIL PROTECTED] wrote: Anybody know a mirror of dean edwards packer? The .NET application doesn have thesame compression results. Thanx Gilles ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Check element visibility
Hello all, How can I check if a given element is visible or not (i.e. has display:block). I have the folowing situatioin - I need to hide all li class=label elements that have ALL their li class=clearfix descendant hidden. (if one or more of the li class=clearfix descendants is visible, then the label must stay visible). I intend to do sometning like that: $(div.specifications li.label).each(function() { to_hide = 1; $( li.clearfix, this).each(function() { if($(this).IS_VISIBLE to_hide = 0; }) if($.trim(this.innerHTML) == 'nbsp;') $(this).parent().parent().toggle(); if(to_hide) { $(this).hide(); } }) What might IS_VISIBLE be ? Any hints ? -- Best regards, Stoyan mailto:[EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] (Half-OffTopic) jQuery Firebug
You could also add a bookmarklet to Firefox's Bookmarks Toolbar Folder. Then, whenever you see a page you'd like to play with using jQuery and Firebug, just click the bookmarklet and you're ready to go. javascript:var%20s=document.createElement('script');s.setAttribute ('src',%20'http://jquery.com/src/ jquery-1.0.4.js');document.getElementsByTagName('body')[0].appendChild (s);alert('thank you for using jquery!');void(s); That should be all on one line. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Dec 13, 2006, at 11:49 AM, Fabien Meghazi wrote: var s = document.createElement('script'); s.src='http://jquery.com/src/jquery-1.0.4.js'; document.body.appendChild(s); Thanks ! I didn't knew the dom createElement's way would imply the load, parse and execution of a remote script. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] mirror of dean edwards packer anywhere?
Here is the php version. http://joliclic.free.fr/php/javascript-packer/en/index.php On 12/13/06, Webunity | Gilles van den Hoven [EMAIL PROTECTED] wrote: Anybody know a mirror of dean edwards packer? The .NET application doesn have thesame compression results. Thanx Gilles ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
Peter Bengtsson schrieb: Is there a changelog? There is a newandnoteworthy.txt in SVN. It is not the same as a changelog, as it doesn't cover bugs like typos, missing characters etc. -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Check element visibility
$(p).css(display); !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of fullgarbage Sent: Wednesday, December 13, 2006 12:14 PM To: discuss@jquery.com Subject: [jQuery] Check element visibility Hello all, How can I check if a given element is visible or not (i.e. has display:block). I have the folowing situatioin - I need to hide all li class=label elements that have ALL their li class=clearfix descendant hidden. (if one or more of the li class=clearfix descendants is visible, then the label must stay visible). I intend to do sometning like that: $(div.specifications li.label).each(function() { to_hide = 1; $( li.clearfix, this).each(function() { if($(this).IS_VISIBLE to_hide = 0; }) if($.trim(this.innerHTML) == 'nbsp;') $(this).parent().parent().toggle(); if(to_hide) { $(this).hide(); } }) What might IS_VISIBLE be ? Any hints ? -- Best regards, Stoyan mailto:[EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Show/Hide Buttons on one line
Dave Methvin schrieb: In the fx module the display property is stored as oldblock, then set to display: block and then finally reverted if it is not a 'hide' type animation. As I've confessed before, the fx code is a total mystery to me. I just searched the source for references to oldblock and assumed it wasn't used since I didn't find any. There was an issue where show was called more then once, therefore an additional check concerning oldblock was necessary. But that was half a year ago, dunno if that is really necessary what's in there now. -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] New Site: Hope Cottage
Hey, I like the main effect in the homepage, it's pretty cool. Btw, I saw some accesibility problems you would like to fix. The homepage doesn't show the sublinks or the middle content if the javascript is disabled. The same happens with the sitemap. Cheers On 12/13/06, Brandon Aaron [EMAIL PROTECTED] wrote: We just launched a new site that uses jQuery. http://www.hopecottage.org/ -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Check element visibility
fullgarbage schrieb: Hello all, How can I check if a given element is visible or not (i.e. has display:block). You can use $(...).is(:visible) Details for :visible can be found here: http://jquery.com/docs/Base/Expression/Custom/ -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] (Half-OffTopic) jQuery Firebug
wow, that's a nice bookmarklet. Thanks for that! On 12/13/06, Karl Swedberg [EMAIL PROTECTED] wrote: You could also add a bookmarklet to Firefox's Bookmarks Toolbar Folder. Then, whenever you see a page you'd like to play with using jQuery and Firebug, just click the bookmarklet and you're ready to go. javascript:var%20s=document.createElement ('script');s.setAttribute('src',%20' http://jquery.com/src/jquery-1.0.4.js');document.getElementsByTagName('body')[0].appendChild(s);alert('thankhttp://jquery.com/src/jquery-1.0.4.js%27%29;document.getElementsByTagName%28%27body%27%29%5B0%5D.appendChild%28s%29;alert%28%27thankyou for using jquery!');void(s); That should be all on one line. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Dec 13, 2006, at 11:49 AM, Fabien Meghazi wrote: var s = document.createElement('script'); s.src='http://jquery.com/src/jquery-1.0.4.js'http://jquery.com/src/jquery-1.0.4.js%27 ; document.body.appendChild(s); Thanks ! I didn't knew the dom createElement's way would imply the load, parse and execution of a remote script. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] New Site: Hope Cottage
On 12/13/06, Sam Collett [EMAIL PROTECTED] wrote: On 13/12/06, Brandon Aaron [EMAIL PROTECTED] wrote: We just launched a new site that uses jQuery. http://www.hopecottage.org/ -- Brandon Aaron You don't get anything on the home page with JavaScript disabled, but the top links still work (so technically still accessible, but less search engine friendly). I notice you are using an SVN revision (585) after 1.0.3 and before 1.0.4 Hmm... the content is still there and readable to the search engine but doesn't show up. JavaScript disabled will sometimes take a backseat in favor of the timeline. :/ However, markup/css/javascript is always approached from the ground up. Meaning the content is there and then is progressively enhanced. The About FAQs also need some attention when JavaScript is turned off ... but the answers are in the markup. Opera needs a little work too. :) I should have mentioned that the site is still being worked on. The handheld and print styles are being added as well as upgrading to the 1.0.4 release. I should also mention that I'm not the one who built this site. Does it use a CMS like Drupal or RoR? It uses a custom CMS built with RoR. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Check element visibility
On Dec 13, 2006, at 1:14 PM, fullgarbage wrote: Hello all, How can I check if a given element is visible or not (i.e. has display:block). I have the folowing situatioin - I need to hide all li class=label elements that have ALL their li class=clearfix descendant hidden. (if one or more of the li class=clearfix descendants is visible, then the label must stay visible). I intend to do sometning like that: $(div.specifications li.label).each(function() { to_hide = 1; $( li.clearfix, this).each(function() { if($(this).IS_VISIBLE to_hide = 0; }) if($.trim(this.innerHTML) == 'nbsp;') $(this).parent ().parent().toggle(); if(to_hide) { $(this).hide(); } }) What might IS_VISIBLE be ? Any hints ? Hi Stoyan, You could try this: if ( $(this).is(':visible') ) { // your code } If you're just trying to gather elements that are visible, you could do something like this, too: $('li.clearfix:visible', this).hide(); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Check element visibility
$(':visible', this).length == 0 (Or 1, if the root of the context is returned, which I'm not sure of.) Note: This will be kind of inefficient if you're working with a big DOM tree. - Brian Hello all, How can I check if a given element is visible or not (i.e. has display:block). I have the folowing situatioin - I need to hide all li class=label elements that have ALL their li class=clearfix descendant hidden. (if one or more of the li class=clearfix descendants is visible, then the label must stay visible). I intend to do sometning like that: $(div.specifications li.label).each(function() { to_hide = 1; $( li.clearfix, this).each(function() { if($(this).IS_VISIBLE to_hide = 0; }) if($.trim(this.innerHTML) == 'nbsp;') $(this).parent().parent().toggle(); if(to_hide) { $(this).hide(); } }) What might IS_VISIBLE be ? Any hints ? -- Best regards, Stoyan mailto:[EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Function: $(...).ancestorsTo(match)
I wrote a method that will provide a list of ancestors for any number of generations until an ancestor matches the expression. Example: BODY DIV UL.myClass LI UL LI #myId $('#myId').ancestors() returns [UL, LI, UL.myClass, DIV, BODY] $('#myId').ancestors(UL.myClass) returns [UL.myClass] Returns all elements up to and including the match expression $('#myId').ancestorsTo(UL.myClass) returns [UL, LI, UL.myClass] Code: jQuery.fn.ancestorsTo = function(match) { var j = $(); var b = false; $(this[0]).ancestors().each(function() { if (b == false) { j.add(this); if ($(this).is(match)) { b = true; } } }); return j; }; Cheers, -js ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
$(this)[0] is never needed as 'this = $(this)[0]' when in an 'each' loop (or binding on an event, callbacks in plugins etc). I was simply speculating what would have happened if this had been designated a jQuery object. Hence this[0] would give you the DOM node. Read the whole thread :) Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Function: $(...).ancestorsTo(match)
plugin devs should remember: Never use $ inside your plugins. Always use 'jQuery'. The reason is that '$' can be changed by the user for support with other libraries. On 12/13/06, Jonathan Sharp [EMAIL PROTECTED] wrote: I wrote a method that will provide a list of ancestors for any number of generations until an ancestor matches the expression. Example: BODY DIV UL.myClass LI UL LI #myId $('#myId').ancestors() returns [UL, LI, UL.myClass, DIV, BODY] $('#myId').ancestors(UL.myClass) returns [UL.myClass] Returns all elements up to and including the match expression $('#myId').ancestorsTo(UL.myClass) returns [UL, LI, UL.myClass] Code: jQuery.fn.ancestorsTo = function(match) { var j = $(); var b = false; $(this[0]).ancestors().each(function() { if (b == false) { j.add(this); if ($(this).is(match)) { b = true; } } }); return j; }; Cheers, -js ___ jQuery mailing list discuss@jquery.comhttps://mail.google.com/mail?view=cmtf=0[EMAIL PROTECTED] http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] quick quesiton for Felix re: cakePHP
Felix, I noticed on another thread that you work with cakePHP, I am trying to get my head around it, but not quite there. Can you recommend any good forums and tutorials (not digging the bakery.cakephp.org too much) to help me on my way. Thanks Benjamin -- View this message in context: http://www.nabble.com/quick-quesiton-for-Felix-re%3A-cakePHP-tf2817293.html#a7863348 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] One more mention of Jquery
On this page http://www.webtuesday.ch/meetings/20061010, go to pro-js.pdf On 3rd page is sexy on-liner...___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Function: $(...).ancestorsTo(match)
Hello Jonathan, Wednesday, December 13, 2006, 11:47:37 PM, you wrote: I wrote a method that will provide a list of ancestors for any number of generations until an ancestor matches the expression. Example: BODY DIV UL.myClass LI UL LI #myId $('#myId').ancestors() returns [UL, LI, UL.myClass, DIV, BODY] $('#myId').ancestors(UL.myClass) returns [UL.myClass] Returns all elements up to and including the match expression $('#myId').ancestorsTo(UL.myClass) returns [UL, LI, UL.myClass] Code: jQuery.fn.ancestorsTo = function(match) { var j = $(); var b = false; $(this[0]).ancestors().each(function() { if (b == false) { j.add(this); if ($(this).is(match)) { b = true; } } }); return j; }; Cheers, -js Very userfull indeed. -- Best regards, Stoyan mailto:[EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] unload and unload
I think people were leaning towards removing the shortcuts from the core and putting them into their own plugin, but I could be wrong about that. --Aaron On 12/13/06, Karl Swedberg [EMAIL PROTECTED] wrote: I think the decision about what to do with the shortcuts has not been finalized yet. Whatever happens to the other shortcuts, .toggle() and .hover() are going to stick around, because they're special cases. I'd be surprised if .click() went away anytime soon. It's just too quick, useful, and ubiquitous to get rid of it. Of course, none of these decisions are up to me, so take what I say with a grain of salt. However, a recent chat with John Resig led me to believe that .click() wasn't going to be relegated to a plugin, at least not in 1.1. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Width + Height of a Media
You could put the size in the url (i.e. url?width=xxxheight=yyy) and then parse out the values on click. function getParams(url) { var params=[]; $.each(href.split(/(?|)/),function(i,s){ var pair = s.split(=) if (pair.length==2) params[pair[0]]=pair[1]; }) return params; }; $(a).bind(click,function(){ var vidparams=getParams(this.href); $(#content).append(object id='wmv' type='video/x-ms-wmv' width='+( vidparams.width||)+' height='+(vidparams.height||)+' data='+url+' }); Blair On 12/14/06, Olaf Bosch [EMAIL PROTECTED] wrote: Hi All, i would load a Video on a Page after click a Link, works fine. What can i do, the width and height is not known. This is my Code: $(#content).append(object id='wmv' type='video/x-ms-wmv' width='' height='' data='+url+' and so on I must have the width and height of the File that saved under 'url' Is there a way? -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Finished: jQuery code assist in Aptana
Hi, I like jQuery and I like Aptana and was very frustrated jQuery didn't had code assist (auto-completion) in Aptana. And I think I'm not the only one :-) I created the scriptdoc-file needed for code assist in Aptana. You can download it here: http://www.bitstorm.org/edwin/jquery/ It's all quite new, so it might not work 100%. Please share your experiences. Edwin Martin -- http://www.bitstorm.org/edwin/en/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Select All elements between clicks? need help please
I have been trying to do a inline calendar for a client where you select the arrival date and then departure date and once the second click is registered in gives me an array of elemets between the two depending on class and highlights those spaces if there available. some code here at present : http://clients.ozdesign.com/104/book.php This is a work in progress, whilst trying to understand jquery more. -- View this message in context: http://www.nabble.com/Select-All-elements-between-clicks--need-help-please-tf2817436.html#a7863807 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Select All elements between clicks? need help please
// declare dates here for access by all events var firstdateel=false; var lastdateel=false; // or you could select hidden input elements and use those var $firstdate = $(input); var $lastdate = $(input); // select all dates var $dates=$(td.selectabledate); // declare the range variable for access by all events var $range=$(noelements); // deliberately select no elements // attach the click event $dates.click(function(){ // if firstdateel is unset or lastdateel is set, then start a new range if (!firstdateel || lastdateel) { firstdateel=this; lastdateel=null; // Do stuff to previous $range (if there was a previous selection, you'll probably want to unhighlight it before resetting it) $range=$(noelements); // Starting new date range, do stuff to update ui } else { lastdateel=this; var $range=$($dates).lt($dates.index(lastdateel)+1); // filter out dates after the last one $range=$range.gt($dates.index(firstdateel)-1); // filter out dates before first one // Finished selecting range, do stuff to update ui } }); Blair On 12/14/06, mylocal [EMAIL PROTECTED] wrote: I have been trying to do a inline calendar for a client where you select the arrival date and then departure date and once the second click is registered in gives me an array of elemets between the two depending on class and highlights those spaces if there available. some code here at present : http://clients.ozdesign.com/104/book.php This is a work in progress, whilst trying to understand jquery more. -- View this message in context: http://www.nabble.com/Select-All-elements-between-clicks--need-help-please-tf2817436.html#a7863807 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is it a bug
Thanks. i put form element outsidest:) On 12/13/06, Karl Swedberg [EMAIL PROTECTED] wrote: Johnny, If you really need that table in there, try rearranging your HTML so that the form element is inside one of the table's cells: table tbody tr td form ... /form /td /tr /tbody /table --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Dec 13, 2006, at 4:58 AM, Michael Holloway wrote: if the form like this: table form tbodytbody /form /table The table does not display in firefox(i use ff2.0), but it's ok in IE. and i can find the table of dom from DOM inspector add-on, it does exists!! i try some lots of ways to find what happened. And last i find. if html like this: formtabletbodytbody/table /form Hi Johnny, Your first code example is incorrect html markup, the second method is better. This is not a bug in jQuery. Cheers, Mike. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] MetaData plugin - help needed
Hi all, I'm having a problem with John's metadata plugin. The value of the parameter arr in the jQuery.fn.get function in metadata.jsis always undefined, so at this point: return arr arr.constructor == Array ? it never branches towards the metadata logic, hence I can never access metadata properties. To ascertain this I slapped a $.log(arr) immediately after the beginning of the function, but every single jquery query is spitting out undefined at this point. What is the arr parameter, and why would mine always be undefined? Regards, Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] MetaData plugin - help needed
Could you give an example of how you're trying to access the metadata? --Erik On 12/13/06, Chris Domigan [EMAIL PROTECTED] wrote: Hi all, I'm having a problem with John's metadata plugin. The value of the parameter arr in the jQuery.fn.get function in metadata.js is always undefined, so at this point: return arr arr.constructor == Array ? it never branches towards the metadata logic, hence I can never access metadata properties. To ascertain this I slapped a $.log(arr) immediately after the beginning of the function, but every single jquery query is spitting out undefined at this point. What is the arr parameter, and why would mine always be undefined? Regards, Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] MetaData plugin - help needed
I've tried lots of ways: given: td class=blah data={foo:'bar'}/td $(td.blah).get(0).foo; $(td.blah).each(function() { this.foo; }); $(td.blah).each(function() { $(this)[0].foo; }); The point is though, that EVERY jquery query on my page, regardless of whether or not I'm accessing a metadata attribute, is passing undefined to the jQuery.fn.get function defined in the metadata plugin, so it's not even getting so far as CHECKING whether there is metadata or not. Therefore the way in which I'm accessing the metadata seems to be moot at present. Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] missing ; before statement
I have just downloaded the latest and greatest and now am getting this strange error message in firebug: missing ; before statement jquery.js (line 1933) div class=buttonpanel_frontpage h1 class=contentheading_frontpage line 1933 in jquery is: 1931 // evaluate scripts within html 1932 if ( type == html ) $(div).html(data).evalScripts(); 1933 1934 return data; I wasn't getting this error with the previous version. Suggestions? Leonie -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7866329 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
Sounds like you have a custom script being loaded in by ajax, eg .load() and eval'd which is throwing the error. Any syntax errors in your custom script? Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
Chris Domigan wrote: Sounds like you have a custom script being loaded in by ajax, eg .load() and eval'd which is throwing the error. Any syntax errors in your custom script? This is the offending code: function updateSectionForm(sectionidVal) { $.getJSON(index2.php, {no_html:1, task:getsection, sectionid:sectionidVal } ); } -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7866521 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
A Google search for missing ; before statement yields: http://www.google.com/search?client=firefox-arls=org.mozilla%3Aen-US%3Aofficial_shl=enq=%22missing+%3B+before+statement%22btnG=Google+Search The first hit is this: http://www.webdeveloper.com/forum/archive/index.php/t-28861.html The last post says this: I've found the problem...wouldn't take 1_2, 2_2, etc... as a value for my hidden feild... I notice your code also has an underscore in a parameter name. Maybe try removing the underscore? --Erik On 12/13/06, Mungbeans [EMAIL PROTECTED] wrote: Chris Domigan wrote: Sounds like you have a custom script being loaded in by ajax, eg .load() and eval'd which is throwing the error. Any syntax errors in your custom script? This is the offending code: function updateSectionForm(sectionidVal) { $.getJSON(index2.php, {no_html:1, task:getsection, sectionid:sectionidVal } ); } -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7866521 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] MetaData plugin - help needed
I can confirm that the metadata plugin doesn't work with 1.0.4. It works fine with 1.0.3 though. --Erik On 12/13/06, Chris Domigan [EMAIL PROTECTED] wrote: I've tried lots of ways: given: td class=blah data={foo:'bar'}/td $(td.blah).get(0).foo; $(td.blah).each(function() { this.foo; }); $(td.blah).each(function() { $(this)[0].foo; }); The point is though, that EVERY jquery query on my page, regardless of whether or not I'm accessing a metadata attribute, is passing undefined to the jQuery.fn.get function defined in the metadata plugin, so it's not even getting so far as CHECKING whether there is metadata or not. Therefore the way in which I'm accessing the metadata seems to be moot at present. Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] MetaData plugin - help needed FIXED
The functionality of the get method that the metadata plugin overloads is split out into a set method in 1.0.4. Just change the matadata plugin to overload set instead of get, so it looks like this: jQuery.fn._set = jQuery.fn.set; jQuery.fn.set = function(arr){ var result = this._set.apply( this, arguments ); ... Should this be filed as a bug report, or is the matadata plugin not official? --Erik On 12/13/06, Erik Beeson [EMAIL PROTECTED] wrote: I can confirm that the metadata plugin doesn't work with 1.0.4. It works fine with 1.0.3 though. --Erik On 12/13/06, Chris Domigan [EMAIL PROTECTED] wrote: I've tried lots of ways: given: td class=blah data={foo:'bar'}/td $(td.blah).get(0).foo; $(td.blah).each(function() { this.foo; }); $(td.blah).each(function() { $(this)[0].foo; }); The point is though, that EVERY jquery query on my page, regardless of whether or not I'm accessing a metadata attribute, is passing undefined to the jQuery.fn.get function defined in the metadata plugin, so it's not even getting so far as CHECKING whether there is metadata or not. Therefore the way in which I'm accessing the metadata seems to be moot at present. Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
Erik Beeson wrote: I notice your code also has an underscore in a parameter name. Maybe try removing the underscore? Just realised you mean the parameters to the function. If I include a callback function into the JSON call, eg: $.getJSON(index2.php, {no_html:1, task:getsection, option:com_gravesearch, sectionid:sectionidVal }, function(json){ alert(json); } ); Unfortunately, removing these underscores is not an option as they appear throughout the code of the main program. I have been using these values with a lot of $.load calls without any problems. -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7867250 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
If I include a callback function into the JSON call, eg: $.getJSON(index2.php, {no_html:1, task:getsection, option:com_gravesearch, sectionid:sectionidVal }, function(json){ alert(json); } ); Then I get the error message: missing ; before statement jquery.js (line 1931) select name=regionid id=regionid class=selectbox size=1 You still have no_html with an underscore... --Erik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
Could you try removing it just to see if that fixes the error? Does the same thing happen in IE? --Erik On 12/13/06, Mungbeans [EMAIL PROTECTED] wrote: Erik Beeson wrote: I notice your code also has an underscore in a parameter name. Maybe try removing the underscore? Just realised you mean the parameters to the function. If I include a callback function into the JSON call, eg: $.getJSON(index2.php, {no_html:1, task:getsection, option:com_gravesearch, sectionid:sectionidVal }, function(json){ alert(json); } ); Unfortunately, removing these underscores is not an option as they appear throughout the code of the main program. I have been using these values with a lot of $.load calls without any problems. -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7867250 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
This is a bit of a long shot but have you tried quoting the hash keys? As in instead of: no_html:1 Try: no_html:1 In theory you should do always so that so as not to get into problems with keys that are also defined elsewhere. Karl Rudd On 12/14/06, Mungbeans [EMAIL PROTECTED] wrote: Erik Beeson wrote: I notice your code also has an underscore in a parameter name. Maybe try removing the underscore? Just realised you mean the parameters to the function. If I include a callback function into the JSON call, eg: $.getJSON(index2.php, {no_html:1, task:getsection, option:com_gravesearch, sectionid:sectionidVal }, function(json){ alert(json); } ); Unfortunately, removing these underscores is not an option as they appear throughout the code of the main program. I have been using these values with a lot of $.load calls without any problems. -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7867250 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
Erik Beeson wrote: You still have no_html with an underscore... I temporarily removed the underscore and then got a message that indicated that the problem was with my php code. Once I fixed that (and put the underscore in no_html back) the query ran without an error. Now all I have to do is work out out to parse the JSON data into the form.. I'm seriously thinking of stipulating that they put Nothing is easy on my gravestone.l -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7867424 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] missing ; before statement
Have a look at the various form plugins. The normal forms one will pull all the form data into a hash, but there's another one that will do the reverse. Blair On 12/14/06, Mungbeans [EMAIL PROTECTED] wrote: Erik Beeson wrote: You still have no_html with an underscore... I temporarily removed the underscore and then got a message that indicated that the problem was with my php code. Once I fixed that (and put the underscore in no_html back) the query ran without an error. Now all I have to do is work out out to parse the JSON data into the form.. I'm seriously thinking of stipulating that they put Nothing is easy on my gravestone.l -- View this message in context: http://www.nabble.com/missing---before-statement-tf2818327.html#a7867424 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] MetaData plugin - help needed FIXED
On 12/13/06, Erik Beeson [EMAIL PROTECTED] wrote: Should this be filed as a bug report, or is the matadata plugin not official? It couldn't hurt to submit a bug report for it. I see bugs for plugins, like Interface, posted there occassionally. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Select All elements between clicks? need help please
Thanks Blair. I have it nearly working correctly just one hiccup when you select the arrivaldate that is greater than the first date it highlights from the beginning to the departure date, though if you select again without clearing fields it works correctly. my code -- var arrivaldate=false; var departuredate=false; var $dates=$(.apt td).not(.past); var $range = false; // deliberately select no elements $dates.click( function() { if ($([EMAIL PROTECTED]).val() != '') { if (compareDates($([EMAIL PROTECTED]).val(),'-M-d', this.title,'-M-d' ) || this.title == $([EMAIL PROTECTED]).val()) { var $range=false; // deliberately select no elements arrivaldate=this; departuredate=null; $(.apt td).removeClass(selected); $([EMAIL PROTECTED]).val(''); } else { departuredate=this; var $range=$($dates).lt($dates.index(departuredate)+1); $range=$range.gt($dates.index(arrivaldate)-1); $([EMAIL PROTECTED]).val(departuredate.title); } $([EMAIL PROTECTED]).val(arrivaldate.title); $(arrivaldate).addClass(selected); } else { arrivaldate=this.title; departuredate=null; $(arrivaldate).addClass(selected); $([EMAIL PROTECTED]).val(arrivaldate); $(div.message h3).html('Please Select Departure Date'); } if ($range) { $(.apt td).removeClass(selected); $($range).addClass(selected); } else { $(.apt td).removeClass(selected); } }); --- Blair McKenzie-2 wrote: // declare dates here for access by all events var firstdateel=false; var lastdateel=false; // or you could select hidden input elements and use those var $firstdate = $(input); var $lastdate = $(input); // select all dates var $dates=$(td.selectabledate); // declare the range variable for access by all events var $range=$(noelements); // deliberately select no elements // attach the click event $dates.click(function(){ // if firstdateel is unset or lastdateel is set, then start a new range if (!firstdateel || lastdateel) { firstdateel=this; lastdateel=null; // Do stuff to previous $range (if there was a previous selection, you'll probably want to unhighlight it before resetting it) $range=$(noelements); // Starting new date range, do stuff to update ui } else { lastdateel=this; var $range=$($dates).lt($dates.index(lastdateel)+1); // filter out dates after the last one $range=$range.gt($dates.index(firstdateel)-1); // filter out dates before first one // Finished selecting range, do stuff to update ui } }); Blair On 12/14/06, mylocal [EMAIL PROTECTED] wrote: I have been trying to do a inline calendar for a client where you select the arrival date and then departure date and once the second click is registered in gives me an array of elemets between the two depending on class and highlights those spaces if there available. some code here at present : http://clients.ozdesign.com/104/book.php This is a work in progress, whilst trying to understand jquery more. -- View this message in context: http://www.nabble.com/Select-All-elements-between-clicks--need-help-please-tf2817436.html#a7863807 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/Select-All-elements-between-clicks--need-help-please-tf2817436.html#a7867661 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] quick question for Felix re: cakePHP
bmsterling wrote: Felix, I noticed on another thread that you work with cakePHP, I am trying to get my head around it, but not quite there. Can you recommend any good forums and tutorials (not digging the bakery.cakephp.org too much) to help me on my way. I'm using CakePHP daily, and here are a few places that have helped me on my development: To get started (and hyped), I would first check out the screencasts: http://cakephp.org/screencasts Then there is the 15 minute Blog tutorial: http://manual.cakephp.org/appendix/blog_tutorial The manual is actually pretty good and i'd recommend you read through it without a hurry: http://manual.cakephp.org/ Where the manual leaves you wondering, or you want the absolutely most up-to-date stuff, there is of course the API: http://api.cakephp.org/ I'd also recommend you take another look at the Bakery. It seems most of the stuff in there is not for CakePHP newbies, more for intermediates and up, but the quality of the stuff is actually pretty good: http://bakery.cakephp.org/ Then there is the CakePHP wiki, but it is being phased out, and might contain outdated stuff. The new stuff is moving to the bakery. http://wiki.cakephp.org/ ThinkingPHP is a great reasource for more advanced stuff http://www.thinkingphp.org/ And for more chitchat, help and discussions I'd point you to the Google Groups CakePHP-discussion: http://groups-beta.google.com/group/cake-php and the #cakephp irc-channel at irc.freenode.org, which you can also access through the web with a java-applet at: http://irc.cakephp.org/irc.html (for some reason seems to be down at the moment). Hope that helps even a bit. I'll gladly answer any questions, but we should keep them off this list. -- Suni ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Hide div only if no child checkbox is selected
Hi I have a div element full of checkboxes that gets hidden on page load via $(document).ready(function() {$('#testDiv').hide(); }. This works fine, but what I really want to do is to only hide the testDiv if none of the checkboxes within it have a 'checked=checked' attribute. All I've managed to do so far is to hide/not hide the checkboxes that are checked - not quite the result I was hoping for :) Is this the sort of selection that JQuery can handle easily, or do I have to write a function? Many thanks ~GreyCells (now subscribed) -- View this message in context: http://www.nabble.com/Hide-div-only-if-no-child-checkbox-is-selected-tf2817380.html#a7863621 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/