Re: [jQuery] jQuery 1.1 by the end of Nov
jQuery documentation should clearly illustrate which base / core jQuery is required and dependencies should be illustrated in a clear manor. I think the php pear site exemplifies this, i think this is mostly covered but could be a touch clearer. PHP PEAR is a bad example: In most cases you won't care about 5 or 50 additonal php files on your server, but you can't do this with js files. I think the recommended/custom way is a good approach: API documentation and tutorials are all written with the recommended version as their base. When a single plugin has dependencies on another plugin, it must be explicitly stated somewhere. A package/requires system that automatically resolves those dependencies would be nice, but I don't think this should have a high priority. -- Jörn Zaefferer http://bassistance.de -- Ein Herz für Kinder - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] input field focus help!
Roberto Ortelli schrieb: Hello, A few weeks ago I've written a small plugin for that: $.fn.fieldFocus = function(id){ document.getElementById(id).focus(); } and you call it using: $(document).fieldFocus(the_id_of_the_input_field_without_#); That is exactly the same as if you were doing this: $('#the_id_of_the_input').get(0).focus(); And that's two lines less ;-) -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] safari TR height always shows 0.
Joseph McDonald schrieb: Hi, Safari seems to be the only browser that returns 0 for the height of a TR. Is this a known problem? any work around? script type=text/javascript src=jquery-latest.js/script script $(document).ready(function() { $(#debug).html($(#tr1).height()); }); /script /head body div id=debug/div tabletr id=tr1tdasdf/td/tr/table thanks, -joe That may be due to the complex algorithm of how to be tables are rendered, I had some similiar problems. Does that change if you check the height after a little timeout? -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] First day of week -- date picker plugin
Hi, There isn't currently a way in the plugin to change the first day of each week. This is on my TODO list and will get done when I next get a chance to work on the plugin (unfortunately this won't be for at least three weeks). If you are desperate for a version of the date picker where the weeks start on Monday then let me know and I can send you a version that a guy called Javier Infante edited and sent to me? Cheers, Kelvin :) Toño Capuleto wrote: Hi to all.. Is there any way to change the first day of week in the datepicker plugin? I've been trying with no success.. Any one can help? thanx.. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] [Help] How to perform same functions on different tags.
Liu, Xiao-Guang (OSLO-RD-China) schrieb: Hi, suppose to implement the effect as: ($(input.c1) OR $(a#c2)).click(function(){ alert(Same effect); }); .. input type=button value=Save class=c1 / .. a href=# id=c2 Add /a That means when clicking button c1 or hyperlink c2, the action will be the same. How to write the jQuery code in correct syntax to do that? Jack Hi, Jack, simply group you selections just as if you were writing CSS. If you are not familiar with CSS, there's the possibility to group selections via a comma separated list. Try this: $(input.c1, #c2).click(function() { alert(Same effect); }); One more tip: For class selectors I would add a type whenever possible (div.whatever) to improve performance, but not for an id selector ('#whatever'). In the first case the element type narrows down the scope jQuery has to search in, in the second case it's the other way round. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] input field focus help!
Yeah, thanks Klaus ;) 2006/11/17, Klaus Hartl [EMAIL PROTECTED]: Roberto Ortelli schrieb: Hello, A few weeks ago I've written a small plugin for that: $.fn.fieldFocus = function(id){ document.getElementById(id).focus(); } and you call it using: $(document).fieldFocus(the_id_of_the_input_field_without_#); That is exactly the same as if you were doing this: $('#the_id_of_the_input').get(0).focus(); And that's two lines less ;-) -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Roberto Ortelli http://weblogger.ch ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] API docs draft 2
Jorn, I'm using FF2 and when I scroll down the left hand list, I get blue lines appearing across the frame, however they disappear when I go back up the list. They also disappear if I right-click on the frame as well. Seems to be some kind of refresh issue? Yep, I never noticed it the first time round - but the blue bar is coming from the bottom of the frame off the scroll bar at the bottom. However, it doesn't happen on the right hand frame. same for me in FF1.5.0.8, while in IE7 it fliflifliflifliflickers a lot Isn't IE7 supposed to support position: fixed? As ugly as it is, I can't get it working. Even if I exclude IE7 from the IE6 position:fixed workaround it seems to not understand the standard position:fixed. Maybe anything is wrong with this? #nav { width: 330px; position: fixed; left: 0; top: 0; height: 99%; overflow: auto; } Still have to figure out what is happening with those blue lines... -- Jörn Zaefferer http://bassistance.de -- Ein Herz für Kinder - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin - div resize problem in Firefox
Tim Andrews schrieb: what version of the Tabs plugin do you use? What do you mean by additional content? Is the content added dynamically? Do you have a demo online? By the way: what IE does is non-standard behaviour. Klaus, How do I determine the version on Tabs plug in? Er, good question... Where did you get it from? From my site? Or from SVN? The tabs are contained within nested div tags on the page, by default the first tag is open, when users select another tab with more content in, the tabs slide down as they are supposed to. However, the border at the bottom of the containing div tag does not move down to accommodate the expanded content in Firefox, only in IE. I will see if I can put together a link for you. It's not straightforward because all the elements of the page are formed in modular manner as part of the site. So you're not using the fxAutoHeight option? This sounds like a CSS issue to me... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] First day of week -- date picker plugin
Hi Kelvin! (unfortunately this won't be for at least three weeks). Please consider adding your datepicker plugin to the jQuery plugin repository. I you don't have an account yet, ask John to get you one. That would allow others to fix bugs in your plugin, or maybe even add features, if you agree. Considering your tight time schedule, this may be quite welcome for you. -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] API docs draft 2
I have fixed history support for IE in the history plugin. Maybe it's now 0.1 and it's also in SVN now. Does it still eat up your processor? Which browser? The only way to make history work is constantly poll changes in the location.hash property - sigh. That sucks, its one giant hack and I wish I hadn't started at all with that. Ok, the version you commited works better then the one included with latest tab plugin. At least the problem in FF is gone. I couldn't reproduce the other bug, maybe it had to do with the history as well? No. The tabs plugin behaviour, with or without history, is quite weird. I'll try to render and extract the parts that show the problem. Debugging with browser-processed XSLT isn't that nice. -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery namespacing your code
Hi, $.namespace(org.jquery.utils) You can use jsPax (http://jspax.cdonat.de/). Then you call it $package(org.jquery.utils, { HelloWorld = function() {alert(this.blabla);} }); org.jquery.utils.blabla = 'Hi'; $package(org.jquery.test, {}); org.jquery.test.wow = function() {alert('Wow');}; ... Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] AJAX module: overrideMimeType
Hi folks, I'm still on my quest to get all bugs in jQuery's AJAX module fixed. Now I'm stuck with this bug report: http://jquery.com/dev/bugs/bug/266/ Does it make sense to implement it as proposed? Or should we add another option that lets you specify the mimeType exactly? Your opinions please! -- Jörn Zaefferer http://bassistance.de -- Ein Herz für Kinder - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] API docs draft 2
Jörn Zaefferer schrieb: Jorn, I'm using FF2 and when I scroll down the left hand list, I get blue lines appearing across the frame, however they disappear when I go back up the list. They also disappear if I right-click on the frame as well. Seems to be some kind of refresh issue? Yep, I never noticed it the first time round - but the blue bar is coming from the bottom of the frame off the scroll bar at the bottom. However, it doesn't happen on the right hand frame. same for me in FF1.5.0.8, while in IE7 it fliflifliflifliflickers a lot I have play in FF edit CSS with your http://fuzz.bassistance.de/api-draft/style/newstyle.css For what is position fixed. Is stupid in my eys ;) I would go in this direction: html, body { background: #212121; font-family: Arial; font-size: 14px; } h1 { margin: 15px 0 0 0; color: #FFF; } #header { position: absolute; left: 360px; top: 0px; } #nav, #docs { background: #FFF; list-style: none; padding: 5px; } #docs { left: 350px; position:absolute; top: 40px; bottom:-14px; width: auto; overflow:auto /* overflow-y: auto; overflow-x:hidden; */ } #nav { width: 330px; position:absolute; left: 0; top: 0; bottom:0; overflow: auto; } .tabs-hide { display: none; } and your other code from http://fuzz.bassistance.de/api-draft/style/newstyle.css Not testet in IE!!! -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Make Thickbox loop?
Thanks a lot Jamie, I'll give that a shot. Seems non of the images are loading the emergencyarts example by the way. Nice design though. Adam Jamie Wilkinson-4 wrote: Attached is a copy of my hacked, looping Thickbox as used on http:// emergencyarts.com. I made some other changes that I can't remember at the moment. -jamie -- View this message in context: http://www.nabble.com/Make-Thickbox-loop--tf2643760.html#a7396899 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] AJAX module: overrideMimeType
Jörn Zaefferer schrieb: Hi folks, I'm still on my quest to get all bugs in jQuery's AJAX module fixed. Now I'm stuck with this bug report: http://jquery.com/dev/bugs/bug/266/ Does it make sense to implement it as proposed? Or should we add another option that lets you specify the mimeType exactly? Your opinions please! XHTML served as text/html is HTML. Period. If xml is required serve XHTML as application/xhtml+xml. I don't see any bug here. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] First day of week -- date picker plugin
Hi Kelvin! (unfortunately this won't be for at least three weeks). Please consider adding your datepicker plugin to the jQuery plugin repository. I you don't have an account yet, ask John to get you one. That would allow others to fix bugs in your plugin, or maybe even add features, if you agree. Considering your tight time schedule, this may be quite welcome for you. Hi Jörn, John did give me a svn account a while ago and I planned to clean the plugin up a little before commiting it there. I've been to busy to even do that! I'll try and find a little time this weekend to get this done and get it added into svn, it would certainly be a good idea for other people to help fix bugs! Cheers, Kelvin :) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery namespacing your code
Thanks guys, One stuff more. This line: var dragan = {}; What this mean? I suppose it creates an object? -- Dragan Krstić krdr http://krdr.ebloggy.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery namespacing your code
Hi, var dragan = {}; What this mean? I suppose it creates an object? Yes. The fiew lines could also be written like this: var dragan = { debug: function(info) { // do all sorts of fancy stuff } }; Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Newbee question
Hi Alexander, I think within the function you should type return false so the link is not being followed. By the way, are you sure you want to use oneclick() and not click()? As always: untested! -- Marc Alexander Petri schrieb: i have a simple question i have this sample html: h3Headline 2/h3 p class=text My text../p pa href='blog/comments/2' name='comment'show comments/a/p my js is like this: $('[EMAIL PROTECTED]').oneclick(function(){ var href=$(this).href(); $(this).parent().append(load(href)); $(this).html(hide comments); $(this).click(showhideComments); }); i just want to load my comments behind the a Tag in the p tag but it just shows the the new site could anyone help me? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] width bug with hide and show
The problem here is the inline style which is considered bad practice. The inline style is going to get overridden by the animation. Please put your styles in a stylesheet and this will resolve the issue. -- Brandon Aaron On 11/17/06, Kolman Nándor [EMAIL PROTECTED] wrote: Hi! I have the following HTML structure: div h1title/h1 table style=width: 400px; … /table /div divclose/open/div I make the table disappear/reappear by clicking the „close/open div using hide('fast') and show('fast'). After closing and opening, the table seems to forget the width setting. Is there a way to solve this problem other then setting the width each time table is shown? Nandi ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] use of stopPropagation
Thanks, Matt, but didn't work. Still send the event a lot of times. Is there another way to use stopPropagation? or constrain this type of event? Guillermo 2006/11/16, Matt Stith [EMAIL PROTECTED]: Try this: $('#most_searched').mouseover(function(e){ e.stopPropagation(); $('#most_searched .wid_control').fadeIn('slow'); }); On 11/16/06, Guillermo Movia [EMAIL PROTECTED] wrote: Hi all, i need to use this function, because i had a div in which i want to add a mouseover event. This works fine with $('#most_searched').mouseover(function(){$('#most_searched .wid_control').fadeIn('slow');}); But this div (#most_searched) has a lot of divs internally that make the fade in occurs when i don't want. But i can't make stopPropagation works for me here. Where i have to put this sentence to work? Thanks, and sorry for my english Guillermo ___ 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/
Re: [jQuery] width bug with hide and show
My styles are in a stylesheet, I just wrote this example to be as simple as possible. Since I wrote my initial letter I recognized that the problem exists in Firefox2 only. IE works fine. Nandi -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brandon Aaron Sent: Friday, November 17, 2006 3:26 PM To: jQuery Discussion. Subject: Re: [jQuery] width bug with hide and show The problem here is the inline style which is considered bad practice. The inline style is going to get overridden by the animation. Please put your styles in a stylesheet and this will resolve the issue. -- Brandon Aaron On 11/17/06, Kolman Nándor [EMAIL PROTECTED] wrote: Hi! I have the following HTML structure: div h1title/h1 table style=width: 400px; ... /table /div divclose/open/div I make the table disappear/reappear by clicking the close/open div using hide('fast') and show('fast'). After closing and opening, the table seems to forget the width setting. Is there a way to solve this problem other then setting the width each time table is shown? Nandi ___ 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/
Re: [jQuery] jQuery 1.1 by the end of Nov
Jörn Zaefferer wrote: jQuery documentation should clearly illustrate which base / core jQuery is required and dependencies should be illustrated in a clear manor. I think the php pear site exemplifies this, i think this is mostly covered but could be a touch clearer. PHP PEAR is a bad example: In most cases you won't care about 5 or 50 additonal php files on your server, but you can't do this with js files. I think the recommended/custom way is a good approach: API documentation and tutorials are all written with the recommended version as their base. When a single plugin has dependencies on another plugin, it must be explicitly stated somewhere. A package/requires system that automatically resolves those dependencies would be nice, but I don't think this should have a high priority. I would agree with Jörn, and expand that I think we need to require plugins include a: @Requires: blahblah.js[, version: 29+] @Requires: morestuff.js We are rapidly getting a large number of plugins and more and more of them seem to be using other plugins which is really good. This will help users figure out what plugins and versions they might need and it will supply the info needed for some future package system to figure this out also. -Steve ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] input field focus help!
On 11/17/06, Roberto Ortelli [EMAIL PROTECTED] wrote: Hello, A few weeks ago I've written a small plugin for that: $.fn.fieldFocus = function(id){ document.getElementById(id).focus(); } and you call it using: $(document).fieldFocus(the_id_of_the_input_field_without_#); It is great to write plugins that make your development (and hopefully others too) faster and easier. I would just like to point out a few things that could make your plugin a little more robust. First a plugin's 'this' points to the jQuery object. With that in mind you can simply write the above plugin like this: jQuery.fn.fieldFocus = function() { this.get(0).focus(); }; And if you wanted to be able to chain method together you would do it like this: jQuery.fn.fieldFocus = function() { this.get(0).focus(); return this; }; Or you could call focus on each of the elements in the jQuery object like this: jQuery.fn.fieldFocus = function() { return this.each(function() { if (this.focus) this.focus(); }); }; Inside of the each method the 'this' points to the actual DOM element and not the jQuery object. I check for focus first so as not to cause an error on elements that don't have the method. Hope that helps. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] width bug with hide and show
Do you know the revision number you are using? I believe the latest revision should fix this issue. I've recreated the simple test case you provided with the latest revision of jQuery here: http://brandon.jquery.com/testing/kolman/ Does that still break for you? BTW ... tables are a royal pain. I would surround the table with a div and toggle the div instead of the table. -- Brandon Aaron On 11/17/06, Kolman Nándor [EMAIL PROTECTED] wrote: My styles are in a stylesheet, I just wrote this example to be as simple as possible. Since I wrote my initial letter I recognized that the problem exists in Firefox2 only. IE works fine. Nandi -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brandon Aaron Sent: Friday, November 17, 2006 3:26 PM To: jQuery Discussion. Subject: Re: [jQuery] width bug with hide and show The problem here is the inline style which is considered bad practice. The inline style is going to get overridden by the animation. Please put your styles in a stylesheet and this will resolve the issue. -- Brandon Aaron On 11/17/06, Kolman Nándor [EMAIL PROTECTED] wrote: Hi! I have the following HTML structure: div h1title/h1 table style=width: 400px; ... /table /div divclose/open/div I make the table disappear/reappear by clicking the close/open div using hide('fast') and show('fast'). After closing and opening, the table seems to forget the width setting. Is there a way to solve this problem other then setting the width each time table is shown? Nandi ___ 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 mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] input field focus help!
Or you could call focus on each of the elements in the jQuery object like this: jQuery.fn.fieldFocus = function() { return this.each(function() { if (this.focus) this.focus(); }); }; Inside of the each method the 'this' points to the actual DOM element and not the jQuery object. I check for focus first so as not to cause an error on elements that don't have the method. While that is true, it doesn't make sense in this specific example. There can't be more element then one with focus... -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Grid and Storing State
I've moved over to YI Library because of the nice Yui-Ext grid control and because it's much easier to figure out where to store the UI state in control or plugin, you keep it in the controller object. I'm still curious though, if you had to maintain meta-data about a control, like the sort function for a particular column in a grid, where do you store that information in a plugin? * Alan Gutierrez [EMAIL PROTECTED] [2006-11-15 12:37]: I'd like to create a Grid for my application. I've started here... http://blogometer.com/repository/etude/jQuery/grid/grid.html ...with the first issue being one of sizing the columns. I'm doing this by applying a class to each column and heading in an HTML table and then adjusting the rules of the class. My creational pattern like so... $(#grid).grid({ dataType: 'html' }) My question is, where do I store state? How do I change my grid in the future? Where would I keep an object to adjust grid properties? Should I pursue this sort of syntax to change a column's sortability? $(#grid).sortable(3, false) I'd only want sortable for those elements that were now grids. Thoughts? The Prototype way to do it is to create an object that acts as a controller. I'm not sure of the jQuery way. -- Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/ Think New Orleans - http://thinknola.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] width bug with hide and show
Original-Nachricht Datum: Fri, 17 Nov 2006 08:51:49 -0600 Von: Brandon Aaron [EMAIL PROTECTED] An: jQuery Discussion. discuss@jquery.com Betreff: Re: [jQuery] width bug with hide and show Do you know the revision number you are using? I believe the latest revision should fix this issue. I've recreated the simple test case you provided with the latest revision of jQuery here: http://brandon.jquery.com/testing/kolman/ Does that still break for you? That doesn't do anything. Weird. -- Jörn Zaefferer http://bassistance.de -- Ein Herz für Kinder - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] input field focus help!
On 11/17/06, Jörn Zaefferer [EMAIL PROTECTED] wrote: Or you could call focus on each of the elements in the jQuery object like this: jQuery.fn.fieldFocus = function() { return this.each(function() { if (this.focus) this.focus(); }); }; Inside of the each method the 'this' points to the actual DOM element and not the jQuery object. I check for focus first so as not to cause an error on elements that don't have the method. While that is true, it doesn't make sense in this specific example. There can't be more element then one with focus... HAHAHAHA ... no it doesn't make sense. Thanks Jorn. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] width bug with hide and show
On 11/17/06, Jörn Zaefferer [EMAIL PROTECTED] wrote: That doesn't do anything. Weird. Did you click the div that says 'close/open' below the copy? -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] width bug with hide and show
On 11/17/06, Kolman Nándor [EMAIL PROTECTED] wrote: It works for me correctly. I use 1.0.3 version of jQuery. Good! Can you pull the latest from SVN? There was a recent bug fix that also fixed this. If not, 1.0.4 should be coming soon. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
On 11/17/06, Stephen Woodbridge [EMAIL PROTECTED] wrote: I would agree with Jörn, and expand that I think we need to require plugins include a: @Requires: blahblah.js[, version: 29+] @Requires: morestuff.js We are rapidly getting a large number of plugins and more and more of them seem to be using other plugins which is really good. This will help users figure out what plugins and versions they might need and it will supply the info needed for some future package system to figure this out also. We are also getting a fair amount of revisions to jQuery. Plugins will need to be very explicit about what version they are compatible with. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] width bug with hide and show
Of course. Thanks. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brandon Aaron Sent: Friday, November 17, 2006 4:18 PM To: jQuery Discussion. Subject: Re: [jQuery] width bug with hide and show On 11/17/06, Kolman Nándor [EMAIL PROTECTED] wrote: It works for me correctly. I use 1.0.3 version of jQuery. Good! Can you pull the latest from SVN? There was a recent bug fix that also fixed this. If not, 1.0.4 should be coming soon. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Newbee question
sorry return false; doesnt help Marc Jansen wrote: Hi Alexander, I think within the function you should type return false so the link is not being followed. By the way, are you sure you want to use oneclick() and not click()? As always: untested! -- Marc Alexander Petri schrieb: i have a simple question i have this sample html: h3Headline 2/h3 p class=text My text../p pa href='blog/comments/2' name='comment'show comments/a/p my js is like this: $('[EMAIL PROTECTED]').oneclick(function(){ var href=$(this).href(); $(this).parent().append(load(href)); $(this).html(hide comments); $(this).click(showhideComments); }); i just want to load my comments behind the a Tag in the p tag but it just shows the the new site could anyone help me? ___ 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] Progress Bar
What's the best way to have a progress bar that can fill up between 0 and 100%. Keep in mind that both the bar itself and the fill probably need to be images. -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin - div resize problem in Firefox
Brandon Aaron schrieb: On 11/17/06, Klaus Hartl [EMAIL PROTECTED] wrote: So you're not using the fxAutoHeight option? This sounds like a CSS issue to me... @Klaus I'm unsure if this will affect your code or not but the fix for #276 removes the inline styles once an animation is completed. Meaning that the styles will revert back to the stylesheet. Only the display style is left inline. Hi Brandon, yes, thanks for the hint :-) I have a style reset in the callback but decided to leave it in for a while, I'm trying to have the plugin at least compatible with earlier versions of jQuery. Still a valuable addition! -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
Paul McLanahan schrieb: Agreed. We need two new standards. 1. @requires in the docs format, which would only require a change in the API generating code to have it look for that (if it doesn't already). 2. A standard way and convention for specifying version numbers for plugins which can be read by the docs, and preferably by the JS itself. Totally agreed! I couldn't even tell myself in another thread how to determine the version of the Tabs plugin :-) -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Progress Bar
A technique that I used before is to manipulate the css background-position property and simply move the bar to the right this way. This should be good enough for most kinds of progress bars I think. For a demonstration check out this little 'ajax' file upload progress bar thing I wrote in May: http://thinkingphp.org/demos/cake-timer/ It uses Perl / PHP / Yahoo JS library (which I wanted to try out back then). The code is messy but you'll get the idea. -- Felix Geisendörfer aka the_undefined -- http://www.thinkingphp.org http://www.fg-webdesign.de Yehuda Katz wrote: What's the best way to have a progress bar that can fill up between 0 and 100%. Keep in mind that both the bar itself and the fill probably need to be images. -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Newbee question
Your problem is right here: $(this).parent().append(load(href)); 'Load' isnt a global function, and it will automatically put the response of the load statement into the called element, so try this: $('[EMAIL PROTECTED]').oneclick(function(e){ e.preventDefault(); var href=$(this).href(); var me = this; $.get(href,function(response) { $(me).parent().append(response); } $(this).html(hide comments); $(this).click(showhideComments); }); Untested, but it should work. On 11/17/06, Alexander Petri [EMAIL PROTECTED] wrote: i have a simple question i have this sample html: h3Headline 2/h3 p class=text My text../p pa href='blog/comments/2' name='comment'show comments/a/p my js is like this: $('[EMAIL PROTECTED]').oneclick(function(){ var href=$(this).href(); $(this).parent().append(load(href)); $(this).html(hide comments); $(this).click(showhideComments); }); i just want to load my comments behind the a Tag in the p tag but it just shows the the new site could anyone help me? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
This is a very clever approach to what will become a serious problem for jQuery, the management of dependencies. Playing around with YUI and YUI ext, it seems like to use a signicant control like the grid, you must include huge swath of each library, but not the entirety. The time it takes to figure out what you need, exactly, would be better spent coding. Upgrades that require new components will appear as bugs, and not dependency errors. What drives the adoption of langages like Perl and now Ruby is the ability to evaulate a new package quickly, and that is done by pulling all the dependencies automatically. A convention about plugins that runs the gambit from runtime inclusion to deployment dependencies, with a jQuery Repository of plugins, is an investment that pay for itself in new adoptees. The trade off of speed versus size is ancient. There is no good answer. It either leans toward speed or leans toward size... ..or else it leans toward tools. You could use a preprocessors and choose between algorithms. * Paul McLanahan [EMAIL PROTECTED] [2006-11-17 10:23]: Agreed. We need two new standards. 1. @requires in the docs format, which would only require a change in the API generating code to have it look for that (if it doesn't already). 2. A standard way and convention for specifying version numbers for plugins which can be read by the docs, and preferably by the JS itself. I'd like for the version to have a standard location and convention in the code of the plugin so that I can throw an error in my plugin if the dev has made a mistake by including an old plugin (or none at all). I'd rather alert during development, then have an obscure bug show up in production. I suggest something like: // inside block context var plugin = $.fn.myPlugin = function(){ return this.each(...); } plugin.version = '0.0.1'; or jQuery.fn.myPlugin = function(){ arguments.callee.version = '0.0.1'; return this.each(...); } Having it in the documents comments would be good as well so it can show on sites like visualjquery.com... but I think it would be quite advantageous to be able to require version 0.0.1+ in the code. Though, we would need a function to check version depending on the agreed upon version numbering scheme. I also agree with the recommended/custom approach for the download. People with the tools and knowledge are doing this now with the build system. Copying that system online (much like Corey did earlier in the thread) would be an excellent way for those with special needs for bandwidth or functionality to get their wish without having to install ant. Don't have the system on the download page, but have it linked from there. On 11/17/06, Stephen Woodbridge [EMAIL PROTECTED] wrote: Jörn Zaefferer wrote: jQuery documentation should clearly illustrate which base / core jQuery is required and dependencies should be illustrated in a clear manor. I think the php pear site exemplifies this, i think this is mostly covered but could be a touch clearer. PHP PEAR is a bad example: In most cases you won't care about 5 or 50 additonal php files on your server, but you can't do this with js files. I think the recommended/custom way is a good approach: API documentation and tutorials are all written with the recommended version as their base. When a single plugin has dependencies on another plugin, it must be explicitly stated somewhere. A package/requires system that automatically resolves those dependencies would be nice, but I don't think this should have a high priority. I would agree with Jörn, and expand that I think we need to require plugins include a: @Requires: blahblah.js[, version: 29+] @Requires: morestuff.js We are rapidly getting a large number of plugins and more and more of them seem to be using other plugins which is really good. This will help users figure out what plugins and versions they might need and it will supply the info needed for some future package system to figure this out also. -- Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/ Think New Orleans - http://thinknola.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] width bug with hide and show
Jörn Zaefferer schrieb: That doesn't do anything. Weird. Did you click the div that says 'close/open' below the copy? I really need a big red button that says: JS is currently disabled! Don't forget to enable it again!! Sorry. Hehe, maybe try this in your user CSS: body:before { display: block; content: D'oh! JavaScript is disabled!; font-size: 36px; font-weight: bolder; } And then remove that with an user JavaScript... ;-) I really wonder if that works! -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Re initialise selectables
Hi, i am using ajax to search for users and call the selectables function on the found set afterwards. function makeSelectable(){ $('#mainWindow').Selectable( { accept : 'selectableitem', selectedclass : 'selecteditem', helperclass : 'selecthelper' } ); } Though when i make another search and call Selectables again, i still get the helper class (the div that gets created and shows the nice drag window) but the new found set can't be selected any more. I guess there is already a selectables object in the dom and won't overwrite or something. Anybody knows how to solve this . Thanks Phil -- View this message in context: http://www.nabble.com/Re-initialise-selectables-tf2654220.html#a7405321 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Formless (or hopeless) programming model
Thanks, you certainly got a point Dave, and while it's not relevant to this particular project I think it would be stupid of me to start building something I wont benefit from in future projects - where accessibility would matter more. I guess the right way is to use real form elements and if JS is enabled modify it like http://sandbox.wilstuckey.com/jquery-ratings/ . Need to look into that code how it's done... dave.methvin wrote: My real question is: since I am pretty new on the JS/Ajax scene - is my approach a good idea at all (i.e to have formless state) - would you instead create invisible form fields for keeping state and updating the fancy divs from the state of the those hidden form fields instead and then use the existing form plugin etc when posting etc. Unplug the mouse from the computer and try to use the page you have built. Are you able to change values using only the keyboard? There is semantic meaning to form elements that tell both users and assistive software that you are expecting input. The special form-like elements you are building don't have that interpretation I suspect. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/Formless-%28or-hopeless%29-programming-model-tf2650594.html#a7405969 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
I've created a trouble ticket for it here: http://jquery.com/dev/bugs/bug/407/ --John On 11/17/06, Andrea Ercolino [EMAIL PROTECTED] wrote: Hi everybody. While developing the PunchCard widget I've found a problem with getScript in IE7. If you are interested in helping me, I've isolated the issue here: http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/ Thanks Andrea ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] AJAX module: overrideMimeType
John Resig schrieb: I think what's being driven at here is that the dataType should try harder to force the results into its specified type. This can be done just by adding the line: if ( dataType == xml ) xml.overrideMimeType('text/xml'); This won't effect anyones existing XML-related code, instead it'll just help to fix a lot of the confusion that surrounds incorrect headers and Ajax. I say add those two lines! --John I still see dangers with that. IE doesn't support overrideMimeType, so if you don't want to leave it in the dust and want xml, you have to serve as text/xml anyway. Furthermore I see people trying to make it XML while it is HTML really and probably not well-formed. Instead of doing it the right way in the beginning. I'd say MIME type matters, nothing else. Maybe I just can't imagine a situation where this is useful. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] name attribute gets removed from inputs in IE7
On 16/11/06, Sam Collett [EMAIL PROTECTED] wrote: On 16/11/06, Klaus Hartl [EMAIL PROTECTED] wrote: Sam Collett schrieb: Test case: $( function() { var action = $(input type=hidden).attr( { name: action, value: delete }); alert(action[0].name); // name seems to be added fine alert($(form).append(action).html()); // where has name gone? } ) The first alert shows that name has been set, but when I get the html it is not there. Happens in 1.0.3 (and did in 1.0.2) To name a field action is not a good idea anyway. It clashes with the form elements own action attribute (form.action anyone?), so maybe that's also the reason why it is gone... -- Klaus It happens regardless of the name you give it: $( function() { var action = $(input type=hidden).attr( { name: whatdodo, value: delete }); alert(action[0].name); // name seems to be added fine alert($(form).append(action).html()); // where has name gone? } ) It is only a problem in IE. I've tried it on several machines in IE 6 as well as 7 and it is still an issue. Can anyone replicate this with their copies of IE? Filed it as a bug otherwise I may have to resort to doing things the old fashioned way document.write(form name='...' action='...'input. http://jquery.com/dev/bugs/bug/408/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
Found and patched the problem in ajax.js where $.getScript and $.getJSON don't do anything if a callback isn't supplied. The problem is that httpData function isn't called from $.ajax unless there is a callback supplied. Someone please commit if it's deemed a good fix. The only other fix is to add an else after the check for s.success in ajax.js on line 778 to look for types that need httpData to run. Something like // If a local callback was specified, fire it if ( s.success ) s.success( jQuery.httpData( xml, s.dataType ), status ); else if ( s.dataType=='script' || s.dataType=='json' ) jQuery.httpData( xml, s.dataType ); But I think the patch below might be easier... up to you committers. Index: ajax.js === --- ajax.js (revision 603) +++ ajax.js (working copy) @@ -420,11 +420,7 @@ * @cat AJAX */ getScript: function( url, callback ) { - if(callback) - jQuery.get(url, null, callback, script); - else { - jQuery.get(url, null, null, script); - } + jQuery.get(url, null, callback||function(){}, script); }, /** @@ -465,7 +461,7 @@ * @cat AJAX */ getJSON: function( url, data, callback ) { - jQuery.get(url, data, callback, json); + jQuery.get(url, data, callback||function(){}, json); }, /** I'm still looking for the IE7 problem. Paul On 11/17/06, John Resig [EMAIL PROTECTED] wrote: I've created a trouble ticket for it here: http://jquery.com/dev/bugs/bug/407/ --John On 11/17/06, Andrea Ercolino [EMAIL PROTECTED] wrote: Hi everybody. While developing the PunchCard widget I've found a problem with getScript in IE7. If you are interested in helping me, I've isolated the issue here: http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/ Thanks Andrea ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Dynamically Loaded Scripts in IE 7 - Problems Found and Lessons Learned
Dear all, I have spent quite a bit of time trying to make a dynamically-loaded page's scripts work in IE 7 and Firefox and would like to share with you the lessons I have learnt. You might find my discoveries obvious or trivial, but I am still going to post them in case they are useful to someone: I have a page (host page) that is loading another page (guest page) into a div via the .load() ajax function. The host page's head element contains links to all the project's JavaScript files (including jquery.js) and style sheets files. The guest page just contains links to the JavaScript files and style sheets files applicable to the content it is loading. However, these links are not put into the head section as IE seems to ignore links placed there (thanks to Chris Mcleod for sharing that with us at the end of August). The solution is to put these links into the body tag. The good news is that there is no need to re-load the JavaScript files and style sheets files that were loaded in the host page as these seem to be accessible from the guest page. If you have some inline scripts in the guest page (some of my JavaScript variables are dynamically generated via ASP.NET and therefore need to be inline), the order in which you place the script tags is important as IE and Firefox differ slightly: - If you put the linked script before the inline script, Firefox will execute the inline script before the linked script, whilst IE will execute the linked script before the inline script. - If you put the inline script before the linked script, both Firefox and IE will execute the inline script before the linked script. I use the second approach as it is consistent in the two browsers. Also, take into account that any $(document).ready placed in the guest page JavaScript code will be triggered as soon as it is found (it will not wait until the guest page is loaded). This being the case, I just place the code to be executed when the page is loaded at the bottom of the last loaded script. Another thing that has driven me crazy is the use of var in IE (Firefox doesn't seem to have this problem): In the host page (or any other normally loaded page) any variable declared with var has a limited scope only if it is declared within a context (for example a function). Any variable declared with var outside any context has a global scope and can be accessed from any other place in the code. In the guest page, however, any variable that is preceded with var will have a scope that is limited to the script in which it was declared (I imagine it has something to do with the eval statement used to execute the dynamically loaded script code). That means that, in my case, the variables that were declared in the inline script were not accessible from the code present in the linked scripts. The solution is to remove the var from the variable declarations. If you just put myVariable = 'whatever'; you will be able to access myVariable from the rest of the scripts. A final thing I have discovered that is probably quite obvious is that the guest page JavaScript code can have an effect on the host page DOM. If, for example, your guest page loads the following JavaScript code $('div').css('backgroundColor': '#F00');, all the divs in the host page will turn red. This is probably due to the fact we are loading the guest page into the host page (as oppossed to using an iframe). Tha means that you should be careful when using the jQuery selectors in the guest page JavScript code. Well, that's about it! I hope somebody finds this information useful. If you have found any other quirks regarding jQuery and IE 6 or 7, please share them! I have been quite surprised about the few posts that talk about IE 7 at all. Maybe I am the only one finding problems. Or maybe people have not started worrying about this new browser yet. I will take the chance to thank everybody involved in the development of jQuery and its plugins. you are doing a great job! Thanks! -- View this message in context: http://www.nabble.com/Dynamically-Loaded-Scripts-in-IE-7---Problems-Found-and-Lessons-Learned-tf2655919.html#a7408308 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] AJAX module: overrideMimeType
I still see dangers with that. IE doesn't support overrideMimeType, so if you don't want to leave it in the dust and want xml, you have to serve as text/xml anyway. Furthermore I see people trying to make it XML while it is HTML really and probably not well-formed. Instead of doing it the right way in the beginning. I'd say MIME type matters, nothing else. Maybe I just can't imagine a situation where this is useful. The situation where the user is sending XML to the browser but is sending the wrong headers (either intentionally, or not). I didn't realize that overrideMimeType didn't exist in IE, though. So it sounds like users will just have to tough it out for now. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
As Norbert just pointed out in the thread Dynamically Loaded Scripts in IE 7 - Problems Found and Lessons Learned, it is a scope issue. If the functions in your script file loaded via getScript use either of the following two methods (they're synonymous) then the functions will not be available in the global scope. function myFunc(){} var myFunc = function(){} However, if you define functions like this: myFunc = function(){} // note the lack of var Then it will be available and work fine. I've found no fix for this in jQuery source. For now we just have to be careful of the scripts we load in. You can also keep using the first method above and just define the variable in the global scope earlier in the script file like so: myFunc = myOtherFunc = {}; function myFunc(){} etc... This was tested against SVN jQuery and IE7. On 11/17/06, Paul McLanahan [EMAIL PROTECTED] wrote: Found and patched the problem in ajax.js where $.getScript and $.getJSON don't do anything if a callback isn't supplied. The problem is that httpData function isn't called from $.ajax unless there is a callback supplied. Someone please commit if it's deemed a good fix. The only other fix is to add an else after the check for s.success in ajax.js on line 778 to look for types that need httpData to run. Something like // If a local callback was specified, fire it if ( s.success ) s.success( jQuery.httpData( xml, s.dataType ), status ); else if ( s.dataType=='script' || s.dataType=='json' ) jQuery.httpData( xml, s.dataType ); But I think the patch below might be easier... up to you committers. Index: ajax.js === --- ajax.js (revision 603) +++ ajax.js (working copy) @@ -420,11 +420,7 @@ * @cat AJAX */ getScript: function( url, callback ) { - if(callback) - jQuery.get(url, null, callback, script); - else { - jQuery.get(url, null, null, script); - } + jQuery.get(url, null, callback||function(){}, script); }, /** @@ -465,7 +461,7 @@ * @cat AJAX */ getJSON: function( url, data, callback ) { - jQuery.get(url, data, callback, json); + jQuery.get(url, data, callback||function(){}, json); }, /** I'm still looking for the IE7 problem. Paul On 11/17/06, John Resig [EMAIL PROTECTED] wrote: I've created a trouble ticket for it here: http://jquery.com/dev/bugs/bug/407/ --John On 11/17/06, Andrea Ercolino [EMAIL PROTECTED] wrote: Hi everybody. While developing the PunchCard widget I've found a problem with getScript in IE7. If you are interested in helping me, I've isolated the issue here: http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/ Thanks Andrea ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] AJAX module: overrideMimeType
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Subject: [jQuery] AJAX module: overrideMimeType Now I'm stuck with this bug report: http://jquery.com/dev/bugs/bug/266/ Does it make sense to implement it as proposed? Or should we add another option that lets you specify the mimeType exactly? Your opinions please! -- Jörn Zaefferer - I'd vote for the ability to force the mimeType if at all possible. I can think of one project where the mimeType caused me a few hours of confusion. -ALEX ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Formless (or hopeless) programming model
I'd actually love to hear some opinions on this from some of the more l33t coders on this list. I've built apps that are formless and I've built apps that reference an inordinate amount of hidden form fields... which is best? Why? This is probably more of a general JavaScript Coding Practices conversation then a jQuery one, but still, it's kind of interesting. -ALEX -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Holmberg Sent: Friday, November 17, 2006 2:12 AM To: discuss@jquery.com Subject: [jQuery] Formless (or hopeless) programming model This might be a little too generic to actually be a posted here, but since I am using JQuery (just got started) in a pretty advanced project right now, I post it here to you, been lurking around here for a short while and seems like you are all very knowledgable. Formless state. I would like my app to have just that. I.e not a (multiselect) listbox but rather a div where I spit out selections http://www.nabble.com/file/4208/Cropper%20Capture%5B13%5D.png and a simple href (Ändra, swedish for change) for changing (which throws up a thickbox). So I have a js state object - myState containg the state (array of selections). All is working fine. The state also contains some other state, such as current page number and current sort order for some other elements. When state changes (i.e user selects some other criteria, goes to next/prev page) I update some parts of the GUI using ajax. However - here's my problem. So far I have been handcrafting the ajax url from the myState variable, and GETting the data. To make it more generic I would like to have a generic serialize of the myState object and post it instead. Then I could easily add more variables to the state without needing to update all places where retrieve new data. My real question is: since I am pretty new on the JS/Ajax scene - is my approach a good idea at all (i.e to have formless state) - would you instead create invisible form fields for keeping state and updating the fancy divs from the state of the those hidden form fields instead and then use the existing form plugin etc when posting etc. I am starting to feel that's the way to go - I also think browser history would be more consistent that way - the myState is of course cleared on forward/back - but I do have some regular dropdowns which semms to keeps their selection. Is that also correct? I have spent an embarrassing amount of time on these type of problems - which are new to me since I have only spent all my time serverside before - however learning takes time, I guess... -- View this message in context: http://www.nabble.com/Formless-%28or-hopeless%29-programming-model-tf2650594.html#a7396830 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] getScript error
I don't understand how to apply the workaround. It's fine to adjust the script which control the loading, and I think your last workaround say how to do it, but I don't understand it. Could you please reference my test code? Paul McLanahan wrote: As Norbert just pointed out in the thread Dynamically Loaded Scripts in IE 7 - Problems Found and Lessons Learned, it is a scope issue. If the functions in your script file loaded via getScript use either of the following two methods (they're synonymous) then the functions will not be available in the global scope. function myFunc(){} var myFunc = function(){} However, if you define functions like this: myFunc = function(){} // note the lack of var Then it will be available and work fine. I've found no fix for this in jQuery source. For now we just have to be careful of the scripts we load in. You can also keep using the first method above and just define the variable in the global scope earlier in the script file like so: myFunc = myOtherFunc = {}; function myFunc(){} etc... This was tested against SVN jQuery and IE7. On 11/17/06, Paul McLanahan [EMAIL PROTECTED] wrote: Found and patched the problem in ajax.js where $.getScript and $.getJSON don't do anything if a callback isn't supplied. The problem is that httpData function isn't called from $.ajax unless there is a callback supplied. Someone please commit if it's deemed a good fix. The only other fix is to add an else after the check for s.success in ajax.js on line 778 to look for types that need httpData to run. Something like // If a local callback was specified, fire it if ( s.success ) s.success( jQuery.httpData( xml, s.dataType ), status ); else if ( s.dataType=='script' || s.dataType=='json' ) jQuery.httpData( xml, s.dataType ); But I think the patch below might be easier... up to you committers. Index: ajax.js === --- ajax.js (revision 603) +++ ajax.js (working copy) @@ -420,11 +420,7 @@ * @cat AJAX */ getScript: function( url, callback ) { - if(callback) - jQuery.get(url, null, callback, script); - else { - jQuery.get(url, null, null, script); - } + jQuery.get(url, null, callback||function(){}, script); }, /** @@ -465,7 +461,7 @@ * @cat AJAX */ getJSON: function( url, data, callback ) { - jQuery.get(url, data, callback, json); + jQuery.get(url, data, callback||function(){}, json); }, /** I'm still looking for the IE7 problem. Paul On 11/17/06, John Resig [EMAIL PROTECTED] wrote: I've created a trouble ticket for it here: http://jquery.com/dev/bugs/bug/407/ --John On 11/17/06, Andrea Ercolino [EMAIL PROTECTED] wrote: Hi everybody. While developing the PunchCard widget I've found a problem with getScript in IE7. If you are interested in helping me, I've isolated the issue here: http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/ Thanks Andrea ___ 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/getScript-error-tf2652417.html#a7410144 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Newbee question
yes that is the problem how can i force the encoding type in the js? or have i to edit the htaccess file - or what can i do? Ⓙⓐⓚⓔ wrote: all ajax calls rely on the encoding set by the server. are you getting ? instead of ü? On 11/17/06, Alexander Petri [EMAIL PROTECTED] wrote: thank you that worked, but why do i get strange chars like this: � Matt Stith wrote: Your problem is right here: $(this).parent().append(load(href)); 'Load' isnt a global function, and it will automatically put the response of the load statement into the called element, so try this: $('[EMAIL PROTECTED]').oneclick(function(e){ e.preventDefault(); var href=$(this).href(); var me = this; $.get(href,function(response) { $(me).parent().append(response); } $(this).html(hide comments); $(this).click(showhideComments); }); Untested, but it should work. On 11/17/06, Alexander Petri [EMAIL PROTECTED] wrote: i have a simple question i have this sample html: h3Headline 2/h3 p class=text My text../p pa href='blog/comments/2' name='comment'show comments/a/p my js is like this: $('[EMAIL PROTECTED]').oneclick(function(){ var href=$(this).href(); $(this).parent().append(load(href)); $(this).html(hide comments); $(this).click(showhideComments); }); i just want to load my comments behind the a Tag in the p tag but it just shows the the new site could anyone help me? ___ 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 mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
OK, thanks Paul. -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7413328 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/