[jQuery] Content within Floating Window using jQuery SimpleModal plugin cannot be replaced in IE8
Hi all I have already posted on stackoverflow about this issue. Here a short description: A Javascript function gets called from within a SimpleModal window. In this function some content found in this modal window is replaced - e.g. $('#DivTest').html('ChangedValue'). In IE8, if the SimpleModal window is closed and opened again, it is not possible anymore to change any content within this modal window or set elements to invisible etc.. You can see that content and attributes of DOM objects have been changed, in example by making use of alert function, but these changes are not rendered. More details can be found here: http://stackoverflow.com/questions/1697954/content-within-floating-window-using-jquery-simplemodal-plugin-cannot-be-replaced Any hints? Thanks and cheers, Roger
[jQuery] How could we pass a xmldom to a webservice?
the webservice was written by asp.net
[jQuery] How to post a XmlDocument to ASP.NET WebService (*.asmx)
I tried to use it in following way. asmx: [WebMethod] public string XmlTest([XmlAnyElement] XmlElement test) { return ; } js: var xmldata=Booka/Book var par = { test: xmldata}; $.ajax({ type: 'post', url: WebService/DatabaseWS.asmx/XmlTest, processData: false, data: data, success: function() { alert('yes'); }, }, But it seems wrong, and didn't call the XmlTest method, Anyone can help me?
[jQuery] Re: jquery-1.2.6.min.js and mootools.v1.1.js not compatable
On Apr 20, 3:54 pm, amanj amanji...@gmail.com wrote: Hi All, i have a problem with web page, i have 2 js files for tow topic jquery-1.2.6.min.js mootools.v1.1.js those file are not compatable togeher, please if have any thing or any problem could you advice me how can i use it? Those files are not compatible with much of anything. Both use browser sniffing extensively. Mashing the two together will just double your misery. Unfortunately, 1.3x is not much better and just different enough to make upgrading a nightmare (see other threads here.)
[jQuery] Re: Creating custom attributes in html
Josh, Since you aren't creating nodes, why not wait until after you insert the string of html onto the page, at which point you will have access to those nodes, so you can loop through them and set all of the corresponding properties on them using .data() or just the usual document.getElementById('id').property = value method? You could also store all of the data in an object with the element ids as keys, such as: var data_store = { elementId1: { name: name, type: type, about: about }, elementId2: { name: name, type: type, about: about } } Then it is easy to access that information by binding events to the elements that access data_store[this.id] On Apr 17, 5:50 am, RobG rg...@iinet.net.au wrote: On Apr 17, 3:34 pm, RobG rg...@iinet.net.au wrote: [...] OK, here is a dead basic proof of concept. Of course it is nowhere near production code, but I think you can see where it's going. I would wrap the entire thing in the module pattern, but I've just used basic globals at this stage. My intention is to show that efficient DOM manipulation is possible and that access to related data isn't hard. It took me about 45 minutes to write the entire thing (more than half of that was writing the function to generate the test data set), tested in Firefox 3 and IE 6 on a 3.4GHz Pentium 4, Windows XP, the insert runs in less than 500ms. I'll test it on the G4 iBook for reference later. Safari 4 on iBook takes around 132ms, Firefox was around 1900. [...] function showData(evt) { var evt = evt || window.event; var tgt = evt.target || evt.srcElement; var data; if (tgt tgt.tagName tgt.tagName.toLowerCase() == 'a') { data = dataObj[tgt.id]; // Should guard against error here if (typeof data != 'undefined') { // Have data related to this element, do // something with it alert( 'Name: ' + data.name + '\nType: ' + data.type + '\nAbout: ' + data.about ); } } } -- Rob
[jQuery] Re: Should $(document).ready() be external? And should it be placed at the bottom of the page?
Andy is absolutely right, but I'd like to add that you can call $ (document).ready() anywhere on the page and as many times as you want. On Apr 14, 10:34 am, Andy Matthews li...@commadelimited.com wrote: You can externalize the document.ready call if you choose, I do it all the time. As for putting it at the bottom of the page, I'd say no. Putting it in an external JS file, with the ready call makes it so that code is not run until the entire DOM is ready anyway. andy -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of kgosser Sent: Tuesday, April 14, 2009 10:28 AM To: jQuery (English) Subject: [jQuery] Should $(document).ready() be external? And should it be placed at the bottom of the page? Hey all, Two quick questions for you. I couldn't find the answers while searching... This would be a great thing to add to the jQuery FAQ, by the way. (1) Is it advisable to place a page's $(document).ready() stuff in an external .js file? I've been doing a lot of reading and research on optimizing my front end code, and YSlow seems to make a big deal of placing code externally if possible for caching reasons. I understand the usefulness of placing the code in an external document for that reason, however, the problem is that there are a lot of functions for button and link clicks, shows/hides, etc., that are unique to that page and used differently on other pages. Thus, putting it externally means it would most likely have to be in an independent file just for that page... which means an added HTTP request which is really the speed killer. So anyways, looking for thoughts on this one. (2) Is it advisable to place the $(document).ready() at the bottom of the page right before the closing BODY tag? Also when doing my research, I've seen that YSlow makes a big deal of this as well. I'm sure many of you on here have discussed it or thought about it yourself. My question though is does it make sense to put the ready() code at the bottom? Does it help? Is it useful? Will it break? Thanks in advance for any feedback. Take care everyone.
[jQuery] Re: how to create multiple draggable div's with dynamic content
Sounds like you need to create a function (or two) to manage the creation of the draggable window and fill it with content. Your function should either clone the markup from a hidden div on the page or create new dom elements with javascript. You would then select the container that you cloned or created, make it draggable and fill it with content. You could prepare some content from an ajax call and pass it into the function below: function makeDraggable(content) { $('body').append('div id=superDrag\ a href=# onclick=$(\'#superDrag \').remove()close/a\ div id=superDragContent'+content+'/ div\ /div'); $('#superDrag').draggable(); } It would probably be more versatile to use it as a class: function superDrag(content) { $('body').append('div id=superDrag\ a id=superDragClose href=# onclick=$(\'#superDrag\').remove()close/a\ div id=superDragContent'+content+'/ div\ /div'); $('#superDrag').draggable(); this.draggable = $('#superDrag').get(0); this.draggableContent = $('#superDragContent').get(0); var thisSuperDrag = this; $('#superDragClose').click(function() { thisSuperDrag.close(); }); } superDrag.prototype.close = function() { $(this.draggable).remove(); } var newSuperDrag = new superDrag(); There are many ways you could make this thing work. I found an interesting javascript templating plugin called jBind that makes it easy to pull markup from the dom and fill in variables. It's a lot nicer than concatenating strings, but a lot slower. On Apr 14, 4:43 am, hybris77 dist...@yahoo.com wrote: hi, I'm trying to acchieve something for a few days now and I need som guidence I need to be able to open a draggabel div, that's no worry using the jQuery UI plugin what im not getting my head around is how to create multiple instances of this window with dynamic content but with a templade html structure that is filled with data from a database i've tried to use clone() to have the template saved and hidden on the page but when using this everything fails to work at all did anyone acchieve this? I may be a little fuzzy about what my problem is, there's too much code to be posted here, what I need is a little support in my undertaking /pär
[jQuery] getting data using html attribute
Hi, i have several html tags with some additional attributes like 'type' or 'abbr'. for example : th id=col_1 class=ColumnHeader align=center abbr=language type= editabletext style=width: 130px;Language/th now i have a function which should fill the TD tag of another table based on the abbr attribute of my first table (like you can see the TH above). this function looks like that : $.getJSON(lg.php,{ start: 0, offset : 10 }, function(data) { $.each(data.records, function(i,item){ var o = tr; $(#frm_table th).each(function(j){ var tp = $(this).attr(type); if (tp != null tp != ) { switch (tp) { case 'selectrow': o += tdinput type=checkbox name='rec' value=' + item.id + '/input/td; break; case 'editabletext': var field = $(this).attr(abbr); o += td + item +. + field + /td; break; } } }); o += /tr; $(#data_grid).append(o); }); now my problem is that i'm not able to retrieve the item.id or item.language of my JSON records when i do: o += td + item +. + field + /td; i guess it's because it is taken as simple string concatenation and does not cast it as object. so how can i solve it ? thanks a lot. Alain
[jQuery] Re: getting data using html attribute
thanks a lot, it works... i was looking so complicated thing to do. :-( On Sat, Mar 14, 2009 at 5:53 PM, mkmanning michaell...@gmail.com wrote: item[field] On Mar 14, 9:46 am, Alain Roger raf.n...@gmail.com wrote: Hi, i have several html tags with some additional attributes like 'type' or 'abbr'. for example : th id=col_1 class=ColumnHeader align=center abbr=language type= editabletext style=width: 130px;Language/th now i have a function which should fill the TD tag of another table based on the abbr attribute of my first table (like you can see the TH above). this function looks like that : $.getJSON(lg.php,{ start: 0, offset : 10 }, function(data) { $.each(data.records, function(i,item){ var o = tr; $(#frm_table th).each(function(j){ var tp = $(this).attr(type); if (tp != null tp != ) { switch (tp) { case 'selectrow': o += tdinput type=checkbox name='rec' value=' + item.id + '/input/td; break; case 'editabletext': var field = $(this).attr(abbr); o += td + item +. + field + /td; break; } } }); o += /tr; $(#data_grid).append(o); }); now my problem is that i'm not able to retrieve the item.id or item.language of my JSON records when i do: o += td + item +. + field + /td; i guess it's because it is taken as simple string concatenation and does not cast it as object. so how can i solve it ? thanks a lot. Alain -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] find among same elements using name
Hi, i have a table with checkboxes which allows user to select all row/records or none. they have all the same name : row i would like to know if there is an easy way to find them in my table ? i was thinking about something like : $(#grid).find('td:row').each(function(i) { ... }); when td:row would mean each td having name = row. is there something like that ? thx. A.
[jQuery] Re: find among same elements using name
[name=row] do you mean find('td[name=row]') ? A.
[jQuery] display children using jQuery
Hi, i need to debug jQuery code and i would like to know if there is an easy way to display (as alert or into FFconsole) the children tags of a particular element ? thanks Al.
[jQuery] Re: 2 tables with same td width
Hi, so i found why my code was not working...basically i found the reason but not how to walkaround it for now. in fact my data cells (2nd table) is loaded with a getJSON data collection (as you can see below): $.getJSON(lg.php,{ start: 0, offset : 10 }, function(data) { $.each(data.records, function(i,item){ $(#tabbody).append(trtd+ item.id+/tdtd+ item.abbreviation + /tdtd+ item.description+/td/tr); }); }); so when after that i run: Grid_Colunns_Resize($(#frm_table), $(#data_grid)); it is understood (and i do not know how to solve that) that #tabbody does not contains tr or td elements... if i replace the whole getJSON function by a simple: $(#tabbody).append(trtdID/tdtdLanguage/tdtddescription/td/tr); in this case my code works perfectly. any idea how to avoid such issue ? thanks. A.
[jQuery] Re: 2 tables with same td width
On Thu, Mar 5, 2009 at 9:41 PM, MorningZ morni...@gmail.com wrote: Can you post (preferably on http://paste.pocoo.org/) what: 1) What both tables look like? (as previously mentioned, your screen shot only shows one table, that doesn't help) 2) how you are assigning the variable $slave_table Seeing both those will help solve the issue ok, for example, here is my html code snippet: div id='table_container table id=frm_table thead tr th id=col_1 class='ColumnHeaderID/th th id=col_2 class='ColumnHeaderLanguage/th th id=col_3 class='ColumnHeaderDexcription/th /tr /thead /table /div div id=data_framework table id=data_grid tbody id=tabbody tr td1/td tdENG/td tdEnglish/td /tr tr td2/td tdFRE/td tdFrench/td /tr /tbody /table /div in my jQuery code if i use : $slave_table.find(tbody).each(function(i){..}); it works but if i add the tr as following: $slave_table.find(tbody tr).each(function(i){..}); or $slave_table.find(tbody).find(tr).each(function(i){..}); it does not work those code lines are in a function defined as following: function Grid_Colunns_Resize($master_table, $slave_table) { var MaxWidths = {}; var $th; // both table exist and are only found once into document if($master_table.length == 1 $slave_table.length == 1) { $master_table.find(thead tr).find(th.ColumnHeader).each(function(i) { if (MaxWidths[i] == null || ($(this).width() MaxWidths[i])) { MaxWidths[i] = $(this).width() || 0; } } }); $slave_table.find(tbody tr).each(function(i) { alert(tbody tr); }); i call this function as following: Grid_Colunns_Resize($(#frm_table), $(#data_grid)); is it clearer ? A.
[jQuery] Re: 2 tables with same td width
On Fri, Mar 6, 2009 at 3:05 PM, MorningZ morni...@gmail.com wrote: I don't know if you copy and pasted that code right from your tool of choice, but you've got single and double quotes mixed up at div id='table_container and th id=col_1 class='ColumnHeader use single quotes or double quotes, but not one of each, that will cause major issues Sorry MorningZ, this is a copy and paste mistake... my code as normal pair of double/single quote. :-) also, your code for function Grid_Colunns_Resize is nothing like what i posted, don't you want the tables to have the same width per column? if that's the case, you have to check *both* tables to see which one is wider after reading your code, i've discovered that it is not necessary to compare each column on both tables. from my point of view it's enough when i scan the header table and (whatever is column width in slave table) to allocate this width to the data cell (slave table). am I wrong ? here's updated (and working) code with your table structure http://paste.pocoo.org/show/106700/ ok i'm going to check it today evening. A.
[jQuery] Re: 2 tables with same td width
I knew you had 2 tables, and sorry if I came across as condescending (a lot of people don't realize tables can have a header section). I'm just trying to figure out why you need to have it split into two tables. Are you trying to have the header cells follow the page as you scroll? If so, you'd be better off using jQuery to detach the thead portion, and sync that instead. That way it'll gracefully degrade with browsers/screen-readers without javascript. My brother was working on a jQuery plugin that does this. http://brentmuir.com/table/ Cheers, David Hi David, the basic topic is that later on i want to be able to drag and drop columns... so i was thinking to do it by dragging and dropping column header and not the whole column. Moreover, in my header table i have some TH elements which contains div representing column splitters :-) and those TH i do not want to check their width as in my slave_table those splitters will be represented by grid/cell borders. (basically the whole code is generated by jQuery) Alain
[jQuery] Re: 2 tables with same td width
What if the data table's first column is not wider than the header table's first column? then you'll be smushing the header in fact i was thinking to check each column headers first, and whatever width have the data columns, to allocate the column header widths to their respective data column. like that what is important it to setup well only the column header width. something like : Column_data[i].width = Column_header[i].width :-) isn't it better ? Alain
[jQuery] Re: 2 tables with same td width
Thanks MorningZ, i've check your code and there is something i do not understand... as i'm still rookie to jQuery i'm maybe asking a stupid question , so in this case sorry. when you call the following function Grid_Colunns_Resize($(#frm_table, #data_grid)); in fact $(#frm_table, #data_grid) correspond to an array of ID, am i right ? in your code you resize the width of column header not the width of cell column. will it make any changes in your code ? because basically there is not TH in the second table, but tbody, tr,td. one thing that i do not understand in find command...(maybe i'm stupid :-( ) when you write .find('tr,td') is it the same as .find('tr').find('td') ? i did not find anything in the documentation even if in books. most of the time they use .find('tr').find('td') or .find('tr td') thanks for feedback. A.
[jQuery] Re: 2 tables with same td width
sorry... i made a mistake... by .find('tr,td') i wanted to tell find(th,td) On Fri, Mar 6, 2009 at 9:23 PM, Alain Roger raf.n...@gmail.com wrote: Thanks MorningZ, i've check your code and there is something i do not understand... as i'm still rookie to jQuery i'm maybe asking a stupid question , so in this case sorry. when you call the following function Grid_Colunns_Resize($(#frm_table, #data_grid)); in fact $(#frm_table, #data_grid) correspond to an array of ID, am i right ? in your code you resize the width of column header not the width of cell column. will it make any changes in your code ? because basically there is not TH in the second table, but tbody, tr,td. one thing that i do not understand in find command...(maybe i'm stupid :-( ) when you write .find('tr,td') is it the same as .find('tr').find('td') ? i did not find anything in the documentation even if in books. most of the time they use .find('tr').find('td') or .find('tr td') thanks for feedback. A. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: 2 tables with same td width
On Wed, Mar 4, 2009 at 11:12 PM, donb falconwatc...@comcast.net wrote: Is thre some reason you can't do it with simple CSS directives? Define a Class for each td as appropriate and use the same class in the td of both tables. No jQuery or javascript needed at all. yes, because i have a different CSS code for headers and standard cells :-(
[jQuery] Re: 2 tables with same td width
On Wed, Mar 4, 2009 at 10:39 PM, MorningZ morni...@gmail.com wrote: I took a shot in the dark on what your HTML is like here's a working example http://paste.pocoo.org/show/106506/ Note: the width's of cells are not know until the page is fully loaded... hence the initial call to the function is inside $ (window).load ok, so here is a screenshot of my basic html code under firebug. as you can see there is nothing special. Alain attachment: column-width.gif
[jQuery] Re: 2 tables with same td width
On Thu, Mar 5, 2009 at 8:10 PM, MorningZ morni...@gmail.com wrote: nothing special and only one table shown yes because my previous code and question belong to this table as you can see the following code should work... but it doesn't :-( $slave_table.find(tbody tr).find(td).each(function(i) { ... }); and this is something i do not understand...
[jQuery] Re: 2 tables with same td width
On Fri, Mar 6, 2009 at 4:16 AM, David Muir davidkm...@gmail.com wrote: So you're saying you need to use js to sync the two tables so that you can use different styling for the header? Sounds like you should be updating your html markup instead. Header cells should be using th tags. table thead tr thHeader1/ththHeader2/th /tr /thead tbody tr tdCell1/tdtdCell2/td /tr etc... /tbody /table Sorry David, you missed the point. i have 2 tables. One has only header so theadtrth.../th/tr/thead and the other one as only data cell tbodytrtd.../td/tr/tbody what you wrote is a typicall table in html. A.
[jQuery] 2 tables with same td width
Hi, i have 2 tables, 1 contains only headers and another only the data. do not ask me why it is like...it has to :-) however, i must give/allocate the same td width to header and data cells. for that i was thinking to use jQuery. is there an easy way to synchronize td width of both table in order to make then look as 1 table (while scrolling data) ? or should i give an ID to each td and to call each td ID and allocate width of the headers table ? thx. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: 2 tables with same td width
On Wed, Mar 4, 2009 at 3:20 PM, MorningZ morni...@gmail.com wrote: Some code i wrote http://paste.pocoo.org/show/106445/ Call it like: Columns_Resize($(selector for tables to line up widths)) Hi MorningZ, i tried to adapt the code to my purpose and i'm facing an interesting problem. $slave_table.find(tbody tr).find(td).each(function(i) { $th = $(this); ... }); does not work...in fact if i do: $slave_table.find(tbody).each(function(i){..}); it works if i add the tr as following: $slave_table.find(tbody tr).each(function(i){..}); or $slave_table.find(tbody).find(tr).each(function(i){..}); it does not enter in the function each whereas my tbody as TR and each tr has 3 td. so where could be the problem ? thanks.
[jQuery] Re: $.getJSON
On Sun, Mar 1, 2009 at 9:59 PM, Wil Everts wileve...@gmail.com wrote: One of my favorite examples of this is the Flickr example on Visual jQuery (http://remysharp.com/visual-jquery/). $.getJSON( http://api.flickr.com/services/feeds/photos_public.gne?tags=cattagmode=anyformat=jsonjsoncallback= ?, function(data){ $.each(data.items, function(i,item){ $(img/).attr(src, item.media.m).appendTo(#images); if ( i == 3 ) return false; }); }); }); Here you can see that each presents you with a new object (called item) and it's index (i) each time through the loop below for all the returned matches for data.items. In your example (without seeing your json) item.id should work fine without an index. Hi Wil, so if i understood well, having the following JSON: {records:[{id:1,abbreviation:fre,description:french},{id:2,abbreviation:eng,description :english},{id:3,abbreviation:ger,description:german},{id:4,abbreviation:svk,description :slovak},{id:5,abbreviation:spa,description:spanish},{id:6,abbreviation:usa,description :american},{id:7,abbreviation:ita,description:italian},{id:8,abbreviation:por,description :portuguese},{id:9,abbreviation:cze,description:czech},{id:10,abbreviation:rus,description :russian},null,null,null]} i should write : $.each(data.records, function(i,item){...}); where data.records is the name of my JSON result...so records (in my JSON). am I right ? A
[jQuery] Re: $.getJSON
On Mon, Mar 2, 2009 at 10:52 AM, Matt Quackenbush quackfu...@gmail.comwrote: Yes. On Mon, Mar 2, 2009 at 3:35 AM, Alain Roger wrote: Hi Wil, so if i understood well, having the following JSON: {records:[{id:1,abbreviation:fre,description:french},{id:2,abbreviation:eng,description :english},{id:3,abbreviation:ger,description:german},{id:4,abbreviation:svk,description :slovak},{id:5,abbreviation:spa,description:spanish},{id:6,abbreviation:usa,description :american},{id:7,abbreviation:ita,description:italian},{id:8,abbreviation:por,description :portuguese},{id:9,abbreviation:cze,description:czech},{id:10,abbreviation:rus,description :russian},null,null,null]} i should write : $.each(data.records, function(i,item){...}); where data.records is the name of my JSON result...so records (in my JSON). am I right ? thanks Matt.
[jQuery] $.getJSON
hi, i do not understand so well how the function getJSON works. i've read the documentation but i think i miss the point. i would like to pass some argument/parameter to a php file which in return gives me som JSON answer. therefore i wrote the following code: $.getJSON(lg.php, { start: 0, offset : 5 }, function(data) { $.each(data, function(i,item) { alert(item[0].id + \ni : +i); }); }); 1.how can i get each item without using a hardcoding 0 or 1 as index ? i did not find anything into documentation :-( thanks a lot for feedback -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] scrolling function
Hi, i have a div with the scrolling function attached to it as following: $(#data_framework).scroll(function(e){ //var maxScroll = $(#data_framework).attr(scrollWidth) - $(#data_framework).width(); $(#frm_table).scrollLeft($('#data_framework').scrollLeft); }); as you can see when user scrol the div #data_framework, it should scroll by the same amount of pixel the next div called #frm_table. however this code does not work... 1. how can i know if it was scroll on X-Axis or on Y-axis ? 2. how can i scroll the div #frm_table from the same amount of pixel ? 3. should i use animate ? thanks a lot. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] 2 divs with a single scrollbar
Hi, i did not get any anwser (at least i did not get answer emailed)...so sorry if someone did. i'm back with my question about 2 divs with 1 of them including an horizontal scrollbar. how can i scroll both divs horizontally when user scroll only 1 of them using the scrollbar ? i read jQuery helps about binding but i'm not sure it is the right thing to do. any help would be really appreciated. thanks a lot -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: How to loop through JSON data
Hi, first i would rather suggest to not use numbers as array name... in your example you will have problem while debuggin code and i'm not sure that it will work correctly. so i would suggest instead of using 9 to use something else but with characters. you can do something like that (where myarray is corresponding to your 9: for (i in myarray) { var _title = myarray[i].title; var _style = myarray[i].style; ... } HTH, Alain On Sat, Feb 21, 2009 at 12:51 PM, newkid85 newki...@googlemail.com wrote: If I have JSON data like this: { 9: { title: Event 1, style: rock }, 11: { title: Event 2, style: pop }, 15: { title: Event 3, style: house }, 16: { title: Event 4, style: metal} } How can I loop through each item grabbing each key/value pair for outputting? Is this possible with $.each? I tried the following: var event = ''; $.each(results, function(title, style) { event += 'div' + title + ' ' + style + '\/div'; }); $('#events').html(event); But it returned 9 [object Object] 11 [object Object] 15 [object Object] 16 [object Object] I'm guessing my syntax is wrong or I am misusing the function. Any help appreciated. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] .height() issue
Hi, i use the following code to set up the height of a div (framework): var GridTitle_OuterHeight = parseInt($(#gridtitle).outerHeight(),10); var Navigation_OuterHeight = parseInt($(#navigation).outerHeight(),10); var FrmBottomBorder = parseInt($(#framework).css(borderBottomWidth), 10); var FrmTopBorder = parseInt($(#framework).css(borderTopWidth), 10); ... ... $(#framework).height(op.height - GridTitle_OuterHeight - FrmTopBorder - FrmBottomBorder - Navigation_OuterHeight); with op.height = 300. when i user an alert() just after all vars but before the $(#framework).height(..) as following: alert(Op height : +op.height + \n\nGridTitle outer height : + GridTitle_OuterHeight + \n\nNavigation height : + Navigation_OuterHeight); it works correctly and returns me the good values. however, the $(#framework).height(...) does not work under IE7, why ? when i wrote it does not work, in fact, it does not setup the height of the Framework div to the correct height, but to the default one :-( any idea ? thx. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] slideUp strange behavior under IE7
Hi, i have a div which i use to slideUp with jQuery. if under FF3 there is not problem, i met an issue under IE7. for example if i have several divs within this SlideUp div, (and that there is 1 div which is placed with css at the bottom of this SLideUp div) while this div is slidingup, the bottom child div, is not slidinup with the whole content of the sliding div, but it only disappear on the sliding div is hidden... so where could be the problem ? i do not understand as under FF the whole content of this sliding div is sliding up but not under IE7. all divs not align with TOP or BOTTOM parameters (under IE7) are correctly sliding together with sliding div content. thx -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] scrolling bar and table
Hi, i would like to know if something exists in jQuery to allow me to do the following thing: i have 2 divs and when 1 is scrolling horizontally, i would like to scroll the other one by the same amount of pixels (as the first one). if not, i guess i must use something from pure javacript. thx. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: getting border with without em or px
i discovered later on that effectively something like : var borderbottom = parseInt($(#framework).css(borderBottomWidth), 10); works well for that i wanted to do :-) On Sat, Feb 14, 2009 at 8:58 PM, mtsmit2 mtsm...@gmail.com wrote: Hey, There might might be an easier/better way but I always do the following when I get number values from CSS: parseInt($(.someclass).css(left)); On Feb 14, 2:30 pm, Alain Roger raf.n...@gmail.com wrote: Hi, i know how to get border width with jQuery but every time it retrieves also the format (px or em). is there an easy way to get the border width without the px or em ? or should i do a substring ? thx. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008 -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] JSON and jQuery
Hi, i didn't find anything on jQuery and JSON. is there any decoder ? thanks a lot. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] wait end of slideUp()
Hi, i have 2 divs (one on the top and one below). when user click on top div, the bottom div is SlidingUp slowy and the top div class should change. this works well, but to make it perfect i would like to be sure that my bottom div is completly slided Up before to change class of my top div. how can i do that ? thx -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: wait end of slideUp()
Thanks a lot Pierre. On Sat, Feb 14, 2009 at 11:28 AM, FCY-Pierre fcy...@gmail.com wrote: Hi, The slideUp effect has a callback function. It was called when the animation is complete. So, this code should works $('#myDiv').slideUp('slow',function(){$('myTopDiv').addClass('myclass');}); pierre Alain Roger a écrit : Hi, i have 2 divs (one on the top and one below). when user click on top div, the bottom div is SlidingUp slowy and the top div class should change. this works well, but to make it perfect i would like to be sure that my bottom div is completly slided Up before to change class of my top div. how can i do that ? thx -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008 -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] getting border with without em or px
Hi, i know how to get border width with jQuery but every time it retrieves also the format (px or em). is there an easy way to get the border width without the px or em ? or should i do a substring ? thx. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Newbie Frames
Hi I am new to Jquery and I've got a problem. I'm working on a very old site that uses deeply nested frames. I want to dynamically change the size of, and animate, some of the frames based on (a) setup time and (b) user interaction. I've googled and most of the responses that I've seen are about iframes. I've seen a few messages that imply that what I need to do is possible but assume that I have a deeper knowledge of Jquery and javascript than I actually have. So I have html pages that set up the frames and pages that provide the content - where do I need to put the script what do I need to do to access the frame controls? Regards
[jQuery] toggle question
Hi, I would like to simulate the maximize/minimize window effect. So i created an image Maxi and an image Mini. maxi is displayed by default. When user click on this image, a div should be displayed (no problem for that point) and the Mini image should be displayed instead of Maxi. for sure, if user click on mini image, in this case the div will disappear and the maxi image should replace the mini one. from my point of vie this is typically a toggle system but how to implement it in jQuery ? i was looking at Toggle function but every time there are minimum 2 similar tag from which the toggle is applied :-( thanks a lot, -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] add a child node using jQuery
Hi, i have a table tage and i would like to add a thead node using jQuery. what is the best method in order to get tablethead.../thead/table ? thx -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] innerWidth issue
Hi, i have the following html code: div id=#ARGrid table class='framework' thead tr td class='.gridtitle'this is a simple test/td /tr /thead /thead /table here is my css file: #ARGrid { border : 3px solid #aa; padding : 0; margin : 0; font-family : verdana, tahoma; font-size : 10px; } .framework { background-color : #f0f0f0; border-collapse : collapse; } .framework, .framework thead, .framework thead tr { margin : 0; padding : 0; } .gridtitle { float : left; display : inline; height : 20px; background-color : #ff; } i want my td class='gridtitle' tag to take the whole width of the tr (so of the table). why do i get wrong result using $(.framework thead tr).innerWidth() ? i get every time 500 px unfortunatelly based on some test i should get 498px. when td is 500 px, it's going outside my div :-( any idea ? thanks a lot, -- Alain ---
[jQuery] Re: innerWidth issue
thanks a lot it works well :-) On Wed, Feb 11, 2009 at 9:46 PM, James james.gp@gmail.com wrote: For HTML attributes, you should always use double-quotes: Use: table class=framework Not: table class='framework' On Feb 11, 10:26 am, amuhlou amysch...@gmail.com wrote: I'm not quite sure why you would need special code to make the td span the width of the entire tr. If it's a 1-column table, the td.gridtitle should do that automatically. Can you post a link to an example of the problem you're having? In the example here, you also have an extra /thead -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] table header order
HI, i have a table with thead, tbody and the headers (stored in thead) should be able to be moved to reorder the table. for example, if the 1st column is ID, the 2nd column is Name and 3rd one is firstname, i want user to be able to drag and drop column firstname between ID and Name columns. so the firstname would be the 2nd column now. how can i do that using jQuery ? thx. -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] rookies in jQuery and grid
Hi, i'm newbie to jQuery however i watched those videos on internet and it seems that jQuery is a very powerful library now. i have a grid/table that i would like to create using jQuery, it would be a wonderful try from my side. I know that some tables and grids plug-ins already exist but i want to try by my own. 1. what should i take care to create my own plug-in using jQuery ? 2. where should i look for to base my grid with basic features (sorted columns, filtering columns, pagination, and so on...) ? I'm looking for some basic tutorial or helps. thanks a lot, -- Alain --- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6 C# 2005-2008
[jQuery] Re: Plugins/Validation
Thanks! That will save me and a bunch of folks some headaches! Roger On Jun 9, 5:39 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: This is now fixed in the latest revision, which references jQuery at load-time and as no dependency at runtime:http://dev.jquery.com/view/trunk/plugins/validate/ Jörn On Sun, Jun 8, 2008 at 5:10 PM, roger [EMAIL PROTECTED] wrote: I've just been trying out the Validation plugin, and in the jquery.validate.js file I found a mix of jQuery.foo and $.foo statements. I'm thinking of using this in a WordPress admin page, which already includes jQuery 1.2.3 and uses it in the form jQuery(), probably because it also uses other frameworks. So I get errors when Firefox encounters the $() calls... and the easy way out was to edit the jquery.validate.js file. Is the validate code inconsistent, or should I be creating some kind of alias to work around it? I hesitate to do so, it may cause conflicts with other WordPress plugins or base features. (I get no errors after I change the calls, there are only a few $. or $ () references in the file... but I haven't seen this issue with other jQuery libraries) Roger
[jQuery] Plugins/Validation
I've just been trying out the Validation plugin, and in the jquery.validate.js file I found a mix of jQuery.foo and $.foo statements. I'm thinking of using this in a WordPress admin page, which already includes jQuery 1.2.3 and uses it in the form jQuery(), probably because it also uses other frameworks. So I get errors when Firefox encounters the $() calls... and the easy way out was to edit the jquery.validate.js file. Is the validate code inconsistent, or should I be creating some kind of alias to work around it? I hesitate to do so, it may cause conflicts with other WordPress plugins or base features. (I get no errors after I change the calls, there are only a few $. or $ () references in the file... but I haven't seen this issue with other jQuery libraries) Roger
[jQuery] Zope3/JQuery Sprint
Hi all I'm a core developer of Zope3 and we organize a Zope3 Sprint in the Boston Area. One task whould be to integrate JQuery using JSON RPC. And intergrate JSON RPC support for JQuery which JQuery doesn't support right now. We also thinking about to build a Zope3 application server release which offers built in JQuery and JSON libraries ready to use for deveopers. You can see some early prototyping here: http://alpha.z3c.org Let me know if somebody is interested to join us at the sprint in Concord, MA, USA. The sprint starts Monday, September 24, 2007 at 9:00 am EST and lasts until Friday, September 28, 2007 in the afternoon. The goal of the sprint is to work on Zope 3 core packages or technologies closely related to it. The topics that we will be able to address will heavily depend on the participants. For more info about the Zope3 sprint: http://wiki.zope.org/zope3/FoliageSprint You can read more about Zope3 here: http://www.zope.org/ Just a general question to all of you; Is anybody using JQuery on top of Zope3 or another Python framework? If yes, we started uploading some JQuery plugin libraries to the PyPi: http://pypi.python.org/pypi?%3Aaction=searchterm=jquery Regards Roger Ineichen _ Projekt01 GmbH www.projekt01.ch Boesch 65 6331 Hünenberg phone +41 (0)41 781 01 78 mobile+41 (0)79 340 52 32 fax +41 (0)41 781 00 78 email [EMAIL PROTECTED] _ END OF MESSAGE
[jQuery] AW: [jQuery] Re: JSON MIME type?
Hi Stephan, Yehuda -Ursprüngliche Nachricht- Von: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Stephan Beal Gesendet: Donnerstag, 23. August 2007 17:47 An: jQuery (English) Betreff: [jQuery] Re: JSON MIME type? On Aug 23, 5:33 pm, Michael Randolph [EMAIL PROTECTED] wrote: I'm using the jQuery Form plugin to call an ASP.NET 2.0 page. The call works just fine, but the response never comes back right. If the Response.ContentType is set to text/plain the page gets forwarded to a plain text JSON result. json is in fact plain text. It is only turned into an Object by passing that text to eval(). Once you get the response text, simply do: eval(responseText). Mime types are not only describing the content format which get sent, they describe more, e.g. the application which should get used. Web servers need this information for act as needed. We at Zope 3 implemented request factories using the Twisted server which get used if a relevant Mime type get sent from a client. This means JSON calls from the JQuery lib to a Zope 3 server will fail because of the bad JSON mime type set in JQuery. Is there a way to change the existing text/plain to the recommended application/json for JSON calls? Michael, Probably you can use the json client lib I've implemented for Zope3 supporting application/json. svn://svn.zope.org/repos/main/jquery.javascript/trunk/src/jquery/javascript/ js Regards Roger Ineichen _ END OF MESSAGE
[jQuery] AW: [jQuery] Re: OT: A Big Idea
Hi Christof -Ursprüngliche Nachricht- Von: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Christof Donat Gesendet: Montag, 30. Juli 2007 11:53 An: jquery-en@googlegroups.com Betreff: [jQuery] Re: OT: A Big Idea Hi, I wanted to comment your blogpost, but could not register. Anyway. http://commadot.com/?p=581 I would love your thoughts on it. I don't understand, why people think that this idea is so great, but i'm not 100% shure if I have really understood it. Do you whant to use a HTML rendering engine inside flash or do you whant to use a HTML rendering plugin? I case you whant to use a HTML renderer in flash. Why? You can use flash for any rendering stuff if you need exact virusal reproduction. What do you gain when you give HTML to the flash film? In case you'd like a HTML plugin. Why? People won't install it, because basically their browser does HTML rendering for them. And they don't care about standards, otherwise noone would ever have used Netscape 2 or Internet Explorer 6. I understand you whant a single rendering engine to make shure that your HTML/CSS code always looks the same. I don't. 1. The web has never been designed to give you exactly the same results everywhere. It has been designed to give the user the best possible access to the information independent from his eventual disabilities. Use the tool as it is and don't complain that your hammer is not a saw. I'm pretty sure the web in a couple years whould be the same but the tools will drasticly change. Take a look and see what's going on right now. 2. If you still need exact visual reproduction of something, there is always flash. You can not have accessability and exact visual reproduction at the same time as much as you never can exactly measure position and momentum at the same time. That's the idea behind it. They like to change this in the future. Isn't that a good idea? 3. We have had a browser engine to rule them all, IE, but noone ever liked it. You just change the dictator but stay in domination. Having multiple browser engines gives the users back their freedom of choice. For web developers an designers it sometimes is a pita, but in the whole it is better to have a pita for some and freedom or all. I guess the idea behind the concept is to get a way to use a specific rendering engine in different browsers. This means the software we speak about is a piece of midleware which runs in a browser of the users choice and is able to render the visited page with the engine the developer decides to use. This would make the develeopers choose the rendering engine and the user the browser. Isn't that freedom? btw, I think we could get in trouble in the near future if we just buy what others do. I think it's more then interesting to try to get a foot into the door and develop a middleware which makes it possibible to let us choose rendering engines etc. This yould make us much more independent from the browser companies and give us the prower we need. I don't telling everything will become better and there will be no rendering problems or bugs etc. But the idea is really interesting. Regards Roger Ineichen Christof
[jQuery] http://:/ issue?
Hi all I have on my server and see it on this page too: http://dev.iceburg.net/jquery/jqModal/ a problem. There is a call to http://:/ initialized from the JQuery library. Any idea what forces JQuery to do this call? Regards Roger Ineichen _ Projekt01 GmbH www.projekt01.ch _ END OF MESSAGE
[jQuery] AW: [jQuery] Re: http://:/ issue?
Hi Erik I see it on different pages. Here is one: http://alpha.z3c.org/ It happens with JQuery packed or full version, also with version 1.1.3.1. or 1.1.2 I have this issue only with IE7. Here's a traffic report. See no. 5 after jquery.pack.js: 110:36:42:421 0.234 s GET 200 7.06 K text/html http://alpha.z3c.org/ 210:36:42:656 0.172 s GET 200 10.70 K application/x-javascript http://alpha.z3c.org/@@/xmlhttp.js 310:36:42:843 0.109 s GET 200 6.89 K application/x-javascript http://alpha.z3c.org/@@/json.js 410:36:42:968 0.249 s GET 200 21.04 K application/x-javascript http://alpha.z3c.org/@@/jquery.pack.js 510:36:43:265 0.000 s GET 0 (None)http://:/ 610:36:43:265 0.078 s GET 200 2.60 K application/x-javascript http://alpha.z3c.org/@@/jsonform.validate.js 710:36:43:343 0.171 s GET 200 13.13 K application/x-javascript http://alpha.z3c.org/@@/interface.js 810:36:43:531 0.061 s GET 200 3.38 K application/x-javascript http://alpha.z3c.org/@@/jquery.livesearch.js 910:36:43:609 0.124 s GET 200 7.01 K application/x-javascript http://alpha.z3c.org/@@/jquery.corner.js 10 10:36:43:765 0.046 s GET 200 1.64 K application/x-javascript http://alpha.z3c.org/@@/demo.js 11 10:36:43:828 0.139 s GET 200 6.33 K application/x-javascript http://alpha.z3c.org/@@/jquery.resteditor.js 12 10:36:43:968 0.063 s GET 200 1.70 K text/css http://alpha.z3c.org/ ... more images Regards Roger Ineichen -Ursprüngliche Nachricht- Von: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Erik Beeson Gesendet: Donnerstag, 12. Juli 2007 09:50 An: jquery-en@googlegroups.com Betreff: [jQuery] Re: http://:/ issue? When do you see such a thing happening? I'm using firebug to watch all network traffic and I don't see that request, nor do I see any javascript errors that would indicate something isn't right... --Erik On 7/11/07, Roger Ineichen [EMAIL PROTECTED] wrote: Hi all I have on my server and see it on this page too: http://dev.iceburg.net/jquery/jqModal/ a problem. There is a call to http://:/ initialized from the JQuery library. Any idea what forces JQuery to do this call? Regards Roger Ineichen _ Projekt01 GmbH www.projekt01.ch _ END OF MESSAGE
[jQuery] AW: [jQuery] Re: AW: [jQuery] Re: http://:/ issue?
Hi Mike Betreff: [jQuery] Re: AW: [jQuery] Re: http://:/ issue? I don't see it happening here. This is the URL list I got using IE7 and Fiddler2: [...] No funny /:/ in the list. Not sure what that is about or why you're seeing it. What tool are you using to watch the traffic? I'm using HTTP Analyzer from: http://www.ieinspector.com/ The IE 7 really tries to call http://:/ and this ends in not finish loading the page. It's not only a traffic tool issue. I also removed any other JS and CSS and it still happens with only jquery.js and no other css or javascript. It's really bad because the thickbox page shows up without any layout if this happens. I also have to say, that I've the multi version IE installed next to the IE 7. But the IE 7 installation is the original one. But I don't think that has to do with the issue. Regards Roger Ineichen _ END OF MESSAGE -Mike From: Roger Ineichen I see it on different pages. Here is one: http://alpha.z3c.org/ It happens with JQuery packed or full version, also with version 1.1.3.1. or 1.1.2 I have this issue only with IE7. Here's a traffic report. See no. 5 after jquery.pack.js: 110:36:42:421 0.234 s GET 200 7.06 K text/html http://alpha.z3c.org/ 210:36:42:656 0.172 s GET 200 10.70 K application/x-javascript http://alpha.z3c.org/@@/xmlhttp.js 310:36:42:843 0.109 s GET 200 6.89 K application/x-javascript http://alpha.z3c.org/@@/json.js 410:36:42:968 0.249 s GET 200 21.04 K application/x-javascript http://alpha.z3c.org/@@/jquery.pack.js 510:36:43:265 0.000 s GET 0 (None)http://:/ 610:36:43:265 0.078 s GET 200 2.60 K application/x-javascript http://alpha.z3c.org/@@/jsonform.validate.js ...
[jQuery] different name and id issue?
Hi all We at the Zope3 dev mailinglist have a question to you genious JQuery developers. We run into a IE 67 issue related to DOM element id and name. The following two onclick handler return both Bar as value in IE 6 and 7. Does anybody know why? html headtitletest/title/head body form input type=submit name=foo id=bar value=Bar / input type=submit name=baz id=foo value=Foo / /form span onclick=javascript:alert(document.getElementById('bar').value)bar (ok)/span span onclick=javascript:alert(document.getElementById('foo').value)foo (problem on IE 6 7)/span /body /html What rule whould you recommend for generate id and name attributes for a framework which generates input fields, buttons etc. In the new form framework we are developing right now, do we generate element id and name values like: id=form-widgets-lastname name=form.widgets.lastname Is this acceptable or is there any reason using another naming convention for element ids and names? Thanks for any hint. Regards Roger Ineichen ___ Zope3-dev mailing list [EMAIL PROTECTED]
[jQuery] AW: [jQuery] Re: different name and id issue?
Hi Klaus Betreff: [jQuery] Re: different name and id issue? [...] This is a known IE bug. Id and the name attribute share the same namespace in IE giving you the (unexpected) result you're talking of (getElementById gives you the first occurence of an element with the given id or name). I wonder what the developers were thinking... jQuery has fixed this by the way when using an id selector. I didn't except anything else ;-) [...] id=form-widgets-lastname name=form.widgets.lastname Is this acceptable or is there any reason using another naming convention for element ids and names? I haven't seen periods in name attributes yet, but they are allowed per HTML spec. Another option would be to use the underscore: id=form-widgets-lastname name=form_widgets_lastname What is more important is to avoid that a name attribute matches an id, which both variants do provide. That's good to know. Thanks a lot Klaus Regards Roger Ineichen _ END OF MESSAGE
[jQuery] Re: Select box change event infinite loop in ASP.NET
Mike, On May 22, 2007, at 1:17 PM, Mike Chabot wrote: I have a simple function to capture the OnChange event of a drop-down select box. In MSIE, it works as expected, but Firefox gets caught in an infinite loop. Has anyone else seen this problem? I have a counter to track the problem. In MSIE, the counter goes up by 1 for every change. In Firefox, the counter jumps by 21 with every change. I guess 21 is some recursive limit inside of Firefox. jQuery 1.1.2 and ASP.NET 2.0. var count=0; $(document).ready(function() { var selectBox = $%= Me.FormView1.ClientId %_ddlTestList; $(selectBox).change( function() { count = count + 1; $(#countId).text(count: + count); } ); }); Are you using your scroll wheel or arrow keys to select from the menu? I've noticed that ie doesn't fire the change event until you tab out of the select while firefox fires the onchange event every time you make a new selection (at least on my mac) You can save yourself a lot of debugging time by using the firebug firefox extension. hth Roger, -- Roger Roelofs [EMAIL PROTECTED]
[jQuery] Re: alerting the value of radio button onfocus
Stef, On May 22, 2007, at 10:40 AM, stef wrote: when a radio button is clicked, show its value. i have the code below, which i dont think is the best way to go about it. it always alerts undefined. my reasoning is: when the document has loaded, and an input element in the div with id 'test' is focussed, show an alert of the value of the currently checked radio button. $(function(){ $(#test/input).focus( function() { alert($([EMAIL PROTECTED]@checked]).value);}); }); Having a url to a live page to debug would make it easier for us to help you. A guess would be something like this... $(function() { $(#test/[EMAIL PROTECTED]'radio']).bind(focus, function() { if ( this.checked ) alert(this.value); }); }); -- Roger Roelofs
[jQuery] Re: show/hide revisited
Schnuck, On May 18, 2007, at 11:21 AM, Schnuck wrote: i have this bit of code here (and god knows how old, unstylish and inefficient the code below might be) and all i am trying is to make one or two particular divs with set ids/classes to show and hide triggered by a remote image somewhere else on the page. the image, let's say a plus icon switches to a minus icon depending on the state of the toggled divs. the example below at least does toggle between shwo hide but the div it should hide doesn't do anything. also, in the example it uses text to display show or hide, this could be done with images (like plus and minus)? Maybe you have an answer already, but I didn't see one on the list. You can make the code simpler. Something like this. $(document).ready(function() { $('.commenting').hide(); $('a.show_com').click(function() { if ( this.className == show_com ) { $(.commenting).slideDown('slow'); $(this).removeClass(show_com).addClass(hide_com).text(HIDE COMMENTS); } else { $(.commenting).slideUp('fast'); $(this).removeClass(hide_com).addClass(show_com).text(SHOW COMMENTS); } return false; }); }); If you want a plus or minus you can either do it in test $(this).removeClass(show_com).addClass(hide_com).text(-); or you can add a background image in css a.show_com, a.hide_com { width: 16px; height: 16px; } a.show_com { background-image: plus.gif; } a.hide_com { background-image: minus.gif; } The code could be even simpler if you use one class. $('a.show_com').click(function() { $(this).toggleClass(show_com); $(.commenting).slideToggle(slow); return false; }); then the css would be a { width: 16px; height: 16px; background-image: minus.gif; } a.show_com { background-image: plus.gif; } -- Roger Roelofs
[jQuery] Re: EXTjs.com
Subject: [jQuery] EXTjs.com http://extjs.com Just launched. fyi. Wow, very interesting work. Hmm, it's not valid CSS, HTML and does not fit if you need to support WAI or 508 standards. Does anybody know if Ext will support accessibility in the future? JQuery and Ext could be a dream team if so. But anyway it's one of the coolest widget package. Regards Roger Ineichen _ Projekt01 GmbH