[jQuery] Accordeon - IE6 - selectbox not displayed
Hi, I got an iframe rendered within an accordeon. Within that iframe is a form. The select-boxes (and only those) within that iframe are not displayed in IE6. I tried: display: block, z-index removed scripting - worked. It seems to come from the hiding/unhiding part of the accordeon-plugin. Although the same problem does not occur whithout the iframe (form elements fine when directly placed in accordeon). Any hints? Mike
[jQuery] linking to areas within a page that uses "accordeon"
Hi, I'm using both "accordeon" and "tab navigation" on a portal. Is ist possible lo link to various areas of a page from within that page. It does work from another document - sort of deep-linking into a document - like this: http://localhost/templates/expansionspage.php#tabContent-03";> Go to div id="tabContent-03" and open expansion/accordeon accordingly It does not work from within that page, say a link from within #tabcontent-01 to #tabcontent-03: From somewhere within div id="tabcontent-01": Go to div id="tabContent-03" and open expansion/accordeon accordingly This is what an author would want to do while editing such a document... Any ideas? Gacias, Mike Schwoortz
[jQuery] Re: Input field: focus=remove text; blur=put it back
Hi, I did this here: /* get default value of any and make it disappear when the user focusses the input field when the focus is taken from that field (blur), do this: if nothing was entered by the user, set back the default value, otherwise don't mess with the users input */ $('input').focus(function(){ var defaultText = $(this).val(); $(this).val(''); $("input").blur( function () { var userInput = $(this).val(); if (userInput == ''){ $(this).val(defaultText); } }); }); on this HTML: Search: Is that what you want to do? I guess it could be optimized, though Regards Michael Original message Donnerstag, 17. Juli 2008, 18:19: > Is there a plugin for this by chance? I know it's pretty quick to write, but > wanted to find out if someone's already done it better than I could. > > Also, would toggle() work for this sort of thing? Is there a focus/blur > toggle in the jQuery core?
[jQuery] Re: hover effect for input type="image" (beginner question)
Hi Andrea, > hi :) Thanks alot! > hope this helps :) It does help so much, as well as your explanation! I'll now try to make that hover function more generic 'cause I have more than one input button per page Michael
[jQuery] hover effect for input type="image" (beginner question)
Hi everybody, I have the following code: An I would like to A) change src="/img/btn_search.gif" into src="/img/btn_search_hover.gif" onMouseOver and back onMouseOut B) change value="search for..." onFocus I know this is really a jQ-beginner question and it should be easy, but... Any directions? (Doctype is http://www.w3.org/TR/html4/loose.dtd";> if that matters!?) -- Michael Schwarz Web Freelancer - Berlin http://www.michaelschwarz.net/ http://www.mobilewebdesign.de/
[jQuery] Re: $.ajax({datatype:"html"... does not seem to evaluate scripts?
$("#myid").html("bold alert(1);"); Maybe this does help you, not tested. Michael On Oct 14, 10:46 am, Vikas patial <[EMAIL PROTECTED]> wrote: > Hello > > Im facing the same problem , does anyone have a solution to this > problem. > > Regards > > Vikas > > On Oct 4, 5:15 pm, joelarson <[EMAIL PROTECTED]> wrote: > > > > > Nevermind everyone, I sorted it out. > > > On Oct 3, 10:18 am, joelarson <[EMAIL PROTECTED]> wrote: > > > > The documentation notes that when using the $.ajax() functions option > > > datatype="html": > > > > "html": Returns HTML as plain text; includedscripttags are > > >evaluated > > > > however, it doesnotappear to me that this is happening. What am I > > > missing? > > > > My very simple code is here: > > > > - > > > ... > > > > $.ajax({type:"GET",dataType:"html",url:"test.htm",success:function(dta) > > > { > > > alert(dta); > > > }}); > > > ... > > > > > > > test.htm-- > > > hello > > > > > > alert("hello?"); > > > > > > -- > > > > I do get my alert with the content from alert(dta), but I never get an > > > alert with "hello?". What am I missing?- Hide quoted text - > > - Show quoted text -
[jQuery] Re: How width/height is calculated? [2]
Ok, I got it... thanks to extJS ;) var changed = null; function beginMeasure(el) { if(el.length == 0) return; changed = []; while(!el.is("body")) { if(el.css("display") == "none") { changed.push({el: el, visibility: el.css("visibility")}); el.css({visibility: "hidden", display: "block"}); } el = el.parent(); } } function endMeasure() { if(changed == null) return; for(var i=0; i wrote: > Hi, > > I have the same problem and didn't find a solution yet. Is there any > way that I can get the height of elements not visible (because their > display css property is set to none or because parent elements > properties hide this element, too). > > Michael > > On Jun 17, 4:50 am, "Fred Janon" <[EMAIL PROTECTED]> wrote: > > > > > Klaus, > > > Humm, I still can't get the size of an element while it's hidden and > > absolute... > > > I tried with an element: > > > style="display: none; position: absolute" > > > and > > > alert("id: " + elt.id + " height: " + elt.offsetHeight + " width: " + > > elt.offsetWidth); > > alert("id: " + elt.id + " style.height: " + elt.style.height + " > > style.width: > > " + elt.style.width); > > > I still get height:0 and width:0 and style.height "" as well as style.width. > > > Did you mean that the element position is made absolute, moved off screen > > and made visible to get its size and then made static and hidden again? > > > Thanks > > > Fred > > > On 6/17/07, Klaus Hartl <[EMAIL PROTECTED]> wrote: > > > > Fred Janon wrote: > > > > Hi, > > > > > I am trying to understand how the height of an element is calculated in > > > > jQuery. I don't understand how the height can be calculated especially > > > > when the element is hidden with display:none. > > > > > Thanks > > > > > Fred > > > > Fred, > > > > if the particular element is hidden, it is absolutely positioned while > > > invisible (and the parent element its context), instead of "display: > > > none", and the height can then be calculated. Thereafter these styles > > > are resetted. > > > > There is one issue: If not the element itself but some parent element is > > > hidden via setting display to none, you won't get the correct height. > > > Its just to expensive to use the above described technique for some > > > parent element. > > > > --Klaus- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
[jQuery] How width/height is calculated? [2]
Hi, I have the same problem and didn't find a solution yet. Is there any way that I can get the height of elements not visible (because their display css property is set to none or because parent elements properties hide this element, too). Michael On Jun 17, 4:50 am, "Fred Janon" <[EMAIL PROTECTED]> wrote: > Klaus, > > Humm, I still can't get the size of an element while it's hidden and > absolute... > > I tried with an element: > > style="display: none; position: absolute" > > and > > alert("id: " + elt.id + " height: " + elt.offsetHeight + " width: " + > elt.offsetWidth); > alert("id: " + elt.id + " style.height: " + elt.style.height + " style.width: > " + elt.style.width); > > I still get height:0 and width:0 and style.height "" as well as style.width. > > Did you mean that the element position is made absolute, moved off screen > and made visible to get its size and then made static and hidden again? > > Thanks > > Fred > > On 6/17/07, Klaus Hartl <[EMAIL PROTECTED]> wrote: > > > > > > > Fred Janon wrote: > > > Hi, > > > > I am trying to understand how the height of an element is calculated in > > > jQuery. I don't understand how the height can be calculated especially > > > when the element is hidden with display:none. > > > > Thanks > > > > Fred > > > Fred, > > > if the particular element is hidden, it is absolutely positioned while > > invisible (and the parent element its context), instead of "display: > > none", and the height can then be calculated. Thereafter these styles > > are resetted. > > > There is one issue: If not the element itself but some parent element is > > hidden via setting display to none, you won't get the correct height. > > Its just to expensive to use the above described technique for some > > parent element. > > > --Klaus- Hide quoted text - > > - Show quoted text -
[jQuery] Search for a parent element
Hi, is it possible to find a parent element? See following example: 1 2 3 4 $("[EMAIL PROTECTED]").bind("click", function(ev) { alert($(ev.srcElement).html()); }); If you run this you will always get the element under the mouse instead of the _prop element (which you want to get). What I'm searching for is something like: $("[EMAIL PROTECTED]").bind("click", function(ev) { alert($(ev.srcElement).findParent("[EMAIL PROTECTED]").html()); }); Michael
[jQuery] Re: Dimensions 1.1 Released
Ok, so I have first to create a new variable, check if it is null or not, and then get the height? var h = 0; var ele = $("#id1:visible"); if(ele.length > 0) h = ele.outerHeight({margin: true}); if(h > 0) $("#id2").height(h); instead I would like to write: $("#id2").height($("#id1:visible").outerHeight({margin: true})); When I use the .height method of jQuery I get null as return value, that would be ok instead of throwing an error. Michael On Aug 13, 1:42 pm, "Brandon Aaron" <[EMAIL PROTECTED]> wrote: > The error has been tricky issue. Most jQuery functions operate on zero or > more elements in a jQuery collection. However, some methods only operate on > the first matched element and return some value. If a script is depending on > a value from the offset method, there will be an error somewhere. I'm just > trapping the error, otherwise it is very cryptic to those who haven't seen > it before. returning anything like 0 instead of an error would just cause > even more confusion because it would look like it was reporting a height or > width of 0. > > Thanks for the feedback! :) > > -- > Brandon Aaron > > On 8/13/07, Michael Schwarz [MVP] <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > I love this, as I did a very similar plugin. Well, the only thing I > > don't like is the error() in all methods. Maybe it should return 0 > > instead, and somewhere else the plugin could be configured to throw an > > exception or return 0. > > > Michael > > > On Aug 13, 6:34 am, "Brandon Aaron" <[EMAIL PROTECTED]> wrote: > > > I just released Dimensions 1.1. It includes an option to include margin > > for > > > the outerWidth and outerHeight methods. I've also fixed the issues with > > > Safari 3 and the offset method. The docs have also been udpated for 1.1. > > As > > > usual you can grab the latest from the Dimensions project page. Note > > that > > > this update requires jQuery 1.1.3. > > > > project page:http://jquery.com/plugins/project/dimensions/ > > > docs:http://brandonaaron.net/docs/dimensions/ > > > > -- > > > Brandon Aaron- Hide quoted text - > > - Show quoted text -
[jQuery] Re: Dimensions 1.1 Released
Hi, I love this, as I did a very similar plugin. Well, the only thing I don't like is the error() in all methods. Maybe it should return 0 instead, and somewhere else the plugin could be configured to throw an exception or return 0. Michael On Aug 13, 6:34 am, "Brandon Aaron" <[EMAIL PROTECTED]> wrote: > I just released Dimensions 1.1. It includes an option to include margin for > the outerWidth and outerHeight methods. I've also fixed the issues with > Safari 3 and the offset method. The docs have also been udpated for 1.1. As > usual you can grab the latest from the Dimensions project page. Note that > this update requires jQuery 1.1.3. > > project page:http://jquery.com/plugins/project/dimensions/ > docs:http://brandonaaron.net/docs/dimensions/ > > -- > Brandon Aaron
[jQuery] Re: IE memory problem (still)
Any news about this topic? Michael On Jul 24, 1:37 pm, "Brandon Aaron" <[EMAIL PROTECTED]> wrote: > Thanks for the ticket Michael. Memory leaks are always a high priority. You > should see a fix for this show up in SVN soon. > > -- > Brandon Aaron > > On 7/24/07, Michael Schwarz [MVP] <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > I added some months ago a ticket for memory problems, and as I found > > it should be fixed already, but I'm still not sure if it is correctly > > fixed or if there is maybe a different way of doing the same. I have > > following JavaScript: > > > var h = []; > > for(var i=0; i<20; i++) { > > h.push("Button " + i + ""); > > } > > > $("#display/button").unbind("click", onClick); > > $("#display").html(h.join("")); > > $("#display/button").bind("click", onClick); > > > If I run this several times memory will grow in IE7 (maybe in IE6, > > too). When using the sIEve (http://home.wanadoo.nl/jsrosman/) I see > > "#inUse" and "usage" growing. > > > So, what I'm still doing wrong (with the latest jQuery bits)? > > > What I found is that "delete this.global[type][index];" in > > events.remove will set the object to undefined but will remain the > > arrays length, maybe that is a problem, too. > > > I know that it is not a problem for short running Web pages, but if > > you are creating a terminal application that is running 24hrs a day > > you should be aware of this. > > > Michael- Hide quoted text - > > - Show quoted text -
[jQuery] Re: $Ajax memory problem
And did anybody of you write a periodical updater that is using POST without having memory leak problems? Michael On Jul 25, 8:57 am, "Michael Schwarz [MVP]" <[EMAIL PROTECTED]> wrote: > Hi, > > I'd like to create a periodical Ajax request with jQuery. What i have > done is: > > $j.ajax({ > type: "POST", > url: "/ajaxpro/haschanged.ashx", > data: '{"req":' + AjaxPro.toJSON(r) + '}', > beforeSend: function(xhr) { > xhr.setRequestHeader("X-AjaxPro-Method", "HasChanged"); > }, > success: function(s) { > mt.refresh_callback({value:res}); > }, > error: function(request, settings) { > alert("Ajax error"); > mt.isUpdating = false; > setTimeout(mt.refresh_handle, 1000); > } > > }); > > mt.commonData is a simple JS object which has a callback and refresh > method. > > var mt = { > isUpdating: false, > refresh_callback: function(res) { > }, > refresh: function() { > this.isUpdating = true; > // here is the Ajax request from above > }, > initialize: function() { > this.refresh_handle = this.refresh.bind(this); > } > > } > > What I see is that memory is growing on every request. > > Maybe anybody can help me on writing a periodical Ajax updater?! > > Michael
[jQuery] Re: Announce: Masked Input Plugin 1.0
Ji Josh, great work!! What I'm missing is a more detailed mask i.e. for date inputs: time input [0..23]:[0..59] date input [1..31].[1..12].[1900..2007] (and check for 29th Feb) Do you want to add this in your roadmap? Michael On Jul 26, 2:21 am, Josh Bush <[EMAIL PROTECTED]> wrote: > I just wanted to announce that I've finally released v1.0 of my masked > input plugin. Please check it out at: > > http://digitalbush.com/projects/masked-input-plugin > > Thank You > Josh > digitalbush.com
[jQuery] $Ajax memory problem
Hi, I'd like to create a periodical Ajax request with jQuery. What i have done is: $j.ajax({ type: "POST", url: "/ajaxpro/haschanged.ashx", data: '{"req":' + AjaxPro.toJSON(r) + '}', beforeSend: function(xhr) { xhr.setRequestHeader("X-AjaxPro-Method", "HasChanged"); }, success: function(s) { mt.refresh_callback({value:res}); }, error: function(request, settings) { alert("Ajax error"); mt.isUpdating = false; setTimeout(mt.refresh_handle, 1000); } }); mt.commonData is a simple JS object which has a callback and refresh method. var mt = { isUpdating: false, refresh_callback: function(res) { }, refresh: function() { this.isUpdating = true; // here is the Ajax request from above }, initialize: function() { this.refresh_handle = this.refresh.bind(this); } } What I see is that memory is growing on every request. Maybe anybody can help me on writing a periodical Ajax updater?! Michael
[jQuery] IE memory problem (still)
Hi, I added some months ago a ticket for memory problems, and as I found it should be fixed already, but I'm still not sure if it is correctly fixed or if there is maybe a different way of doing the same. I have following JavaScript: var h = []; for(var i=0; i<20; i++) { h.push("Button " + i + ""); } $("#display/button").unbind("click", onClick); $("#display").html(h.join("")); $("#display/button").bind("click", onClick); If I run this several times memory will grow in IE7 (maybe in IE6, too). When using the sIEve (http://home.wanadoo.nl/jsrosman/) I see "#inUse" and "usage" growing. So, what I'm still doing wrong (with the latest jQuery bits)? What I found is that "delete this.global[type][index];" in events.remove will set the object to undefined but will remain the arrays length, maybe that is a problem, too. I know that it is not a problem for short running Web pages, but if you are creating a terminal application that is running 24hrs a day you should be aware of this. Michael
[jQuery] Re: Memory problem
Thanks for creating the ticket... Michael On 4/20/07, Brandon Aaron <[EMAIL PROTECTED]> wrote: Michael, I went ahead and created a ticket for this so that it doesn't get lost in the archives. http://dev.jquery.com/ticket/1136 -- Brandon Aaron On 4/20/07, Michael Schwarz <[EMAIL PROTECTED]> wrote: > > Hi, > > I added some lines to the remove function (line 1245): > > // original > if(!k) element["on" + type] = null; > > // changed to > if (!k) { > element["on" + type] = null; > > for ( var i=0; i if(this.global[type][i] == element) { > this.global[type].splice(i, 1); > break; > } > } > } > > I see that the for loop isn't very well, maybe there is another way to > remove the element if there is no handler. > > Michael > > > > On 4/20/07, Michael Schwarz <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I see the problem, now. The array jQuery.event.global is getting > > bigger and bigger. For a long running Web application (without any > > page refresh) it is a strange problem. If I have removed an event and > > then will delete the element (the DOM element) this should be removed > > from the jQuery.event.global array. If I press F5 it will clear nearly > > everything and memory usage is like before. > > > > Michael > > > > > > > > On 4/19/07, Michael Schwarz <[EMAIL PROTECTED]> wrote: > > > Sorry, I forgot to mention that I'm using Internet Explorer 6 on > > > Windows XP. With other web browser I don't see any problem. The > > > example above will grow with every re-render. > > > > > > Michael > > > > > > > > > > > > On 4/19/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > > > > Michael, > > > > > > > > The example works for me - what's the problem? > > > > > > > > rob. > > > > > > > > > > > > On 4/19/07, Michael Schwarz [MVP] < [EMAIL PROTECTED]> wrote: > > > > > > > > > > Hi, > > > > > > > > > > I have a very simple page which will be refreshed from time to time. I > > > > > build an example which will be called every 1000 msec to redner a html > > > > > table with a button inside. The button click event is set with the > > > > > bind method. What I'm doing wrong? > > > > > > > > > > Regards, > > > > > Michael > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > function clickhandler() { > > > > > alert("clicked"); > > > > > } > > > > > > > > > > function render() { > > > > > var d = new Date(); > > > > > var n = d.getTime(); > > > > > > > > > > $("button").unbind("click", clickhandler); > > > > > > > > > > var sb = []; > > > > > sb.push("<table>"); > > > > > for(var i=0; i<100; i++) { > > > > > sb.push("<tr><td>" + i + "</td><td>" + n + > > > > "</td><td><button>Click</ > > > > > button></td></tr>"); > > > > > } > > > > > sb.push("</table>"); > > > > > > > > > > $("#display").html(sb.join('')); > > > > > $("button").bind("click", clickhandler); > > > > > > > > > > setTimeout(render, 1000); > > > > > } > > > > > > > > > > $(window).ready(render); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Rob Desbois > > > > Eml: [EMAIL PROTECTED] > > > > Tel: 01452 760631 > > > > Mob: 07946 705987 > > > > "There's a whale there's a whale there's a whale fish" he cried, and the > > > > whale was in full view. > > > > ...Then ooh welcome. Ahhh. Ooh mug welcome. > > > > > > > > > --
[jQuery] Re: Memory problem
Hi, I added some lines to the remove function (line 1245): // original if(!k) element["on" + type] = null; // changed to if (!k) { element["on" + type] = null; for ( var i=0; i wrote: Hi, I see the problem, now. The array jQuery.event.global is getting bigger and bigger. For a long running Web application (without any page refresh) it is a strange problem. If I have removed an event and then will delete the element (the DOM element) this should be removed from the jQuery.event.global array. If I press F5 it will clear nearly everything and memory usage is like before. Michael On 4/19/07, Michael Schwarz <[EMAIL PROTECTED]> wrote: > Sorry, I forgot to mention that I'm using Internet Explorer 6 on > Windows XP. With other web browser I don't see any problem. The > example above will grow with every re-render. > > Michael > > > > On 4/19/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > > Michael, > > > > The example works for me - what's the problem? > > > > rob. > > > > > > On 4/19/07, Michael Schwarz [MVP] < [EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > > > > I have a very simple page which will be refreshed from time to time. I > > > build an example which will be called every 1000 msec to redner a html > > > table with a button inside. The button click event is set with the > > > bind method. What I'm doing wrong? > > > > > > Regards, > > > Michael > > > > > > > > > > > > > > > > > > > > > > > > > > > function clickhandler() { > > > alert("clicked"); > > > } > > > > > > function render() { > > > var d = new Date(); > > > var n = d.getTime(); > > > > > > $("button").unbind("click", clickhandler); > > > > > > var sb = []; > > > sb.push("<table>"); > > > for(var i=0; i<100; i++) { > > > sb.push("<tr><td>" + i + "</td><td>" + n + > > "</td><td><button>Click</ > > > button></td></tr>"); > > > } > > > sb.push("</table>"); > > > > > > $("#display").html(sb.join('')); > > > $("button").bind("click", clickhandler); > > > > > > setTimeout(render, 1000); > > > } > > > > > > $(window).ready(render); > > > > > > > > > > > > > > > > > > > > -- > > Rob Desbois > > Eml: [EMAIL PROTECTED] > > Tel: 01452 760631 > > Mob: 07946 705987 > > "There's a whale there's a whale there's a whale fish" he cried, and the > > whale was in full view. > > ...Then ooh welcome. Ahhh. Ooh mug welcome. > > > -- > Best regards | Schöne Grüße > Michael > > Microsoft MVP - Most Valuable Professional > Microsoft MCAD - Certified Application Developer > > http://weblogs.asp.net/mschwarz/ > http://www.ajaxpro.info/ > > Silverlight: http://groups.google.com/group/wpf-everywhere/ > Ajax.NET Professional: http://groups.google.com/group/ajaxpro/ > > Skype: callto:schwarz-interactive > MSN IM: [EMAIL PROTECTED] > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz/ http://www.ajaxpro.info/ Silverlight: http://groups.google.com/group/wpf-everywhere/ Ajax.NET Professional: http://groups.google.com/group/ajaxpro/ Skype: callto:schwarz-interactive MSN IM: [EMAIL PROTECTED] -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz/ http://www.ajaxpro.info/ Silverlight: http://groups.google.com/group/wpf-everywhere/ Ajax.NET Professional: http://groups.google.com/group/ajaxpro/ Skype: callto:schwarz-interactive MSN IM: [EMAIL PROTECTED]
[jQuery] Re: Memory problem
Hi, I see the problem, now. The array jQuery.event.global is getting bigger and bigger. For a long running Web application (without any page refresh) it is a strange problem. If I have removed an event and then will delete the element (the DOM element) this should be removed from the jQuery.event.global array. If I press F5 it will clear nearly everything and memory usage is like before. Michael On 4/19/07, Michael Schwarz <[EMAIL PROTECTED]> wrote: Sorry, I forgot to mention that I'm using Internet Explorer 6 on Windows XP. With other web browser I don't see any problem. The example above will grow with every re-render. Michael On 4/19/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > Michael, > > The example works for me - what's the problem? > > rob. > > > On 4/19/07, Michael Schwarz [MVP] < [EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have a very simple page which will be refreshed from time to time. I > > build an example which will be called every 1000 msec to redner a html > > table with a button inside. The button click event is set with the > > bind method. What I'm doing wrong? > > > > Regards, > > Michael > > > > > > > > > > > > > > > > > > function clickhandler() { > > alert("clicked"); > > } > > > > function render() { > > var d = new Date(); > > var n = d.getTime(); > > > > $("button").unbind("click", clickhandler); > > > > var sb = []; > > sb.push("<table>"); > > for(var i=0; i<100; i++) { > > sb.push("<tr><td>" + i + "</td><td>" + n + > "</td><td><button>Click</ > > button></td></tr>"); > > } > > sb.push("</table>"); > > > > $("#display").html(sb.join('')); > > $("button").bind("click", clickhandler); > > > > setTimeout(render, 1000); > > } > > > > $(window).ready(render); > > > > > > > > > > > > -- > Rob Desbois > Eml: [EMAIL PROTECTED] > Tel: 01452 760631 > Mob: 07946 705987 > "There's a whale there's a whale there's a whale fish" he cried, and the > whale was in full view. > ...Then ooh welcome. Ahhh. Ooh mug welcome. -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz/ http://www.ajaxpro.info/ Silverlight: http://groups.google.com/group/wpf-everywhere/ Ajax.NET Professional: http://groups.google.com/group/ajaxpro/ Skype: callto:schwarz-interactive MSN IM: [EMAIL PROTECTED] -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz/ http://www.ajaxpro.info/ Silverlight: http://groups.google.com/group/wpf-everywhere/ Ajax.NET Professional: http://groups.google.com/group/ajaxpro/ Skype: callto:schwarz-interactive MSN IM: [EMAIL PROTECTED]
[jQuery] Re: Memory problem
Sorry, I forgot to mention that I'm using Internet Explorer 6 on Windows XP. With other web browser I don't see any problem. The example above will grow with every re-render. Michael On 4/19/07, Rob Desbois <[EMAIL PROTECTED]> wrote: Michael, The example works for me - what's the problem? rob. On 4/19/07, Michael Schwarz [MVP] < [EMAIL PROTECTED]> wrote: > > Hi, > > I have a very simple page which will be refreshed from time to time. I > build an example which will be called every 1000 msec to redner a html > table with a button inside. The button click event is set with the > bind method. What I'm doing wrong? > > Regards, > Michael > > > > > > > > > function clickhandler() { > alert("clicked"); > } > > function render() { > var d = new Date(); > var n = d.getTime(); > > $("button").unbind("click", clickhandler); > > var sb = []; > sb.push("<table>"); > for(var i=0; i<100; i++) { > sb.push("<tr><td>" + i + "</td><td>" + n + "</td><td><button>Click</ > button></td></tr>"); > } > sb.push("</table>"); > > $("#display").html(sb.join('')); > $("button").bind("click", clickhandler); > > setTimeout(render, 1000); > } > > $(window).ready(render); > > > > -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome. -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz/ http://www.ajaxpro.info/ Silverlight: http://groups.google.com/group/wpf-everywhere/ Ajax.NET Professional: http://groups.google.com/group/ajaxpro/ Skype: callto:schwarz-interactive MSN IM: [EMAIL PROTECTED]
[jQuery] Memory problem
Hi, I have a very simple page which will be refreshed from time to time. I build an example which will be called every 1000 msec to redner a html table with a button inside. The button click event is set with the bind method. What I'm doing wrong? Regards, Michael function clickhandler() { alert("clicked"); } function render() { var d = new Date(); var n = d.getTime(); $("button").unbind("click", clickhandler); var sb = []; sb.push(""); for(var i=0; i<100; i++) { sb.push("
"); $("#display").html(sb.join('')); $("button").bind("click", clickhandler); setTimeout(render, 1000); } $(window).ready(render);"); } sb.push(" " + i + " " + n + "