[jQuery] Re: validation plugin: validate checkboxes that don't have same name?
You can add custom rule with your custom validator. Read documentation here: http://docs.jquery.com/Plugins/Validation Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 7:22 AM, claudes claudina.sar...@gmail.com wrote: using validation plugin, is there a way to validate checkbox group that has different name attributes? i would like to make sure that at least one checkbox has been selected but i'm not sure how to do it because they all have different names. thanks -- View this message in context: http://www.nabble.com/validation-plugin%3A-validate-checkboxes-that-don%27t-have-same-name--tp21865439s27240p21865439.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: load() not loading my dynamic page
.html is static and the other one is generated dynamically... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Feb 5, 2009 at 10:21 PM, photogeek levin@gmail.com wrote: Beginner question but what is the difference between that .html page and the page that you are trying to load? Thanks Photogeek On Feb 5, 8:56 am, jQuery Lover ilovejqu...@gmail.com wrote: Maybe it's related to wrong content type being sent by your server !!! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Feb 5, 2009 at 7:42 PM, eagleon antonypei...@gmail.com wrote: I've been experiencing the same thing! I hop we can figure out a workaround... This also applies to the $(document).ready() event... does not work on dynamic pages. On Feb 5, 3:21 am, Code Daemon ryan.det...@gmail.com wrote: But $('#mydiv').load('my/page.html');works just fine. On Feb 5, 12:16 am, Dean Barker framejoc...@googlemail.com wrote: look at onLoad() http://www.frameJockey.co.uk www.frameJockey.co.uk i...@framejockey.co.uk framejoc...@gmail.com framejoc...@yahoo.com [image: Google Talk:] framejoc...@gmail.com [image: Y! messenger:] frameJockey 2009/2/5 Code Daemon ryan.det...@gmail.com When I use load(), it works fine for static pages but doesn't seem to work for my dynamic page. This is what I'm doing: $('#mydiv').load('my/page'); FireBug shows that the response is coming back just as it should. Any thoughts?
[jQuery] Re: dynamically building the for attribute
Ups, I missed the id's of checkboxes... My code was written for checkboxes and label's both without id's... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Thu, Feb 5, 2009 at 7:52 PM, Mauricio (Maujor) Samy Silva css.mau...@gmail.com wrote: $('#my-form label').each(function() { var checkboxId = $(this).prev(':checkbox').attr('id') $(this).attr('for', checkboxId) Maurício -Mensagem Original- De: paulinstl paulsha...@gmail.com Para: jQuery (English) jquery-en@googlegroups.com Enviada em: quinta-feira, 5 de fevereiro de 2009 12:25 Assunto: [jQuery] dynamically building the for attribute I have a series of labels and checkboxes. The checkboxes' IDs are generated on the fly, so I have no way of knowing the id at the server (without a lot of heavy lifting). I'd like to do this in jquery... here's what I have so far HTML input id=Checkbox1 type=checkbox value=x /labelsomething/ labelbr / input id=Checkbox2 type=checkbox value=x /labelsomething/ labelbr / input id=Checkbox3 type=checkbox value=x /labelsomething/ labelbr / input id=Checkbox4 type=checkbox value=x /labelsomething/ labelbr / jquery $(label).attr(for, $ (this).somethingToGoHereToSetTheIdOfThePrevElement.text () ); I'm missing the way to traverse this
[jQuery] Re: Select element based on a value of its child element
Most likely... you should submit a ticket: http://dev.jquery.com/ Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Feb 4, 2009 at 9:24 PM, Stephan Veigl stephan.ve...@gmail.com wrote: Good point. I've just tested input[value=''] and got an error in jQuery.js. Just tested it with other HTML attributes and got the same results. Empty attributes are not selected with a element[attr] and doing a element[attr=''] results in an error. Is this a bug? by(e) Stephan 2009/2/4 Adrian Lynch adely...@googlemail.com: Nice one! Should have spotted :has()... I've asked this in another thread but I'll slip it in here too, does the selector... input[value=''] ... work for any of you? Adrian On Feb 4, 12:11 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, just a little remark: add a child selector '' before the 'input' or you will select surrounding divs as well. $(div:has(input[value='2'])) by(e) Stephan 2009/2/4 Mauricio (Maujor) Samy Silva css.mau...@gmail.com: $('div:has(input[value=2])') Maurício -Mensagem Original- De: Adrian Lynch adely...@googlemail.com Para: jQuery (English) jquery-en@googlegroups.com Enviada em: quarta-feira, 4 de fevereiro de 2009 09:22 Assunto: [jQuery] Select element based on a value of its child element Hello all. I have the following... div input type=text value=1 / /div div input type=text value=2 / /div div input type=text value=3 / /div ... and I want to select the second div because its child input has a value of 2. I know I could select the input then come back to the div with parents (div). Just wondering if there's a way to do it in the selector string. More out of curiosity than need ;) Thanks. Adrian
[jQuery] Re: Accessing object tag by id
Sorry, but anyone has a clue ? Am 05.02.2009 um 11:43 schrieb Olaf Gleba: Couldn't find any appropriate answer: How do i point to a object tag by ID ? Example: object id=flashsitemap data=xxxn.swf param name=wmode value=transparent/ /object $('#flashsitemap').event(function() { ... }); This assumed syntax does not work obviously gruss Olaf -- Olaf Gleba : creatics media.systems Tel. +49 (0)221 170 67 224 : Fax. +49 (0)221 170 67 225 o...@creatics.de : http://www.creatics.de PGP-Key http://www.creatics.de/keys/ Welcompose CMS - Einfach und Effizient http://www.welcompose.de
[jQuery] Re: Need to make a edit layout system using php and jquery...?
Yeap. I suggest you add a save button so you make an ajax call only once (when user decides to save his/her settings) and don't kill your server ... :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 5:01 AM, shyhockey...@gmail.com shyhockey...@gmail.com wrote: Thanks... So I can save these values with php??? Cause I plan to allow people to make their own profile page layout and need to save these values. On Feb 2, 7:11 am, jQuery Lover ilovejqu...@gmail.com wrote: To find positions and everything:http://docs.jquery.com/CSS Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Feb 2, 2009 at 3:19 AM, shyhockey...@gmail.com shyhockey...@gmail.com wrote: Hi, I am right now trying to make a edit layout system. basicly I want to know how I can use jquery to grab the height width and position elements are at. Cause I plan to make in the edit mode to allow users to move like images and tables and texts around on the layout and even change background images and add more artistic images for their profiles. I will add also a music player. So I need to know how I can grab all positions height and width of each element on my layout and then store that data. I am planning to make databases for users where I will store their edited stuff. So I need the x and y position of where the elements are at and also the height and width. Some told me I should just grab what css element of height and width and top and left of the elements using javascript. What would you suggest on how I should do it? Can I do it using jquery or no??? Thanks for your time.
[jQuery] Re: Accessing object tag by id
You might wanna use this: http://jquery.thewikies.com/swfobject/ Or look into the code. May find clues there... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 1:11 PM, Olaf Gleba l...@creatics.de wrote: Sorry, but anyone has a clue ? Am 05.02.2009 um 11:43 schrieb Olaf Gleba: Couldn't find any appropriate answer: How do i point to a object tag by ID ? Example: object id=flashsitemap data=xxxn.swf param name=wmode value=transparent/ /object $('#flashsitemap').event(function() { ... }); This assumed syntax does not work obviously gruss Olaf -- Olaf Gleba : creatics media.systems Tel. +49 (0)221 170 67 224 : Fax. +49 (0)221 170 67 225 o...@creatics.de : http://www.creatics.de PGP-Key http://www.creatics.de/keys/ Welcompose CMS - Einfach und Effizient http://www.welcompose.de
[jQuery] Re: ui draggable (option drag doesn't work)
I don't see a drag option in draggables documentation... or am i missing anything here ??? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 10:19 AM, Richard D. Worth rdwo...@gmail.com wrote: Which version of jQuery UI are you using? jQuery UI 1.5.3 is only compatible with jQuery 1.2.6 jQuery UI 1.6rc6 is only compatible with jQuery 1.3+ When these don't match, the most common error is callbacks not firing. If that's not your issue, please post a follow-up on the jQuery UI list http://groups.google.com/group/jquery-ui Thanks. - Richard On Thu, Feb 5, 2009 at 8:26 PM, knight knight@gmail.com wrote: Hello, The question is why drag-option doesn't work ( options.drag = function (event,info) { alert('drag'); } )? Thanks in advance. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleScroll element/title style type=text/css .scrollable { overflow:hidden; height:200px; width:350px; margin:100px auto; } .bloc { margin:5px auto; font-size:12px; } .scr_cnt_handle { float:left; height:100%; border:1px solid #000; } .scr_body { float:left; overflow:hidden; height:200px; width:300px; } .ctr_handle { width:20px; height:40px; background-color:#006699; } /style script src=jquery-1.3.1.min.js type=text/javascript language=javascript/script script src=ui.core.js type=text/javascript language=javascript/script script src=ui.draggable.js type=text/javascript language=javascript/script script type=text/javascript language=javascript $(function(){ var options = {}; options.containment = 'parent'; options.axis = 'y'; options.drag = function(event,info) { alert('drag'); } $('.ctr_handle').draggable(options); }); /script /head body div class=scrollable div class=scr_body div class=bloc img src=FooterRevision.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=InteriorPage1.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=InteriorPage2.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=FooterRevision.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div /div div class=scr_cnt_handle div class=ctr_handle/div /div div style=clear:both;/div /div /body /html
[jQuery] Re: Superfish Help
Create a dummy user for us so we could see it in action... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 9:16 AM, Aaron Gundel aaron.gun...@gmail.com wrote: if you're logged in? On Thu, Feb 5, 2009 at 5:32 PM, Josh joshua.d.mich...@gmail.com wrote: Hello, I have installed the Superfish module and can get it to display on my site, but I can't seem to get the drop-down to look good. In fact it looks pretty awful. Any help would be great. You can see it at eslbasics.com
[jQuery] Re: Optimize large DOM inserts
That is true I always suggest using built in for() loop with huge data sets... and people keep ignoring me :))) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 8:25 AM, Michael Geary m...@mg.to wrote: ...there is not much room for improvement left. You just know that when you say that, someone will come along with a 20x-40x improvement. ;-) http://mg.to/test/loop1.html http://mg.to/test/loop2.html Try them in IE, where the performance is the worst and matters the most. On my test machine, the first one runs about 6.3 seconds and the second one about 0.13 seconds. -Mike From: Ricardo Tomasi Concatenating into a string is already much faster than appending in each loop, there is not much room for improvement left. What you can do improve user experience though is split that into a recursive function over a setTimeout, so that the browser doesn't freeze and you can display a nice loading animation. On Feb 5, 5:03 pm, James james.gp@gmail.com wrote: I need tips on optimizing a large DOM insert to lessen the freeze on the browser. Scenario: I receive a large amount of JSON 'data' through AJAX from a database (sorted the way I want viewed), and loop through them to add to a JS string, and insert that chunk of string into a tbody of a table. Then, I run a plug-in that formats the table (with pagination, etc.). Simplified sample code: var html = ''; $.each(data, function(i, row) { html += 'trtddata from json/td/tr';}); $(tbody).append(html); $(table).formatTable(); formatTable() requires that the table has to be completed before it can be executed. Is there any way I can optimize this better? I think I've read somewhere that making a string too long is not good, but I've also read that updating the DOM on each iteration is even worst. Any advice would be appreciated!
[jQuery] Re: Superfish
Yeap, there are multiple ul in the sub menu and the rest of trick is done with CSS. ul#topnav .menu ul.sub_nav { margin:0 10px 0 0; padding:0; width:130px; } Giving each sub navigation ul a fixed width and floating it to the left. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 7:42 AM, uztha4c uzth...@gmail.com wrote: just take a look at the source code for the site...basically it looks like this: li class=nav_pressa href=/briefing_room/ class=nav_itemspanThe Briefing Room/span/a div class=menu ul class=sub_nav lia href=/blog/The Blog/a/li lia href=/weekly_address/Your Weekly Address/a/ li lia href=/slideshows/Slideshows/a/li lia href=/briefing_room/PressBriefings/Press Briefings/a/li lia href=/briefing_room/OfficialStatements/Official Statements/a/li /ul ul class=sub_nav lia href=/briefing_room/PressReleases/Press Releases/a/li lia href=/briefing_room/ PresidentialActions/Presidential Actions/a/li lia href=/briefing_room/ nominations_and_appointments/Nominations amp; Appointments/a/li /ul div class=clear nbsp;/div /div /li then look at the style.css stylesheet. then check out the js in the jquery-plugins.js file related to superfish. On Feb 5, 5:41 pm, Mario designsdr...@gmail.com wrote: thanks for the response. Any idea where I can get some code that will allow me to create such navigation system? I'd appreciate the information. On Feb 4, 7:37 pm, Joel Birch joeldbi...@gmail.com wrote: Hello, I think that it's simply a matter of including multiple ul elements inside the parent li, then floating them alongside each other (obviously they will need a width to be set). I've seen this work and have experimented with it myself in the past to be sure that it does work, but I don't have any examples to show you unfortunately. Joel.
[jQuery] Re: ui draggable (option drag doesn't work)
Richard you are right. I've missed this thing placing new version of jQuery. Thanks.
[jQuery] Re: Plugin Question
Found it: When you specify rules in the validate-call, the name is referenced, not the id. Replacing select with field_3 (or renaming the latter) should fix it. Jörn On Fri, Feb 6, 2009 at 12:20 AM, Chris cpot...@siolon.com wrote: On Feb 5, 6:17 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: I'm sorry. I confused the (hidden) select and the text input. Please revert that last change and lets try again. Jörn It's reverted.
[jQuery] Re: Checkbox selection
Something like this might help: $('table tr').click(function(e){ if( $(e.target).is('td') ){ $('input:checkbox', this).attr('checked', 'checked'); } }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 7:40 AM, Sam Hastings sam.hasti...@gmail.com wrote: Hi everyone, I've got an HTML table like this: table tr tdFoo/td tdBar/td tdBaz/td tdinput type=checkbox //td /tr /table What I'd like to do is toggle the checkbox's checked state when any of the cells in its row are clicked. I've tried this a thousand different ways and can't get it working and was wondering if someone here would be kind enough to help. Many thanks :-) Sam Hastings
[jQuery] Re: Select element based on a value of its child element
Hi, according to another thread in this group (http://groups.google.at/group/jquery-en/browse_thread/thread/2115a6c8c2069cd8) there is already a ticket for this bug: http://dev.jquery.com/ticket/3990 and it's already fixed in the trunk by(e) Stephan 2009/2/6 jQuery Lover ilovejqu...@gmail.com: Most likely... you should submit a ticket: http://dev.jquery.com/ Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Feb 4, 2009 at 9:24 PM, Stephan Veigl stephan.ve...@gmail.com wrote: Good point. I've just tested input[value=''] and got an error in jQuery.js. Just tested it with other HTML attributes and got the same results. Empty attributes are not selected with a element[attr] and doing a element[attr=''] results in an error. Is this a bug? by(e) Stephan 2009/2/4 Adrian Lynch adely...@googlemail.com: Nice one! Should have spotted :has()... I've asked this in another thread but I'll slip it in here too, does the selector... input[value=''] ... work for any of you? Adrian On Feb 4, 12:11 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, just a little remark: add a child selector '' before the 'input' or you will select surrounding divs as well. $(div:has(input[value='2'])) by(e) Stephan 2009/2/4 Mauricio (Maujor) Samy Silva css.mau...@gmail.com: $('div:has(input[value=2])') Maurício -Mensagem Original- De: Adrian Lynch adely...@googlemail.com Para: jQuery (English) jquery-en@googlegroups.com Enviada em: quarta-feira, 4 de fevereiro de 2009 09:22 Assunto: [jQuery] Select element based on a value of its child element Hello all. I have the following... div input type=text value=1 / /div div input type=text value=2 / /div div input type=text value=3 / /div ... and I want to select the second div because its child input has a value of 2. I know I could select the input then come back to the div with parents (div). Just wondering if there's a way to do it in the selector string. More out of curiosity than need ;) Thanks. Adrian
[jQuery] Re: jQuery 1.3.x XPath
Mmmm, haven't tried that. Thanks! On Jan 29, 8:33 am, Klaus Hartl klaus.ha...@googlemail.com wrote: On 29 Jan., 06:05, Neil Craig neil.big.cr...@gmail.com wrote: I have tried it, but it yields no results when searching for elements. What I loved about the xpath functionality was that I could have used the same functions on XML documents, not only on XHTML. Huh? CSS selectors will also work with XML. --Klaus
[jQuery] Re: Recommendation Required - Custom Classes Library
Note, that this applies to Mootools 1.11. I haven't touched version 1.2+, I'm sure they differ a lot. On Jan 23, 2:30 pm, Balazs Endresz balazs.endr...@gmail.com wrote: Then what if you just use Class.Extras and all its dependencies as it is? Now that sounds too easy :) On Jan 23, 9:21 am, Neil Craig neil.big.cr...@gmail.com wrote: I am not sure how Mootools 1.2+ is constructed but version 1.11 can easily be broken into pieces that excludes the parts that extend the DOM/HTML elements. The files that one should use is: Core, Class, Class.Extras, String, Number, Function, Array On Jan 21, 11:58 am, Balazs Endresz balazs.endr...@gmail.com wrote: I only heard about this one, looks a bit different from Mootools but much smaller:http://www.danwebb.net/2008/1/31/low-pro-for-jquery Though I wonder if it's possible to port the whole Mootools implementation to jQuery? You can maybe keep some parts of Core, Native and Class, and hack it to work with jQuery ... now that sounds like a whole new framework :) I don't know Mootools that much at all but maybe it's not as hard as it sounds... On Jan 21, 8:18 am, Neil Craig neil.big.cr...@gmail.com wrote: Bump :) On Jan 20, 10:36 am, Neil Craig neil.big.cr...@gmail.com wrote: I was wondering, which Custom Classes Library is best to use along with jQuery. Up to now, I've been using Mootools to create custom classes that can be easily extended through its inheritance model. It also has custom events that I have used extensively. Which library do you recommend that has the same functionality as described above that can co-exist with jQuery peacefully? This could make for an interesting discussion
[jQuery] Re: Accessing object tag by id
Thanks. I already use swfobject. Still a good idea to look into the lib to (maybe) find something there... greets Olaf Am 06.02.2009 um 09:18 schrieb jQuery Lover: You might wanna use this: http://jquery.thewikies.com/swfobject/ Or look into the code. May find clues there... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 1:11 PM, Olaf Gleba l...@creatics.de wrote: Sorry, but anyone has a clue ? Am 05.02.2009 um 11:43 schrieb Olaf Gleba: Couldn't find any appropriate answer: How do i point to a object tag by ID ? Example: object id=flashsitemap data=xxxn.swf param name=wmode value=transparent/ /object $('#flashsitemap').event(function() { ... }); This assumed syntax does not work obviously gruss Olaf -- Olaf Gleba : creatics media.systems Tel. +49 (0)221 170 67 224 : Fax. +49 (0)221 170 67 225 o...@creatics.de : http://www.creatics.de PGP-Key http://www.creatics.de/keys/ Welcompose CMS - Einfach und Effizient http://www.welcompose.de gruss Olaf -- Olaf Gleba : creatics media.systems Tel. +49 (0)221 170 67 224 : Fax. +49 (0)221 170 67 225 o...@creatics.de : http://www.creatics.de PGP-Key http://www.creatics.de/keys/ Welcompose CMS - Einfach und Effizient http://www.welcompose.de
[jQuery] Re: Optimize large DOM inserts
Hi, thanks fort his little optimization tutorial :-) One question, is there a difference between a loop with a running variable (e.g. for (i=0; irows.length; i++) ) and a for-in loop (e.g. for (var i in rows) )? I've done some tests and couldn't find any performance difference beside the normal variation between two different measurements. Which variant should be preferred? by(e) Stephan 2009/2/6 jQuery Lover ilovejqu...@gmail.com: That is true I always suggest using built in for() loop with huge data sets... and people keep ignoring me :))) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 8:25 AM, Michael Geary m...@mg.to wrote: ...there is not much room for improvement left. You just know that when you say that, someone will come along with a 20x-40x improvement. ;-) http://mg.to/test/loop1.html http://mg.to/test/loop2.html Try them in IE, where the performance is the worst and matters the most. On my test machine, the first one runs about 6.3 seconds and the second one about 0.13 seconds. -Mike From: Ricardo Tomasi Concatenating into a string is already much faster than appending in each loop, there is not much room for improvement left. What you can do improve user experience though is split that into a recursive function over a setTimeout, so that the browser doesn't freeze and you can display a nice loading animation. On Feb 5, 5:03 pm, James james.gp@gmail.com wrote: I need tips on optimizing a large DOM insert to lessen the freeze on the browser. Scenario: I receive a large amount of JSON 'data' through AJAX from a database (sorted the way I want viewed), and loop through them to add to a JS string, and insert that chunk of string into a tbody of a table. Then, I run a plug-in that formats the table (with pagination, etc.). Simplified sample code: var html = ''; $.each(data, function(i, row) { html += 'trtddata from json/td/tr';}); $(tbody).append(html); $(table).formatTable(); formatTable() requires that the table has to be completed before it can be executed. Is there any way I can optimize this better? I think I've read somewhere that making a string too long is not good, but I've also read that updating the DOM on each iteration is even worst. Any advice would be appreciated!
[jQuery] Re: Optimize large DOM inserts
.each isn't the best choice in this case, a good old-fashioned for loop will be significantly faster. Also, use an array of strings instead of a single one and string concatenation. Using array.push () is faster than using the += operator on a string. Once the loop finishes use join () to get the array's contents as a single string. var myArray = []; for (var i=0; i data.length; i++) { myArray.push ('trtddata from json/td/tr'); } $('tbody').append (myArray.join ('')); On Feb 5, 7:03 pm, James james.gp@gmail.com wrote: I need tips on optimizing a large DOM insert to lessen the freeze on the browser. Scenario: I receive a large amount of JSON 'data' through AJAX from a database (sorted the way I want viewed), and loop through them to add to a JS string, and insert that chunk of string into a tbody of a table. Then, I run a plug-in that formats the table (with pagination, etc.). Simplified sample code: var html = ''; $.each(data, function(i, row) { html += 'trtddata from json/td/tr';}); $(tbody).append(html); $(table).formatTable(); formatTable() requires that the table has to be completed before it can be executed. Is there any way I can optimize this better? I think I've read somewhere that making a string too long is not good, but I've also read that updating the DOM on each iteration is even worst. Any advice would be appreciated!
[jQuery] What is difference between ADO and RDO
Explain ADO and RDO
[jQuery] Re: Optimize large DOM inserts
And what about? for (var i = 0, j = data.length, arr = new Array(j); i j; i++) arr[i] = 'trtddata from json/td/tr'; $('tbody').append (myArray.join ('')); 2009/2/6 Gordon grj.mc...@googlemail.com .each isn't the best choice in this case, a good old-fashioned for loop will be significantly faster. Also, use an array of strings instead of a single one and string concatenation. Using array.push () is faster than using the += operator on a string. Once the loop finishes use join () to get the array's contents as a single string. var myArray = []; for (var i=0; i data.length; i++) { myArray.push ('trtddata from json/td/tr'); } $('tbody').append (myArray.join ('')); On Feb 5, 7:03 pm, James james.gp@gmail.com wrote: I need tips on optimizing a large DOM insert to lessen the freeze on the browser. Scenario: I receive a large amount of JSON 'data' through AJAX from a database (sorted the way I want viewed), and loop through them to add to a JS string, and insert that chunk of string into a tbody of a table. Then, I run a plug-in that formats the table (with pagination, etc.). Simplified sample code: var html = ''; $.each(data, function(i, row) { html += 'trtddata from json/td/tr';}); $(tbody).append(html); $(table).formatTable(); formatTable() requires that the table has to be completed before it can be executed. Is there any way I can optimize this better? I think I've read somewhere that making a string too long is not good, but I've also read that updating the DOM on each iteration is even worst. Any advice would be appreciated!
[jQuery] Re: rules section problem
Hello, removing rules from validate() and adding the line below outside of validate function fixed the issue: var validator = $(#myForm).validate(); validator.settings.rules = { rules... }; Mesut TUNGA On 31 Ocak, 13:27, TUNGA mesut.tu...@gmail.com wrote: P.S. :http://nrzv.com/valid/?s=2 loads $(#myApplDiv).load(2.php); into the index.php On 31 Ocak, 13:22, TUNGA mesut.tu...@gmail.com wrote: Hi Jörn, Thanks for your reply. Here is the sample: http://nrzv.com/valid/ step 1 works well. on Step 2 there is a rule section like: rules: { secondSentDocumentsTo: { required: {depends: #secondPermanentAddress:filled } } } When you submit Step 1 and come on Step 2, even other validation(s) works, secondSentDocumentsTodependssection does not work. its working if you access the page via:http://nrzv.com/valid/?s=2 Both of access type uses load() function to load pages You can see the source via: http://nrzv.com/valid/index.phphttp://nrzv.com/valid/1.phphttp://nrzv... and the content of process.php is : ?=print $(\#myApplDiv\).load(\2.php\); ;? Thanks Mesut TUNGA On 28 Ocak, 20:56, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Can't spot any issues in that snippets. Could you post a testpage? Jörn On Wed, Jan 28, 2009 at 6:22 PM, TUNGA mesut.tu...@gmail.com wrote: Hello, I use validation code someting below. It works if I load that page directly. But loading it from another page using $(#myApplDiv).load ('that_page.php') therulessections does not work. But submitHandler section works well. script $().ready(function() { // some codes here var validator = $(#myForm).bind(invalid-form.validate, function () { $(#summary).html(Error); }).validate({ submitHandler: function() { // some codes here }, rules: { fieldName { required: {depends: #anotherFieldName:checked } } } }); }); /script Any suggestions? Thanks Mesut TUNGA
[jQuery] Re: General Question RE: Using jQuery with Wordpress
Many thanks for your response. Here is the page I have tried to attempt making the jQuery Cycle plugin work correctly: a href=http:// www.culturesinbetween.net/NEWWEBSITE/archives/299website/a 1. The first thing I did was add the scripts in my Wordpress theme's header.php: ?php wp_enqueue_script('jquery'); ? script type='text/javascript' src='http://www.shapemould.com/ culturesinbetween/NEWWEBSITE/wp-content/themes/sirup/ jquery.cycle.all.js'/script script type='text/javascript' jQuery(document).ready(function(){ jQuery('#frame1').cycle({ fx:'fade', speed:'2000', timeout: 0, next:'#next2', prev:'#prev2'}); }); /script 2. Within the Wordpress post page (Add New Post), I added the following (selecting HTML of course): div id=imgframe div id=frame1 class=pics img src=http://www.culturesinbetween.net/NEWWEBSITE/wp-content/ uploads/arnsdorfss09_f.jpg / img src=http:// www.culturesinbetween.net/NEWWEBSITE/wp-content/uploads/arnsdorfss09_f.jpg / /div a id='prev2' href='#'Prev/a | a id='next2' href='#'Next/a /div I did not define any CSS for #frame1. However I defined .pics with: .pics { width: 200px; height: 200px; overflow: hidden; } The results is that the page seems to display the correct CSS styling and loads jQuery but I am suspecting that it does not load the jQuery plugin. Can I ask if there is a solution to make the the image cycle work? On Feb 6, 6:45 pm, jQuery Lover ilovejqu...@gmail.com wrote: jQuery works just fine with wordpress. There is nothing in wordpress that may conflict with jquery. Moreover, wordpress admin panel uses jquery. Can you post a link to your page, so we could look into it and try to find out what's causing the problem... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 11:48 AM, MH1988 m.lawrencehu...@gmail.com wrote: I just wanted to ask in general if using jQuery inconjunction with Wordpress does actually work? I'm pretty sure if jQuery (attached with a jQuery plugin) would work if it was to be included on the frontpage (index.php) but maybe not for individual Wordpress posts? It's has been quite a mountain to see if jQuery would work at all as I was trying to use the Cycle plugin for a simple prev/next image slideshow but to no avail. changing the script to jQuery () didn't work either. I've decided to use Lightbox which uses the Prototype framework and that does work but prefer images within ul's and li's with a div overflow: hidden than Lightbox.
[jQuery] Re: General Question RE: Using jQuery with Wordpress
I honestly cannot believe but I've made it work. This has been troubling so much and it's finally worked. What I don't understand is why it did not work in the first place. I also think one important reason I just discovered that you had to load all your CSS files before the jQuery script/s. Which may have been the reason why it was not loading the plugin. Now, I've just link the jQuery framework from the jQuery website and it's working! On Feb 6, 9:39 pm, MH1988 m.lawrencehu...@gmail.com wrote: Many thanks for your response. Here is the page I have tried to attempt making the jQuery Cycle plugin work correctly: a href=http://www.culturesinbetween.net/NEWWEBSITE/archives/299;website/a 1. The first thing I did was add the scripts in my Wordpress theme's header.php: ?php wp_enqueue_script('jquery'); ? script type='text/javascript' src='http://www.shapemould.com/ culturesinbetween/NEWWEBSITE/wp-content/themes/sirup/ jquery.cycle.all.js'/script script type='text/javascript' jQuery(document).ready(function(){ jQuery('#frame1').cycle({ fx:'fade', speed:'2000', timeout: 0, next:'#next2', prev:'#prev2'}); }); /script 2. Within the Wordpress post page (Add New Post), I added the following (selecting HTML of course): div id=imgframe div id=frame1 class=pics img src=http://www.culturesinbetween.net/NEWWEBSITE/wp-content/ uploads/arnsdorfss09_f.jpg / img src=http://www.culturesinbetween.net/NEWWEBSITE/wp-content/uploads/arnsdorfss09_...; / /div a id='prev2' href='#'Prev/a | a id='next2' href='#'Next/a /div I did not define any CSS for #frame1. However I defined .pics with: .pics { width: 200px; height: 200px; overflow: hidden; } The results is that the page seems to display the correct CSS styling and loads jQuery but I am suspecting that it does not load the jQuery plugin. Can I ask if there is a solution to make the the image cycle work? On Feb 6, 6:45 pm, jQuery Lover ilovejqu...@gmail.com wrote: jQuery works just fine with wordpress. There is nothing in wordpress that may conflict with jquery. Moreover, wordpress admin panel uses jquery. Can you post a link to your page, so we could look into it and try to find out what's causing the problem... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 11:48 AM, MH1988 m.lawrencehu...@gmail.com wrote: I just wanted to ask in general if using jQuery inconjunction with Wordpress does actually work? I'm pretty sure if jQuery (attached with a jQuery plugin) would work if it was to be included on the frontpage (index.php) but maybe not for individual Wordpress posts? It's has been quite a mountain to see if jQuery would work at all as I was trying to use the Cycle plugin for a simple prev/next image slideshow but to no avail. changing the script to jQuery () didn't work either. I've decided to use Lightbox which uses the Prototype framework and that does work but prefer images within ul's and li's with a div overflow: hidden than Lightbox.
[jQuery] Re: JQuery effects not working in Internet Explorer 6
On Feb 6, 10:30 am, Tintin81 wrote: I am new to Javascript and implemented a few nice JQuery features on a href=http://new.designbits.de;my new website/a . All of them work great in Firefox and Safari. In IE6, however, the site looks like a mess, even with Javascript enabled in the options panel. snip There are two JScript errors reported as that page loads in IE. The first is a complaint about a missing ';' (and you will have to track down yourself), the second is in your functions.js file where you have:- $.extend($.validator.messages, { required: , email: , }); - in which an object literal's contents end in a comma. This is a syntax error by ECMAScript rules, and so should be expected to be a syntax error in browsers that implement the ECMAScript standard (such as JScript in IE (more or less)). The ECMA standard allows syntax extension and JavaScript(tm) (and good JavaScript(tm) imitators) take advantage of that to be more tolerant of commas at the end of object literal contents than they need to be (as the extra commas do not result in ambiguities). JScript doesn't and so sees the comma as a syntax error, and so that is a very likely cause of differences in behaviour between IE and other browsers. Particularly if the behaviour on IE looks like total failure to act on a script.
[jQuery] how to wait for image finished loading then display the page?
Hi guys, My website is www.menggaris.com and if you go there 1st time, you will find that it takes sometimes to load as the first page consist of several images of a total of about 260kb in size. My index.html is like follow: -- body div id=main div id=slide/div div id=skip style=display:none;margin:50px 0;font-size:36px about.php Get me out of here ! /div /div /body -- and the javascript for this page is like follows: -- jQuery.preloadImages = function() { for(var i = 0; iarguments.length; i++) { jQuery( ).attr(src, arguments[i]); } }; $.preloadImages('images/loading.gif','images/logo.jpg', 'images/tech-buddy.jpg', 'images/microsoft-logo.jpg', 'images/java-logo.gif', 'images/linux-logo.jpg','images/mysql-logo-web-large.jpg','images/oracle-logo-web.jpg','images/dotnet-logo-web-large.jpg','images/php-logo-web-large.jpg','images/mssql.jpg','images/san-logo-web-large.jpg','images/bea-logo.gif'); $(function() { $('#slide').crossSlide({ fade: 1 }, [ { src: 'images/logo.jpg', from: '100% 80% 1x', to: '100% 0% 1.7x', time: 3 }, { src: 'images/tech-buddy.jpg', from: '100% 80% 1.5x', to: '80% 0% 1.1x', time: 3 }, { src: 'images/microsoft-logo.jpg', from: '100% 80% 1x', to: '100% 0% 1.7x', time: 2 }, { src: 'images/java-logo.gif', from: '100% 50%', to: 'bottom right 1.5x', time: 2 }, { src: 'images/linux-logo.jpg', from: 'top left', to: 'bottom right 1.5x', time: 2 }, { src: 'images/mysql-logo-web-large.jpg', from: '100% 80% 1.5x', to: '80% 0% 1.1x', time: 2 }, { src: 'images/oracle-logo-web.jpg', from: 'top left', to: 'bottom right 1.5x', time: 2 }, { src: 'images/dotnet-logo-web-large.jpg', from: '100% 50%', to: '30% 50% 1.5x', time: 2 }, { src: 'images/php-logo-web-large.jpg', from: 'top left', to: '30% 50% 1.5x', time: 2 }, { src: 'images/mssql.jpg', from: '100% 80% 1.5x', to: '80% 0% 1.1x', time: 2 }, { src: 'images/san-logo-web-large.jpg', from: 'top left', to: 'bottom right 1.5x', time: 2 }, { src: 'images/bea-logo.gif', from: 'top right', to: 'bottom right 1.5x', time: 2 } ]); }); $(document).ready(function(){ $('#skip').show('slow'); }); -- I am trying to use the jquery preloadImages function. I slide show library I am using is by jquery.cross-slide.js. The problem here is that I want to finish loading the images then the word Get me out of here ! appear. Now the word appear before those images finished loading. Is is possible that I use jquery to check if all the images have done loading then I display the word Get me out of here ! ? If yes, could someone please show me the code ? Thanks, Mark Thien -- View this message in context: http://www.nabble.com/how-to-wait-for-image-finished-loading-then-display-the-page--tp21866970s27240p21866970.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] 1.3, live events, and iphone
hi all, I am having problems getting live events with jquery 1.3.1 to work on the phone ... it works ok on safari (windows), but not on the device itself. I would appreciate any tips, help, info ... thanks ! Roger
[jQuery] Re: Plugin Question
On Feb 6, 3:46 am, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Found it: When you specify rules in the validate-call, the name is referenced, not the id. Replacing select with field_3 (or renaming the latter) should fix it. Jörn Perfect! Thanks.
[jQuery] Re: ui draggable (option drag doesn't work)
It's a callback option, which are currently listed at the bottom of the list of options (not intermingled otherwise in alpha order with the regular options). We're working on showing them on their own tab. - Richard On Fri, Feb 6, 2009 at 3:21 AM, jQuery Lover ilovejqu...@gmail.com wrote: I don't see a drag option in draggables documentation... or am i missing anything here ??? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 10:19 AM, Richard D. Worth rdwo...@gmail.com wrote: Which version of jQuery UI are you using? jQuery UI 1.5.3 is only compatible with jQuery 1.2.6 jQuery UI 1.6rc6 is only compatible with jQuery 1.3+ When these don't match, the most common error is callbacks not firing. If that's not your issue, please post a follow-up on the jQuery UI list http://groups.google.com/group/jquery-ui Thanks. - Richard On Thu, Feb 5, 2009 at 8:26 PM, knight knight@gmail.com wrote: Hello, The question is why drag-option doesn't work ( options.drag = function (event,info) { alert('drag'); } )? Thanks in advance. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleScroll element/title style type=text/css .scrollable { overflow:hidden; height:200px; width:350px; margin:100px auto; } .bloc { margin:5px auto; font-size:12px; } .scr_cnt_handle { float:left; height:100%; border:1px solid #000; } .scr_body { float:left; overflow:hidden; height:200px; width:300px; } .ctr_handle { width:20px; height:40px; background-color:#006699; } /style script src=jquery-1.3.1.min.js type=text/javascript language=javascript/script script src=ui.core.js type=text/javascript language=javascript/script script src=ui.draggable.js type=text/javascript language=javascript/script script type=text/javascript language=javascript $(function(){ var options = {}; options.containment = 'parent'; options.axis = 'y'; options.drag = function(event,info) { alert('drag'); } $('.ctr_handle').draggable(options); }); /script /head body div class=scrollable div class=scr_body div class=bloc img src=FooterRevision.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=InteriorPage1.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=InteriorPage2.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div div class=bloc img src=FooterRevision.png width=60 height=60 style=float:left; / Text some here text! Text some here text! Text some here text! Text some here text! /div /div div class=scr_cnt_handle div class=ctr_handle/div /div div style=clear:both;/div /div /body /html
[jQuery] jQuery offsetParent - using with drag/drop UI problem in IE7
hi all, this problem is driving me nuts! i hope to be able to provide as much info as possible to help resolve it!! the site is working fine with the drag n drop, but at some points the drag feature breaks reporting an error with line number 3370 (or there abouts as i have added a couple of lines to try n debug)...the line number points to this line of code... offsetParent = elem.offsetParent, it reports and error in IE with the script debugger...i have tried logging the elem to the console and it works fine, but for some reason it breaks when trying to get the offsetParent and ownerDocument from the draggable element. any help would be most gratefully appreciated!!! i can supply a URL to view the issue...the site works fien in FF otherwise i'd be using firefbug to track down the problem...i can't seem to extract any more info than this really...! again thanks in advance!! tom
[jQuery] Re: General Question RE: Using jQuery with Wordpress
There is still a js error in your onAfter() function. You have jQuery.noConflict(); set and using $('.imgcap'). My 2 cents. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 4:09 PM, MH1988 m.lawrencehu...@gmail.com wrote: I honestly cannot believe but I've made it work. This has been troubling so much and it's finally worked. What I don't understand is why it did not work in the first place. I also think one important reason I just discovered that you had to load all your CSS files before the jQuery script/s. Which may have been the reason why it was not loading the plugin. Now, I've just link the jQuery framework from the jQuery website and it's working! On Feb 6, 9:39 pm, MH1988 m.lawrencehu...@gmail.com wrote: Many thanks for your response. Here is the page I have tried to attempt making the jQuery Cycle plugin work correctly: a href=http://www.culturesinbetween.net/NEWWEBSITE/archives/299;website/a 1. The first thing I did was add the scripts in my Wordpress theme's header.php: ?php wp_enqueue_script('jquery'); ? script type='text/javascript' src='http://www.shapemould.com/ culturesinbetween/NEWWEBSITE/wp-content/themes/sirup/ jquery.cycle.all.js'/script script type='text/javascript' jQuery(document).ready(function(){ jQuery('#frame1').cycle({ fx:'fade', speed:'2000', timeout: 0, next:'#next2', prev:'#prev2'}); }); /script 2. Within the Wordpress post page (Add New Post), I added the following (selecting HTML of course): div id=imgframe div id=frame1 class=pics img src=http://www.culturesinbetween.net/NEWWEBSITE/wp-content/ uploads/arnsdorfss09_f.jpg / img src=http://www.culturesinbetween.net/NEWWEBSITE/wp-content/uploads/arnsdorfss09_...; / /div a id='prev2' href='#'Prev/a | a id='next2' href='#'Next/a /div I did not define any CSS for #frame1. However I defined .pics with: .pics { width: 200px; height: 200px; overflow: hidden; } The results is that the page seems to display the correct CSS styling and loads jQuery but I am suspecting that it does not load the jQuery plugin. Can I ask if there is a solution to make the the image cycle work? On Feb 6, 6:45 pm, jQuery Lover ilovejqu...@gmail.com wrote: jQuery works just fine with wordpress. There is nothing in wordpress that may conflict with jquery. Moreover, wordpress admin panel uses jquery. Can you post a link to your page, so we could look into it and try to find out what's causing the problem... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 11:48 AM, MH1988 m.lawrencehu...@gmail.com wrote: I just wanted to ask in general if using jQuery inconjunction with Wordpress does actually work? I'm pretty sure if jQuery (attached with a jQuery plugin) would work if it was to be included on the frontpage (index.php) but maybe not for individual Wordpress posts? It's has been quite a mountain to see if jQuery would work at all as I was trying to use the Cycle plugin for a simple prev/next image slideshow but to no avail. changing the script to jQuery () didn't work either. I've decided to use Lightbox which uses the Prototype framework and that does work but prefer images within ul's and li's with a div overflow: hidden than Lightbox.
[jQuery] Re: 1.3, live events, and iphone
What device are you using, and what browser ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 4:14 PM, yad...@gmail.com yad...@gmail.com wrote: hi all, I am having problems getting live events with jquery 1.3.1 to work on the phone ... it works ok on safari (windows), but not on the device itself. I would appreciate any tips, help, info ... thanks ! Roger
[jQuery] Re: jQuery offsetParent - using with drag/drop UI problem in IE7
In the future, please post questions about jQuery UI bugs to the jQuery UI Dev list: http://groups.google.com/group/jquery-ui-dev The list you've posted to is for general help with jQuery. Also, if you could open a ticket in the jQuery UI bug tracker: http://dev.jqueryui.com/newticket (note: registration required) Please be sure to provide information about what version of jQuery and jQuery UI you are using. If you can attach a minimal test page that shows the error, that will help even more. Thanks. - Richard On Fri, Feb 6, 2009 at 7:40 AM, tom gee t...@obskure.org wrote: hi all, this problem is driving me nuts! i hope to be able to provide as much info as possible to help resolve it!! the site is working fine with the drag n drop, but at some points the drag feature breaks reporting an error with line number 3370 (or there abouts as i have added a couple of lines to try n debug)...the line number points to this line of code... offsetParent = elem.offsetParent, it reports and error in IE with the script debugger...i have tried logging the elem to the console and it works fine, but for some reason it breaks when trying to get the offsetParent and ownerDocument from the draggable element. any help would be most gratefully appreciated!!! i can supply a URL to view the issue...the site works fien in FF otherwise i'd be using firefbug to track down the problem...i can't seem to extract any more info than this really...! again thanks in advance!! tom
[jQuery] Re: What is the best option to make this modal???
Hi André, have you tried the jQuery UI Dialog widget? by(e) Stephan 2009/2/6 AndreMiranda acymira...@gmail.com: Hi everyone!! Can you guys tell me the best way to do this? I have a page which lists several tasks of a person. And when you roll over one task, a popup/modal/tip will appear and dynamically will get all information about this task. What are the best plugins to make this? The best way... Thanks in advance!! André
[jQuery] Modify and accordian to only open and close when clicked
Hi Guys, I need some advice, I've been using and accordian as per an example I found somewhere: script $(document).ready(function(){ $(dd:not(:first)).hide(); $(dt a).click(function(){ $(dd:visible).slideUp(slow); $(this).parent().next().slideDown(slow); return false; }); }); /script This works on a list like the below: dta href=#h4Heading/h4/a/dt ddList like this/dd When you click on a DT it closes all open DDs. I now need to change this so that it will check to see if the DD is visible. If it is to close the DD of the clicked DT. If it's not open to open it. One of the demo's on this page - http://ui.jquery.com/demos/accordion/#collapsible does what I want but: 1) I'd have to change all my DT / DDs to 2) I'll not have learnt anything other than to copy and paste. Thanks James I've been trying for ages to find the syntax to do this, but I'm having no success I don't seem to get the syntax and / or the DOM navigation theory. Can anybody point me in the right direction please. James
[jQuery] Re: jQuery 1.3 incompatible plugins
Hi, quick fix for compatibility with jQuery 1.3 1. Open jquery.fancybox.js file 2. Replace line 73: Before: var arr = $(a...@rel= + el.rel + ]).get(); After: var arr = $(a[rel= + el.rel + ]).get(); Bye. On 22 Led, 16:13, Gordon grj.mc...@googlemail.com wrote: Sorry for the double posting! Google groups seems to have gone nuts on me, it's also decided that my google email address should be my primary address instead of the address I've used for years, and as a result I'm no longer subscribed to any of my groups. On Jan 22, 2:26 pm, Stefan Sturm stefan.s.st...@googlemail.com wrote: Hello, good Question. I have problems withFancyboxandjQuery1.3... Greetings, Stefan Sturm 2009/1/22 Gordon grj.mc...@googlemail.com: Just a quick question, is there a list of plugins that don't work with jQuery1.3, or a list of plugins that have been upgraded to work with it? I want to be able to quickly check my list of plugins against a list of known incompatibilities before upgrading.
[jQuery] Re: how to wait for image finished loading then display the page?
Hello What about this? div id=skip style=display:none;margin:50px 0;font-size:36px spanabout.php Get me out of here !/span /div // .. //your code... // .. $(document).ready(function(){ $('#skip').find('span').hide().end().show('slow').end().find ('span').show('slow'); });
[jQuery] How to enable jquery in a loaded page?
Hi there, I am having a problem to enable jquey in a loaded page. For example: base.php has jquery and i load showContent.php like: $(document).ready(function() { $(#show).click(function() { $(#content).css(overflow-y, scroll); $(#content).load(showContent.php); }); but now the jquery in showContent.php doesn't work. if i directly browse to showContent.php the jquery does work Any tips?
[jQuery] Re: What is the best option to make this modal???
Hi Stephan!! But, can jQuery Dialog interact dynamically like I need in my project?? Thanks!! André On 6 fev, 11:28, Stephan Veigl stephan.ve...@gmail.com wrote: Hi André, have you tried the jQuery UI Dialog widget? by(e) Stephan 2009/2/6 AndreMiranda acymira...@gmail.com: Hi everyone!! Can you guys tell me the best way to do this? I have a page which lists several tasks of a person. And when you roll over one task, a popup/modal/tip will appear and dynamically will get all information about this task. What are the best plugins to make this? The best way... Thanks in advance!! André
[jQuery] Re: how to wait for image finished loading then display the page?
Hi Mark, I would suggest that you wait on the load event of your images. Something like: var imgTotal = 10; // total number of images on your page var imgCount = 0; $(img).load(function(){ imCount++; if (imgCount == imgTotal) $(#skip).show(); } There are plenty of discussions about image load on this list. Take a look at: http://groups.google.at/group/jquery-en/browse_thread/thread/2cfdb0ad4101e49d/595665699c4885bc http://groups.google.com/group/jquery-dev/browse_thread/thread/24b107e84adeaaee/ by(e) Stephan 2009/2/6 gregory.pelletey ptitgr...@gmail.com: Hello What about this? div id=skip style=display:none;margin:50px 0;font-size:36px spanabout.php Get me out of here !/span /div // .. //your code... // .. $(document).ready(function(){ $('#skip').find('span').hide().end().show('slow').end().find ('span').show('slow'); });
[jQuery] Re: jQuery offsetParent - using with drag/drop UI problem in IE7
hi, apologies the reason i didn't post in the UI group was because it was a method of jQuery itself, so I wasn't too sure which group to put it in to be honest! the thing is im unsure if its a problem with jQuery, I was just hoping someone might be able to see if there was a problem with the setup/ code or if someone had run into the same problem! using jQuery 1.2.6 with an unkown version of UI as its only the minified version with no comments, it would be whicever version is compatible with 1.2.6. thanks, tom On Feb 6, 1:00 pm, Richard D. Worth rdwo...@gmail.com wrote: In the future, please post questions about jQuery UI bugs to the jQuery UI Dev list: http://groups.google.com/group/jquery-ui-dev The list you've posted to is for general help with jQuery. Also, if you could open a ticket in the jQuery UI bug tracker: http://dev.jqueryui.com/newticket(note: registration required) Please be sure to provide information about what version of jQuery and jQuery UI you are using. If you can attach a minimal test page that shows the error, that will help even more. Thanks. - Richard On Fri, Feb 6, 2009 at 7:40 AM, tom gee t...@obskure.org wrote: hi all, this problem is driving me nuts! i hope to be able to provide as much info as possible to help resolve it!! the site is working fine with the drag n drop, but at some points the drag feature breaks reporting an error with line number 3370 (or there abouts as i have added a couple of lines to try n debug)...the line number points to this line of code... offsetParent = elem.offsetParent, it reports and error in IE with the script debugger...i have tried logging the elem to the console and it works fine, but for some reason it breaks when trying to get the offsetParent and ownerDocument from the draggable element. any help would be most gratefully appreciated!!! i can supply a URL to view the issue...the site works fien in FF otherwise i'd be using firefbug to track down the problem...i can't seem to extract any more info than this really...! again thanks in advance!! tom
[jQuery] Re: How to enable jquery in a loaded page?
It's probably because your jquery code is in $(document).ready() function and it is never fired when you load with .load(). Put your code in callback function like this: $(document).ready(function() { $(#show).click(function() { $(#content).css(overflow-y, scroll); $(#content).load(showContent.php, function(){ // your code here... }); }); Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 6:40 PM, 123gotoandplay wesweatyous...@gmail.com wrote: Hi there, I am having a problem to enable jquey in a loaded page. For example: base.php has jquery and i load showContent.php like: $(document).ready(function() { $(#show).click(function() { $(#content).css(overflow-y, scroll); $(#content).load(showContent.php); }); but now the jquery in showContent.php doesn't work. if i directly browse to showContent.php the jquery does work Any tips?
[jQuery] Re: What is the best option to make this modal???
There are dependencies with jQuery UI dialog. You better use one of the other lightweight and simple modal boxes without all unnecessary functionality... http://www.google.com/search?q=jquery+modal+plugin Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 6:44 PM, AndreMiranda acymira...@gmail.com wrote: Hi Stephan!! But, can jQuery Dialog interact dynamically like I need in my project?? Thanks!! André On 6 fev, 11:28, Stephan Veigl stephan.ve...@gmail.com wrote: Hi André, have you tried the jQuery UI Dialog widget? by(e) Stephan 2009/2/6 AndreMiranda acymira...@gmail.com: Hi everyone!! Can you guys tell me the best way to do this? I have a page which lists several tasks of a person. And when you roll over one task, a popup/modal/tip will appear and dynamically will get all information about this task. What are the best plugins to make this? The best way... Thanks in advance!! André
[jQuery] Re: Internet Explorer not firing ajax get on success of ajax post
Add an error part and see what's going on... (just rigth after succss, comma separated) error: function(object,text,error){ alert(object.status); } On Feb 5, 2:37 pm, georgelaugha...@gmail.com georgelaugha...@gmail.com wrote: I have a web application that i have been working on for a few months now and i ran into a stumbling block about 2 weeks ago, i have tried everything i can think of and with no success i figured i would get a second opinion. $(document).ready(function(){ $(button#Submit).click(function() { var TN = $(#TroopNumberS).attr(value); var TL = $(#TroopLocationS).attr(value); var FN = $(#FName).attr(value); var LN = $(#LName).attr(value); var A = $(#Age).attr(value); var R = $(#Rank).attr(value); var W = $(#WeekS).attr(value); var id = $(#ID).attr(value); $.ajax({ type: POST, url: /php/addscout.php, data: TN=+TN+TL=+TL+FN=+FN+LN=+LN+A=+A+R=+R +W=+W, success: function(del){ $.facebox.loading(true); $.get([forms/addscout.php?id=+id], function(data){ jQuery.facebox(data) }); $.get([records/addscoutprogress.php?tn=+TN+tl=+TL], function (data){ document.getElementById(progressivelist).innerHTML=data; }); } }); return false; }); }); this is the post function the problem i am having is inside the success function it calls two pages the first is actually calling back it's self this clears out all the fields and lets them add again without the reload the second gets added to the bottom of the first and is a progressive list of what they added so they can see it happening as it happens. the content of the next page is as follows table cellpadding=8 ?php mysql_connect($host, $username, $password)or die(cannot connect); mysql_select_db($db_name)or die(cannot select DB); $TroopNum=$_GET[tn]; echo br /; $TroopLoc='.$_GET[tl].'; echo $TroopLoc; echo $TroopNum; $sql2=SELECT * FROM Scouts WHERE TroopNumber = $TroopNum AND Location = $TroopLoc; $result2=mysql_query($sql2); $count2=mysql_num_rows($result2); $x=0; for ($i=0; $i $count2; $i++) { $x++; $row = mysql_fetch_array($result2); if($x==1){echo trtd style='border-right:2px solid #DDD'.$row [ScoutName]./td;} elseif($x==2){echo td style='border-right:2px solid #DDD'.$row [ScoutName]./td;} else{echo td.$row[ScoutName]./td/tr;$x=0;}} ? /table just a simple table to show progress all of this works fine in Firefox safari everything but IE and the only part not working in IE is the second page it calls it back in but without the stuff they added ergo defeating it's purpose and i have checked it is submitting but the thing that i find most weird is that it won't even show the new content on a page reload, i have to close the page and open it again to get the new content it is like IE is loading that page as soon as the site loads and then just keeping the information it has instead of reloading it sorry for the long post but i wanted to make the problem and thanks for reading it please post any thoughts i will try anything my client won't accept the project without this function and it has me stumped thanks DJ
[jQuery] Re: Optimize large DOM inserts
Hi, Mike, et al... I'm having the same problem loading the DOM with a lot of generated HTML and I'm very interested in your approach to generating the code. I looked over the example you have at ...loop2.html and have tried to modify it, but I'm afraid there's too much I don't understand. My code works, but it's slow when loading the DOM making the browser to freeze and I'm afraid that will confuse the user. If it's not too much trouble, would you consider modifying my code below to follow your pattern so I can see if it speeds up loading my DOM? I would appreciate it very much, if you have the time or interest. Rick Here's my table building code: function populateDutyTable(response) { //First, empty table body of data $('#scheduleBody').empty(); currentDay = ; //For each row within the query $.each(response.QGETDUTYSCHEDULE.DATA, function(i, row) { if (currentDay != row[1]) { //Define a variable that will hold the html string var myRow1 = 'tr'; currentDay = row[1]; myRow1 += 'td class=cell-day' + row[1] + '/td'; myRow1 += 'td class=cell-date' + row[2] + '/td'; myRow1 += 'td class=cell-blank colspan=5nbsp;/td'; myRow1 += '/tr'; $('#scheduleBody').append(myRow1); } var myRow2 = 'tr'; myRow2 += 'td class=cell-blank-daynbsp;/td'; myRow2 += 'td class=cell-blank-datenbsp;/td'; myRow2 += 'td class=cell-am-am' + row[3] + '/td'; myRow2 += 'td class=cell-position' + row[4] + '/td'; myRow2 += 'td colspan=3Cell Content/td'; myRow2 += '/tr'; //Append row with names to the body of the table $('#scheduleBody').append(myRow2); }); } And here's what you coded: $(function() { var rows = []; for( var i = 0; i 2000; ++i ) { rows[i] = { text: ''+i }; } var t1 = + new Date; function loadTable( rows ) { var out = [], o = -1; out[++o] = 'tabletbody'; for( var row, iRow = -1; row = rows[++iRow]; ) { out[++o] = 'trtd'; out[++o] = row.text; out[++o] = '/td/tr'; } out[++o] = '/tbody/table'; $('#container').html( out.join('') ); } loadTable( rows ); var t2 = + new Date; alert( ( t2 - t1 ) / 1000 + ' seconds' ); }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Michael Geary Sent: Thursday, February 05, 2009 10:26 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Optimize large DOM inserts ...there is not much room for improvement left. You just know that when you say that, someone will come along with a 20x-40x improvement. ;-) http://mg.to/test/loop1.html http://mg.to/test/loop2.html Try them in IE, where the performance is the worst and matters the most. On my test machine, the first one runs about 6.3 seconds and the second one about 0.13 seconds. -Mike
[jQuery] slideToggle(); odd and even click
I have a navigation which consists of a few ul's placed within one and the same parent; a div. All but the first list item of these unordered lists get hidden and the first acts as a trigger to either show or hide the underlying li's. All this happens with a little animation by making use of slideToggle(); As a little extra I'd like only one list to be open at a time. So if list1 is open and I click on list3, list1 should close and list3 should open. This is where the toggle get's a little confused because once you've clicked odd on it, it expects an even click which never get's triggered because the clicking of any other lists already triggers the closing. Anyone a good tut/link/idea how to tackle this?
[jQuery] Re: [validator] custom rule with additional params
it works . I doubted similar reason too but I couldn't catch because of another silly quoting mistake. after read your reply I found my mistake. thank you for your help yongbin On Feb 5, 5:47 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Looks like you didn't pass along proper JavaScript, try this: input id=WBC_I type=text size=6 validate=range_exp:[ 1, 999, 'ND' ] value= name=WBC_I/ Note the quotes around ND. If that isn't it, please provide a testpage. Jörn On Thu, Feb 5, 2009 at 2:21 AM, yongbin superma...@gmail.com wrote: Hi at first, I really thanks for great efforts in Jquery and validator.they reduce our time and work less than half. now, we can't write even simple script without them recently, I tried to make custom rule method that called with 3 arguments such as... input id=WBC_I type=text size=6 validate=range_exp:[ 1, 999, ND ] value= name=WBC_I/ ( I use metadata plugin ) and my custom method is jQuery.validator.addMethod(range_exp, function(value, element, params) { return this.optional(element) || ( (value = params[0] value = params[1]) || value == params[2] ); }, Please enter between {0} and {1} or {2}); I just need some exception for range rule. but It didn't work. IMO there are some problems in params handle process. any idea? Thanks. yongbin
[jQuery] Re: Optimize large DOM inserts
Hi Michael, Ouch. That's quite a difference. I thought about the join vs concatenate performance difference in IE, but didn't remember it could be that large. I take that one, I was being displiscent. cheers, - ricardo On Feb 6, 1:25 am, Michael Geary m...@mg.to wrote: ...there is not much room for improvement left. You just know that when you say that, someone will come along with a 20x-40x improvement. ;-) http://mg.to/test/loop1.html http://mg.to/test/loop2.html Try them in IE, where the performance is the worst and matters the most. On my test machine, the first one runs about 6.3 seconds and the second one about 0.13 seconds. -Mike From: Ricardo Tomasi Concatenating into a string is already much faster than appending in each loop, there is not much room for improvement left. What you can do improve user experience though is split that into a recursive function over a setTimeout, so that the browser doesn't freeze and you can display a nice loading animation. On Feb 5, 5:03 pm, James james.gp@gmail.com wrote: I need tips on optimizing a large DOM insert to lessen the freeze on the browser. Scenario: I receive a large amount of JSON 'data' through AJAX from a database (sorted the way I want viewed), and loop through them to add to a JS string, and insert that chunk of string into a tbody of a table. Then, I run a plug-in that formats the table (with pagination, etc.). Simplified sample code: var html = ''; $.each(data, function(i, row) { html += 'trtddata from json/td/tr';}); $(tbody).append(html); $(table).formatTable(); formatTable() requires that the table has to be completed before it can be executed. Is there any way I can optimize this better? I think I've read somewhere that making a string too long is not good, but I've also read that updating the DOM on each iteration is even worst. Any advice would be appreciated!
[jQuery] Re: 1.3, live events, and iphone
Opsy, my bad. Did not see the title that says iPhone... I suggest using event delegation: www.learningjquery.com/2008/03/working-with-events-part-1 Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 5:45 PM, jQuery Lover ilovejqu...@gmail.com wrote: What device are you using, and what browser ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 4:14 PM, yad...@gmail.com yad...@gmail.com wrote: hi all, I am having problems getting live events with jquery 1.3.1 to work on the phone ... it works ok on safari (windows), but not on the device itself. I would appreciate any tips, help, info ... thanks ! Roger
[jQuery] [FIX] metadata fix proposed
Firefox 3.1b2 returns classname with \n. All other browsers don't. In metadata plugin the default regexp is /({.*})/ I fixed this problem with this regexp /({[\s\S]*})/ so defaults : { type: 'class', name: 'metadata', //cre: /({.*})/, cre: /({[\s\S]*})/, single: 'metadata' } my report is here. https://bugzilla.mozilla.org/show_bug.cgi?id=476809 Thank you.
[jQuery] Re: Checkbox selection
Thanks! I'll give your suggestions a shot :-)
[jQuery] Re: Ajax callback parameter endless
a call like this : confirm('message ?',function(){showAnswer ('1','2','3');}) the function showAnswer is execute 1 time. If i make another call : confirm('message ?',function(){showAnswer ('1','2','3');}) the function showAnswer is execute 2 times. I don't want (n+1) answer after call confirm. How can i have always one answer ? On Feb 6, 3:36 pm, ilovejquery ilovejqu...@gmail.com wrote: Didn't get exactly what you want, but I think you might find useful the fact that you have arguments array in body of every function() that has an array of arguments. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 7:12 PM, Kpitn pierre.bas...@gmail.com wrote: Hi I have override the confirm function like this : function confirm(msg,callback_true,callback_false) { if yes{ callback_true(); } else{ callback_false(); } } In my application i use the function like this : confirm('message',function(){ alert(ok)}, function (){ alert('not ok')}); I must ask the question a lot of time without reload the page. The problem is , when i recall the question, the answer is show 2 times, when i recall another question, the answer is call 3 times, etc ... I think the problem comes, from the way i use the callback, but how can i do if my callbacks functions have parameters ? Thx
[jQuery] Re: $.data
The jQuery docs weren't good enough? http://docs.jquery.com/Internals/jQuery.data You should probably be using the data() function from core though. http://docs.jquery.com/Core/data Ian On Fri, Feb 6, 2009 at 4:51 PM, Chris J. Lee chri...@gmail.com wrote: I haven't been able to find good documentation on the use of $.data. Does anyone have any good links to use of this function? -- === 株式会社ビープラウド イアン・ルイス 〒150-0012 東京都渋谷区広尾1-11-2アイオス広尾ビル604 email: ianmle...@beproud.jp TEL:03-5795-2707 FAX:03-5795-2708 http://www.beproud.jp/ ===
[jQuery] [treeview]
Hi, how can I achieve to have the fisrt 2 levels of my menu always open on page load? Thanks Heidi
[jQuery] What is the best option to make this modal???
Hi everyone!! Can you guys tell me the best way to do this? I have a page which lists several tasks of a person. And when you roll over one task, a popup/modal/tip will appear and dynamically will get all information about this task. What are the best plugins to make this? The best way... Thanks in advance!! André
[jQuery] Ajax callback parameter endless
Hi I have override the confirm function like this : function confirm(msg,callback_true,callback_false) { if yes{ callback_true(); } else{ callback_false(); } } In my application i use the function like this : confirm('message',function(){ alert(ok)}, function (){ alert('not ok')}); I must ask the question a lot of time without reload the page. The problem is , when i recall the question, the answer is show 2 times, when i recall another question, the answer is call 3 times, etc ... I think the problem comes, from the way i use the callback, but how can i do if my callbacks functions have parameters ? Thx
[jQuery] Re: How to enable jquery in a loaded page?
Hi 123, I believe that in showContent.php, your jQuery must relates to the DOM of your base.php. So you should change your jQuery in showContent so that the markups call like $(#someDiv) works in the base.php flow. 123gotoandplay a écrit : Hi there, I am having a problem to enable jquey in a loaded page. For example: base.php has jquery and i load showContent.php like: $(document).ready(function() { $(#show).click(function() { $(#content).css(overflow-y, scroll); $(#content).load(showContent.php); }); but now the jquery in showContent.php doesn't work. if i directly browse to showContent.php the jquery does work Any tips?
[jQuery] Re: $.browser and jQuery 1.3
Just adding my $0.02 about why browser sniffing should be discouraged but never completely deprecated - I use browser sniffing to redefine the fadeIn/fadeOut effects to slideDown/slideUp for IE7, because of the ClearType issue. It's a case where the effect _works_, so I can't use feature detection, but since the opacity animation effects look awful, it's not realistic to use those effects in IE7. As far as I can tell, it's a case where browser sniffing is still the best option. if ($.browser.msie) { jQuery.fn.fadeOut = jQuery.fn.slideUp; jQuery.fn.fadeIn = jQuery.fn.slideDown; } (I know I *should* be testing for IE version ... but then again it wouldn't surprise me at all if the ClearType problem persists in IE8) -Wick http://www.CarComplaints.com On Feb 5, 5:45 am, Liam Potter radioactiv...@gmail.com wrote: I'm doing this because every now and then safari seems to have a spasm with something, and the css hacks for safari are shoddy at best. Klaus Hartl wrote: I know it still works in 1.3, just wondering why we are advised not to use it. Because feature detection is much more future proof and stable than browser sniffing. With browser sniffing you simply make wrong assumptions. CSS may be a different beast, although I've never had the need for an extra style sheet other than IE, which I include with Conditional Comments. --Klaus
[jQuery] Re: [Superfish] Submenus appear underneath menu items when the menu wraps
Didn't find a fix - I tried bgiframe but couldn't get it to work. I'll go back to regular menus for the time being. Thanks On Wed, Feb 4, 2009 at 1:58 PM, jQuery Lover ilovejqu...@gmail.com wrote: This is how IE interprets z-index settings for positioned elements. Google it and you will surely find a fix: http://www.google.com/search?q=ie+z-index+issue Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Feb 4, 2009 at 2:56 PM, Michael Smith smi...@gmail.com wrote: Hi again I added this css: .sf-menu li li a { background:red; z-index:100; } and as you can see on : http://dev2.savingforchildren.co.uk/mjs/menu.epl When using IE (in my case IE6) the submenus still appear under the main menus. Anything I can do to get them on top? Michael On Tue, Feb 3, 2009 at 11:03 AM, Michael Smith smi...@gmail.com wrote: Thanks jQuery Lover - I messed around with a few things without success. Any chance you can be more specific as to the css change needed? Thanks again Michael On Tue, Feb 3, 2009 at 9:48 AM, jQuery Lover ilovejqu...@gmail.com wrote: Try setting z-index value in CSS for the current menu list with a higher value like 1000. Read my jQuery HowTo Blog- http://jquery-howto.blogspot.com On Tue, Feb 3, 2009 at 2:42 PM, Michael Smith smi...@gmail.com wrote: Hi, As per this example: http://dev2.savingforchildren.co.uk/mjs/menu.epl I find that if my menus wrap in IE, then the submenus appear underneath the other menus. In Firefox it's fine. Is there a way round this or is wrapping menus not supported? Thanks Michael
[jQuery] Re: rules section problem
Hello, removing rules from validate() and adding the line below outside of validate function fixed the issue: validator.settings.rules = { rules... }; Mesut TUNGA On 31 Ocak, 13:27, TUNGA mesut.tu...@gmail.com wrote: P.S. :http://nrzv.com/valid/?s=2 loads $(#myApplDiv).load(2.php); into the index.php On 31 Ocak, 13:22, TUNGA mesut.tu...@gmail.com wrote: Hi Jörn, Thanks for your reply. Here is the sample: http://nrzv.com/valid/ step 1 works well. on Step 2 there is a rule section like: rules: { secondSentDocumentsTo: { required: {depends: #secondPermanentAddress:filled } } } When you submit Step 1 and come on Step 2, even other validation(s) works, secondSentDocumentsTodependssection does not work. its working if you access the page via:http://nrzv.com/valid/?s=2 Both of access type uses load() function to load pages You can see the source via: http://nrzv.com/valid/index.phphttp://nrzv.com/valid/1.phphttp://nrzv... and the content of process.php is : ?=print $(\#myApplDiv\).load(\2.php\); ;? Thanks Mesut TUNGA On 28 Ocak, 20:56, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Can't spot any issues in that snippets. Could you post a testpage? Jörn On Wed, Jan 28, 2009 at 6:22 PM, TUNGA mesut.tu...@gmail.com wrote: Hello, I use validation code someting below. It works if I load that page directly. But loading it from another page using $(#myApplDiv).load ('that_page.php') therulessections does not work. But submitHandler section works well. script $().ready(function() { // some codes here var validator = $(#myForm).bind(invalid-form.validate, function () { $(#summary).html(Error); }).validate({ submitHandler: function() { // some codes here }, rules: { fieldName { required: {depends: #anotherFieldName:checked } } } }); }); /script Any suggestions? Thanks Mesut TUNGA
[jQuery] JQuery effects not working in Internet Explorer 6
Hey, I am new to Javascript and implemented a few nice JQuery features on a href=http://new.designbits.de;my new website/a . All of them work great in Firefox and Safari. In IE6, however, the site looks like a mess, even with Javascript enabled in the options panel. How can I get this fixed? Can anybody help? Thanks for any help!
[jQuery] Re: Ajax callback parameter endless
Didn't get exactly what you want, but I think you might find useful the fact that you have arguments array in body of every function() that has an array of arguments. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Feb 6, 2009 at 7:12 PM, Kpitn pierre.bas...@gmail.com wrote: Hi I have override the confirm function like this : function confirm(msg,callback_true,callback_false) { if yes{ callback_true(); } else{ callback_false(); } } In my application i use the function like this : confirm('message',function(){ alert(ok)}, function (){ alert('not ok')}); I must ask the question a lot of time without reload the page. The problem is , when i recall the question, the answer is show 2 times, when i recall another question, the answer is call 3 times, etc ... I think the problem comes, from the way i use the callback, but how can i do if my callbacks functions have parameters ? Thx
[jQuery] submit a submit value through ajax
Hello i have a form with 2 input class=plus type=submit value=0 name=plus/ input class=minus type=submit value=0 name=minus/ buttons in it and i want to receive these values through my ajax calls $('#cart_quantity').submit(function(){ var serialized_values = $('#cart_quantity').serialize() +'ajax=ajax_callswhat=cart'; var checked_basename = check_ssl($(this).attr('action')); $.ajax ({url:checked_basename,data:serialized_values,type:'POST',dataType:'json',success:function (data){put_it_in(data)},beforeSend:function(){show_loader('show');}}); return false; }); but in the receiving php the input type submit value is missing how can i handle this???
[jQuery] Re: JQuery effects not working in Internet Explorer 6
Hi Henry, Thanks you very much for your help. I have eradicated the comma and also did some other polishing work, but nothing has changed :-( The error message I am getting in Internet Explorer 6 is still the same. What bugs me is that Internet Explorer doesn't tell me the exact name of the file that the error comes from. It is constantly referring to a missing semicolon, but I can't figure out where that might be. Not even in which file... Can anybody come to the rescue? Thanks for any help in this matter... On Feb 6, 12:40 pm, Henry rcornf...@raindrop.co.uk wrote: On Feb 6, 10:30 am, Tintin81 wrote: I am new to Javascript and implemented a few nice JQuery features on a href=http://new.designbits.de;my new website/a . All of them work great in Firefox and Safari. In IE6, however, the site looks like a mess, even with Javascript enabled in the options panel. snip There are two JScript errors reported as that page loads in IE. The first is a complaint about a missing ';' (and you will have to track down yourself), the second is in your functions.js file where you have:- $.extend($.validator.messages, { required: , email: , }); - in which an object literal's contents end in a comma. This is a syntax error by ECMAScript rules, and so should be expected to be a syntax error in browsers that implement the ECMAScript standard (such as JScript in IE (more or less)). The ECMA standard allows syntax extension and JavaScript(tm) (and good JavaScript(tm) imitators) take advantage of that to be more tolerant of commas at the end of object literal contents than they need to be (as the extra commas do not result in ambiguities). JScript doesn't and so sees the comma as a syntax error, and so that is a very likely cause of differences in behaviour between IE and other browsers. Particularly if the behaviour on IE looks like total failure to act on a script.
[jQuery] Re: Superfish
just take a look at the source code for the site...basically it looks like this: li class=nav_pressa href=/briefing_room/ class=nav_itemspanThe Briefing Room/span/a div class=menu ul class=sub_nav lia href=/blog/The Blog/a/li lia href=/weekly_address/Your Weekly Address/a/ li lia href=/slideshows/Slideshows/a/li lia href=/briefing_room/PressBriefings/Press Briefings/a/li lia href=/briefing_room/OfficialStatements/Official Statements/a/li /ul ul class=sub_nav lia href=/briefing_room/PressReleases/Press Releases/a/li lia href=/briefing_room/ PresidentialActions/Presidential Actions/a/li lia href=/briefing_room/ nominations_and_appointments/Nominations amp; Appointments/a/li /ul div class=clear nbsp;/div /div /li then look at the style.css stylesheet. then check out the js in the jquery-plugins.js file related to superfish. On Feb 5, 5:41 pm, Mario designsdr...@gmail.com wrote: thanks for the response. Any idea where I can get some code that will allow me to create such navigation system? I'd appreciate the information. On Feb 4, 7:37 pm, Joel Birch joeldbi...@gmail.com wrote: Hello, I think that it's simply a matter of including multiple ul elements inside the parent li, then floating them alongside each other (obviously they will need a width to be set). I've seen this work and have experimented with it myself in the past to be sure that it does work, but I don't have any examples to show you unfortunately. Joel.
[jQuery] Re: JQuery effects not working in Internet Explorer 6
First try to replace first line in code of your page with !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd and see if it resolves anything. It could be only that, if not then try to validate your page (currently you have 20 warnings, no errors) and remove problems. I think it should do it. ..:: sheshnjak ::.. www.tomislavdekovic.iz.hr
[jQuery] Re: jQuery offsetParent - using with drag/drop UI problem in IE7
ah finally i managed to find out what was causing it !!! not sure if this is something jQuery can even account for really, unless I guess if jQuery has been used to update the DOM, but its due to the ossetParent bug with IE, when an element has been updated via the DOM it throws an unspecified error...!! http://weblogs.asp.net/rajbk/archive/2006/11/29/ie-6-7-unspecified-error-when-accessing-offsetparent-javascript.aspx thanks! On Feb 6, 2:09 pm, tom gee t...@obskure.org wrote: hi, apologies the reason i didn't post in the UI group was because it was a method of jQuery itself, so I wasn't too sure which group to put it in to be honest! the thing is im unsure if its a problem with jQuery, I was just hoping someone might be able to see if there was a problem with the setup/ code or if someone had run into the same problem! using jQuery 1.2.6 with an unkown version of UI as its only the minified version with no comments, it would be whicever version is compatible with 1.2.6. thanks, tom On Feb 6, 1:00 pm, Richard D. Worth rdwo...@gmail.com wrote: In the future, please post questions about jQuery UI bugs to the jQuery UI Dev list: http://groups.google.com/group/jquery-ui-dev The list you've posted to is for general help with jQuery. Also, if you could open a ticket in the jQuery UI bug tracker: http://dev.jqueryui.com/newticket(note:registration required) Please be sure to provide information about what version of jQuery and jQuery UI you are using. If you can attach a minimal test page that shows the error, that will help even more. Thanks. - Richard On Fri, Feb 6, 2009 at 7:40 AM, tom gee t...@obskure.org wrote: hi all, this problem is driving me nuts! i hope to be able to provide as much info as possible to help resolve it!! the site is working fine with the drag n drop, but at some points the drag feature breaks reporting an error with line number 3370 (or there abouts as i have added a couple of lines to try n debug)...the line number points to this line of code... offsetParent = elem.offsetParent, it reports and error in IE with the script debugger...i have tried logging the elem to the console and it works fine, but for some reason it breaks when trying to get the offsetParent and ownerDocument from the draggable element. any help would be most gratefully appreciated!!! i can supply a URL to view the issue...the site works fien in FF otherwise i'd be using firefbug to track down the problem...i can't seem to extract any more info than this really...! again thanks in advance!! tom
[jQuery] Re: JQuery effects not working in Internet Explorer 6
Hi and thanks for your feedback. Changing the document type didn't improve anything though :-( I think the devil is in my functions.js file. Where would I validate javascript files? Any ideas? Thanks... On Feb 6, 11:48 am, ..:: sheshnjak ::.. sheshn...@gmail.com wrote: First try to replace first line in code of your page with !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; and see if it resolves anything. It could be only that, if not then try to validate your page (currently you have 20 warnings, no errors) and remove problems. I think it should do it. ..:: sheshnjak ::..www.tomislavdekovic.iz.hr
[jQuery] Back or Continue Solution to UI Tabs and Jquery Form
Hi Folks I did this with ajax tab options and Jquery Form $(document).ready(function() { $(#myForm).ajaxForm( function() { $(#tabs).tabs(select,2); }); }); Inside of my tab 1 have input type=submit id=back class=click value=« Back name=back/ input type=submit id=continue class=click value=Continue » name=continue/ As you can see if I submit #myForm I will go to next tab $(#tabs).tabs(select,2); But to back I am having problems. Because is a second submit button. So I am trying this: $(document).ready(function() { $(.click).click(function(){ //Get the id of this clicked item x = this.id; }); // before submit, call BackOrContinue var options = { beforeSubmit: BackOrContinue }; $(#myform).ajaxForm(options); function BackOrContinue { if (x == back) { $(#tabs).tabs(select,0); } else { $(#tabs).tabs(select,2); } } }); My error is $ is not defined I tried $(#myForm).ajaxForm( function() { x = this.id; alert(x); if (x == back) { $(#tabs).tabs(select,0); } else { $(#tabs).tabs(select,2); } }); and x = undefined What is missing? Regards macm
[jQuery] the french accents and jQuery
This is the sketeton of my HTMP page: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:v=urn:schemas- microsoft-com:vml lang=fr xml:lang=fr head ... meta http-equiv=content-type content=text/html; charset=iso-8859-1 / ... script src=jquery/jquery-1.3.1.js type=text/javascript/script script type=text/javascript src=jquery/jquery-ui- personalized-1.6rc6.js/script script src=jquery/jquery.form.js type=text/javascript/script ... $('#form1').ajaxSubmit( { type: 'POST', url: 'test.php', beforeSubmit: function(f,j,o) { var queryString = $.param(f); alert('About to submit: \n\n' + queryString); }, success: function(msg) { alert(msg); }, error: function(requete,iderror) { alert(iderror + + requete); } }); return false; } form enctype='multipart/form-data' action='' id='form1' table trtdNom: /tdtdinput type='text' size='30' id='nom' name='nom' //td/tr trtdPrénom: /tdtdinput type=text size=30 id=prenom name=prenom //td/tr trtdPhoto: /tdtdinput type=file size=40 id=photo name=photo //td/tr /table /form If I enter a name with french accents then the queryString display wrong chars. How to pass correct strings to my test.php module ?
[jQuery] Re: Cross domain Ajax without Proxy
I tested it and it works cross-domain with IE7 and FF3. It appears to send the data URL encoded inside the CSS like so: #cr0 { background: red url(http://cssrpc/%3Ch1%3EResult%20from%20CSS %201%3C/h1%3E); } #cr1 { background: blue url(http://cssrpc/%3Cp%3EThis%20is%20lorem%20ipsum %20in%20a%20paragraph%20tag.%20Or%20something.%3C/p%3E); } So the url field is then URL decoded and written to the page. Is this right? Is there a advantage of using CSS files instead of JS files for cross-domain data communication? On Dec 12 2008, 12:31 am, Bil Corry b...@corry.biz wrote: ricardobeat wrote on 12/11/2008 7:06 PM: Hi Bill, it seems that that technique doesn't work for FF3, so it's out, unfortunately. It makes reference to an original prototype that does work with FF3, you can see it work here: http://ydnar.typepad.com/css-rpc/css-rpc.html Although it doesn't actually demonstrate loading anythingcross-domain, so I'm not sure if that would work or not. - Bil
[jQuery] Re: the french accents and jQuery
phicarre ha scritto: meta http-equiv=content-type content=text/html; charset=iso-8859-1 / Use always UTF8 for solving problems related on special chars. -- gianiaz.net - web solutions via angelo custode, 10 - 23100 sondrio (so) - italy +39 347 7196482
[jQuery] Re: IE7: Setting ColSpan as Attribute
Excellent solution! Had the same exact problem and was scratching my head for a while. Thank you very much! -Stefan On Jan 2, 9:18 am, NRutman nathan.rut...@gmail.com wrote: This had me scratching my head for a while, so I wanted to share it in case it might help someone else: It seems that using JQuery's attr() function to set a table cell'scolspanattributedoes not always work properly. Sometimes although theattributeis set properly in the DOM (which can be verified if you read thecolspanattributewith attr), IE still renders the cell as only 1 column wide instead of thecolspanvalue. What seems to work best is something like this: $(jQueryTableCells).each(function() { this.colSpan= someValue; }); The JavaScript implementation ofcolSpanseems to work fine. Looks like a problem with IE's implementation of the DOM rather than with JQuery, but I couldn't find it documented anywhere, so I wanted to post it here. -Nate
[jQuery] Re: jQuery AutoComplete - how to post a variable if option is selected?
James, that problem that you just described is the exact problem that I am having. I can get the autocomplete plugin to update a hidden input with an id value perfectly fine if the user selects a value from the list and triggers the result() function, however I also need it to clear the hidden input in every other case. Do you know how to accomplish this, or what part of the autocomplete plugin code might be relevant if I were to add something in? Thanks. On Feb 3, 6:00 pm, James james.gp@gmail.com wrote: One way I can think of is that you make a JSON list that has an id and name pair. When an existing option is selected, using theAutocomplete'sresult() function, add the id's value to some JS variable. (result() function:http://docs.jquery.com/Plugins/Autocomplete/result#handler) If it's typed in, the variable won't be set (because the result() function would not be triggered). Then when the form is submitted, use the extraParams option to pass the id value of that JS variable. You'd probably want to find a way to clear that JS variable also (probably through a typing event). There might be the possibility that someone selects from a list, the variable gets set, and decides to type his own name. But the variable is still set, which is incorrect. On Feb 3, 12:19 pm, ripcurlksm kevin.mccorm...@cox.net wrote: I am using a jQueryAutoCompleteplugin which fills in text as you type. I need to find a way when the page is submitted (submit.php) to determine if the user choose a company from the list, or if they typed in their own unique company. If an option is selected, can i have jQuery post an extra $_POST variable like new or existing so I can pick it up on the submit.php page? Or when an option is selected, can I have .js write a hidden tag which contains the variable existing? Example: [url]http://www.psylicyde.com/_old/autocomplete/[/url] Source Code: [url]http://www.psylicyde.com/_old/autocomplete/autocomplete.zip[/url] The end goal here is to post a variable on the next page if the user selected an option from theautocompletelist. -- View this message in context:http://www.nabble.com/jQuery-AutoComplete---how-to-post-a-variable-if... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Dropline menu which hides when not in use
I'm trying to find a dropline menu similar to http://www.cssplay.co.uk/menus/pro_dropline7.html (but without all the conditional comments used for IE6 + IE7). I need clean nested ul + li to make it work with http://www.madebyfrog.com/ http://users.tpg.com.au/j_birch/plugins/superfish/#sample4 is close but the dropline is permanently displayed. Has anyone converted that to show the dropline only on hover? Thanks.
[jQuery] Newbie question - downloading jQuery
I just stumbled across jQuery - I'm very impressed with what I've seen on the site. In my case my interest was sparked by a desire to put a floating dialog on our site. I've downloaded jQuery, and I was able to copy the code from the sample and get a dialog to show up, but I notice that the sample code includes the following lines: script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.core.js/script script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.dialog.js/script script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.resizable.js/script script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.draggable.js/script I was expecting the download to either contain all of the necessary code, or to expand to a set of files, and I would include the appropriate files from that directory. I'd like to have the code hosted on my server, rather than referring to version on the jquery servers. I'm obviously missing something in my efforts to download jQuery to my server. A little help getting me pointed in the right direction would be appreciated. Thanks, -Ron
[jQuery] Datepicker UI Opening at Random / Unexpected Locations
Hi, I have a Datepicker UI linked to a textbox using the following code: $(document).ready(function(){ txtDOB = $(input[name=txtDOB]); txtDOB.datepicker(); }); Screenshot of the Textbox: http://arch.kimag.es/share/85588260.jpg When I click on the textbox, the calendar opens at an unexpected location as seen in this picture Firefox appears over textbox: http://arch.kimag.es/share/34288230.jpg Chrome Working Fine: http://arch.kimag.es/share/75291561.jpg It works fine in Chrome. I really can't figure out why this is happening.. It works perfectly if the textbox is placed in the top regions of the page. The Actual Problem in a practical situation is here: http://arch.kimag.es/share/66324568.jpg I need this resolved as I really don't want to use a calendar component from some other module if jquery has it. Thanks
[jQuery] Jquery plugin localisation nightmare
Hi guys, I got a plugin I want to do the localisation in french. I decided to go with a similar solution of the UI datepicker. Adding a french js and reparse my json object in french from there. But it just do not work and i don't have a clue how. Please help Live english version : http://www.position-relative.net/formValidator/test.html The core js : jQuery.fn.validationEngine = function(settings) { allRules = {required:{ // Add your regex rules here, you can take telephone as an example regex:none, alertText:* This field is required} } .. }; The French js: jQuery(function($){ $.validationEngine.allRules = {required:{ regex:none, alertText:* Ce champs est requis} } });
[jQuery] Superfish with semi transparent background
Hi, I try to use Superfish with semi transparent background, making this: .sf-menu li { background: #404040; filter:alpha(opacity=90); /* Internet Explorer */ -moz-opacity:0.90; /* Mozilla 1.6 and below */ opacity: 0.90; /* newer Mozilla and CSS-3 */ } This in Firefox work, but when hover the link element in level 3, the backgound change to blank... In IE 7, the level 3 don't appear! Without opacity all work! Can you help me use li opacity?
[jQuery] Re: [autocomplete] Problem with .result
Has anyone figured out a solution to this? I'm trying to modify the autocomplete plugin so that it triggers a different function (something like clearField() instead of result()) when you click anywhere outside of the autocomplete search. You can then write some javascript to clear the hidden field and do whatever else you want it to do in your document. I basically want to constrain the user to select something that the autocomplete returns, and nothing else. On Jan 26, 7:37 pm, Aaron Jensen aaronjen...@gmail.com wrote: Yeah, we've run into this same trouble as well. It would be nice if there was a hook to handle this built intoAutocomplete. On Mon, Jan 26, 2009 at 3:18 AM, Styx pawel.chuchm...@gmail.com wrote: It dosen't work. For example: I use tab key to navigate. If focus is set to input, id will be empty. If I don't want change my input, id also shouldn't be change. IAnother example: If my result work and set id properly, if I keypress shift or ctrl, id field will be cleared. On 24 Sty, 00:20, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: You could add another keyup-event-handler to the input field, and clear the id field. As long as that runs before the result-handler is setting the data, it should give you the result you need. Jörn On Fri, Jan 23, 2009 at 5:09 PM, Styx pawel.chuchm...@gmail.com wrote: Hi. I have two fileds. For exmple: $(#name).autocomplete('seatch.php'); $(#id).result(function(event, data, formatted) { if (data) { $(#id).val(data[1]); } If i select sometfing inautocompletefield, my id field will have id of this item. After submit I have two fields - one wieth name, and one with id. I can for example update dabase use id. But if I write inautocompletesomethig, which isn't in result, my function isn't triggered. If i edit existing data, after submit I have field id with some value, and filed name with new value. I don't know, that I shoul add my name to database, or do something else. What I should do to clear field id when name is write by me and dosen't exist in result of 'search.php'? regards, pch
[jQuery] Re: Is this bug in IE or ui tabs
any ideas ? On Thu, Feb 5, 2009 at 5:56 PM, Varun Khatri khatri.vk1...@gmail.comwrote: I am using a function like : $('.ui-tabs-nav').bind('tabsselect', function(event, ui) { $(input[rel='currentTab']).val(ui.index); $(#example div.ui-tabs-panel).empty(); }); It just removes everything from tab , buttons , textbox , table everything... I want that when I click on some tab the controls belonging to that tab should be visible... Any idea ? Thanks Varun On Thu, Feb 5, 2009 at 4:12 PM, James james.gp@gmail.com wrote: Are your tabs AJAX? I had a similar issue, but it didn't work in Firefox also. Apparently this occurred for me because everytime you click on a tab, the AJAX loaded HTML remains in the DOM. This is an issue if you have separate tabs HTML with elements that have the same ID, as this will cause multiple elements with the same ID to exist at the same time. I put in a small code in select option for Tab UI that empties the div for all tabs when a different tab is clicked on and my problem went away. select: function() { $(#tab-container div.ui-tabs-panel).empty(); } On Feb 5, 1:52 pm, varun khatri.vk1...@gmail.com wrote: HI I am using ui tabs and i have 5 tabs on my page. Each tab is having a submit button and placeholder... when submit button is clicked , it fires a click event for that button in code behind and loads a table in placeholder of that tab... problem is after doing this process once in Internet Explorer when I go to another tab and hit submit button , it does not fire the event attached to that button... means if there are 3 submit buttons and 3 click events in code behind only 1 time submit button event is fired and then switching to different tab and hitting submit does nothing... But if I do the same stuff in firefox, it works . Can some one please advise ? Thanks Varun
[jQuery] Re: jqURL plugin throwing JS errors
Forgot to mention that I'm using jquery-1.2.3 for this project. andy _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Andy Matthews Sent: Friday, February 06, 2009 11:50 AM To: jquery-en@googlegroups.com Subject: [jQuery] jqURL plugin throwing JS errors Is there anyone using the jqURL plugin who has noticed errors on page load? All of a sudden I've noticed the following error: Permission denied to get property XULElement.accessibleType, line 139 'width=' + args.w + ',height=' + arg...eft=' + args.l + ',scrollbars,resizable' The implementation: // open the media library in a new window $.jqURL.loc( dspPhotoAdministration.cfm?category=4process=admincouponSelect=true,{ w:750, h:750, target:'imageSelect' }); It's tied to the click event on an IMG tag, and event still works...I'm just getting tired of seeing the error. Andy Matthews Senior Web Developer OLE Object: Picture (Metafile) www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com. attachment: winmail.dat
[jQuery] Re: Back or Continue Solution to UI Tabs and Jquery Form
How about, instead of: x = this.id; try: x = $(this).attr('id'); On Feb 6, 1:22 am, Mario Moura moura.ma...@gmail.com wrote: Hi Folks I did this with ajax tab options and Jquery Form $(document).ready(function() { $(#myForm).ajaxForm( function() { $(#tabs).tabs(select,2); }); }); Inside of my tab 1 have input type=submit id=back class=click value=« Back name=back/ input type=submit id=continue class=click value=Continue » name=continue/ As you can see if I submit #myForm I will go to next tab $(#tabs).tabs(select,2); But to back I am having problems. Because is a second submit button. So I am trying this: $(document).ready(function() { $(.click).click(function(){ //Get the id of this clicked item x = this.id; }); // before submit, call BackOrContinue var options = { beforeSubmit: BackOrContinue }; $(#myform).ajaxForm(options); function BackOrContinue { if (x == back) { $(#tabs).tabs(select,0); } else { $(#tabs).tabs(select,2); } } }); My error is $ is not defined I tried $(#myForm).ajaxForm( function() { x = this.id; alert(x); if (x == back) { $(#tabs).tabs(select,0); } else { $(#tabs).tabs(select,2); } }); and x = undefined What is missing? Regards macm
[jQuery] Re: Newbie question - downloading jQuery
What did you download? There is the main jquery library (plain, minified, etc.) and there's all the UI stuff. If you want to use the UI widget/effect libraries you'll have to get them separately. However, you can get them as prepackaged bundles based on the things you want: http://ui.jquery.com/download Just check the items you want, choose the version (on the right) and download. You can also use the Complete developer bundles at top to grab everything at once as separate files. On Fri, Feb 6, 2009 at 11:50 AM, rontivo christensen@gmail.com wrote: I just stumbled across jQuery - I'm very impressed with what I've seen on the site. In my case my interest was sparked by a desire to put a floating dialog on our site. I've downloaded jQuery, and I was able to copy the code from the sample and get a dialog to show up, but I notice that the sample code includes the following lines: script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.core.js/script script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.dialog.js/script script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.resizable.js/script script type=text/javascript src=http://ui.jquery.com/testing/ui/ ui.draggable.js/script I was expecting the download to either contain all of the necessary code, or to expand to a set of files, and I would include the appropriate files from that directory. I'd like to have the code hosted on my server, rather than referring to version on the jquery servers. I'm obviously missing something in my efforts to download jQuery to my server. A little help getting me pointed in the right direction would be appreciated. Thanks, -Ron
[jQuery] Re: Problem with .result
I just answered my own question. Here's the scenario and what I did to the autocomplete plugin: I have an autocomplete field and a hidden field next to it. The autocomplete field is for names, and the hidden field is for the id of the name, which is used to query the database for the record. These were the constraints on the fields: - values must be selected from the autocomplete, which sets the hidden field's value as the id of that particular entry (basically making the text input into a select input...but allowing people to type) - if a user does anything to the input box but doesn't select a field from the autocomplete, then it should clear the hidden id field The autcomplete plugin's result() function only calls when the user selects something from the autocomplete, so if the user selects something then CHANGES the value but doesn't re-select from the autocomplete, the value of the hidden input remains. This is what I changed in the plugin. There are several parts: 1) first, I define a new variable, selectionMade, for the object around line 80, right under where hasFocus is defined: var hasFocus = 0; var selectionMade = 0; 2) next, I tell the function that tracks keypresses to set selectionMade to 0 every time a key is pressed that changes the value of the input, around line 155: default: selectionMade = 0; clearTimeout(timeout); timeout = setTimeout(onChange, options.delay); break; 3) I then add a line that sets selectionMade to 1 whenever something is selected. This can be placed anywhere in the selectCurrent() function. I put mine around line 225 $input.val(v); selectionMade = 1; hideResultsNow(); 4) Finally, I add an if check on the .blur() function on the input object. This checks to see if selectionMade is 1 or 0. If it is 0, it triggers result() but sends undefined data. This should happen around line 170, and must be inside if(!config.mouseDownOnSelect) if(!config.mouseDownOnSelect) { hideresults(); if (selectionMade == 0) { $input.trigger(result, [0, ]); } } 5) Now, all you have to do is add a check in your application under the result() function. If data[1] is whatever value you pass when selectionMade == 0, you can execute code that does whatever you want it to do. For my purposes, I want it to clear the hidden id field, and clear the input field to indicate that nothing is selected. There is one problem. For some reason, when I do $input.trigger (result, [0, ]);, typeof data == undefined, not 0. This is probably because I just don't understand how the data is passed, but it would be nice if I could pass a concrete value, so that instead of checking if data[1] is undefined, I could check if it is 0 or some other integer or string. Let me know if anyone has any improvements. This is my first foray into modifying a jquery plugin, so it's almost guaranteed that I'm doing something wrong. Hope this helps! On Feb 6, 10:57 am, Han hgc...@gmail.com wrote: Has anyone figured out a solution to this? I'm trying to modify the autocomplete plugin so that it triggers a different function (something like clearField() instead of result()) when you click anywhere outside of the autocomplete search. You can then write some javascript to clear the hidden field and do whatever else you want it to do in your document. I basically want to constrain the user to select something that the autocomplete returns, and nothing else. On Jan 26, 7:37 pm, Aaron Jensen aaronjen...@gmail.com wrote: Yeah, we've run into this same trouble as well. It would be nice if there was a hook to handle this built intoAutocomplete. On Mon, Jan 26, 2009 at 3:18 AM, Styx pawel.chuchm...@gmail.com wrote: It dosen't work. For example: I use tab key to navigate. If focus is set to input, id will be empty. If I don't want change my input, id also shouldn't be change. IAnother example: If my result work and set id properly, if I keypress shift or ctrl, id field will be cleared. On 24 Sty, 00:20, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: You could add another keyup-event-handler to the input field, and clear the id field. As long as that runs before the result-handler is setting the data, it should give you the result you need. Jörn On Fri, Jan 23, 2009 at 5:09 PM, Styx pawel.chuchm...@gmail.com wrote: Hi. I have two fileds. For exmple: $(#name).autocomplete('seatch.php'); $(#id).result(function(event, data, formatted) { if (data) { $(#id).val(data[1]); } If i select sometfing inautocompletefield, my id field will have id of this item. After submit I have two fields - one wieth name, and one with id. I can for example update dabase use id. But if I write inautocompletesomethig, which isn't in result, my function isn't triggered. If i edit existing data, after submit I have field id with some value, and filed name with new value. I don't know, that I shoul
[jQuery] Re: jQuery AutoComplete - how to post a variable if option is selected?
Solved my own problem. See solution here: http://groups.google.com/group/jquery-en/msg/89adfbd3e15fde09 on discussion: http://groups.google.com/group/jquery-en/browse_thread/thread/84950b404129b00b On Feb 6, 10:29 am, Han hgc...@gmail.com wrote: James, that problem that you just described is the exact problem that I am having. I can get the autocomplete plugin to update a hidden input with an id value perfectly fine if the user selects a value from the list and triggers the result() function, however I also need it to clear the hidden input in every other case. Do you know how to accomplish this, or what part of the autocomplete plugin code might be relevant if I were to add something in? Thanks. On Feb 3, 6:00 pm, James james.gp@gmail.com wrote: One way I can think of is that you make a JSON list that has an id and name pair. When an existing option is selected, using theAutocomplete'sresult() function, add the id's value to some JS variable. (result() function:http://docs.jquery.com/Plugins/Autocomplete/result#handler) If it's typed in, the variable won't be set (because the result() function would not be triggered). Then when the form is submitted, use the extraParams option to pass the id value of that JS variable. You'd probably want to find a way to clear that JS variable also (probably through a typing event). There might be the possibility that someone selects from a list, the variable gets set, and decides to type his own name. But the variable is still set, which is incorrect. On Feb 3, 12:19 pm, ripcurlksm kevin.mccorm...@cox.net wrote: I am using a jQueryAutoCompleteplugin which fills in text as you type. I need to find a way when the page is submitted (submit.php) to determine if the user choose a company from the list, or if they typed in their own unique company. If an option is selected, can i have jQuery post an extra $_POST variable like new or existing so I can pick it up on the submit.php page? Or when an option is selected, can I have .js write a hidden tag which contains the variable existing? Example: [url]http://www.psylicyde.com/_old/autocomplete/[/url] Source Code: [url]http://www.psylicyde.com/_old/autocomplete/autocomplete.zip[/url] The end goal here is to post a variable on the next page if the user selected an option from theautocompletelist. -- View this message in context:http://www.nabble.com/jQuery-AutoComplete---how-to-post-a-variable-if... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: jqURL plugin throwing JS errors
Andy - that's my plugin - do you have a link I could look at? -- Josh _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Andy Matthews Sent: Friday, February 06, 2009 9:50 AM To: jquery-en@googlegroups.com Subject: [jQuery] jqURL plugin throwing JS errors Is there anyone using the jqURL plugin who has noticed errors on page load? All of a sudden I've noticed the following error: Permission denied to get property XULElement.accessibleType, line 139 'width=' + args.w + ',height=' + arg...eft=' + args.l + ',scrollbars,resizable' The implementation: // open the media library in a new window $.jqURL.loc( dspPhotoAdministration.cfm?category=4process=admincouponSelect=true,{ w:750, h:750, target:'imageSelect' }); It's tied to the click event on an IMG tag, and event still works...I'm just getting tired of seeing the error. Andy Matthews Senior Web Developer OLE Object: Picture (Metafile) www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com. attachment: winmail.dat
[jQuery] Re: JQuery effects not working in Internet Explorer 6
I'm finding that it comes from the (packed) Validation plug-in script. I think it might need a semi-colon at the end of that whole packed string. Try adding that manually and see if it makes a differences. Try the min version also if you haven't. On Feb 6, 6:30 am, Tintin81 tkleem...@gmail.com wrote: Hi Henry, Thanks you very much for your help. I have eradicated the comma and also did some other polishing work, but nothing has changed :-( The error message I am getting in Internet Explorer 6 is still the same. What bugs me is that Internet Explorer doesn't tell me the exact name of the file that the error comes from. It is constantly referring to a missing semicolon, but I can't figure out where that might be. Not even in which file... Can anybody come to the rescue? Thanks for any help in this matter... On Feb 6, 12:40 pm, Henry rcornf...@raindrop.co.uk wrote: On Feb 6, 10:30 am, Tintin81 wrote: I am new to Javascript and implemented a few nice JQuery features on a href=http://new.designbits.de;my new website/a . All of them work great in Firefox and Safari. In IE6, however, the site looks like a mess, even with Javascript enabled in the options panel. snip There are two JScript errors reported as that page loads in IE. The first is a complaint about a missing ';' (and you will have to track down yourself), the second is in your functions.js file where you have:- $.extend($.validator.messages, { required: , email: , }); - in which an object literal's contents end in a comma. This is a syntax error by ECMAScript rules, and so should be expected to be a syntax error in browsers that implement the ECMAScript standard (such as JScript in IE (more or less)). The ECMA standard allows syntax extension and JavaScript(tm) (and good JavaScript(tm) imitators) take advantage of that to be more tolerant of commas at the end of object literal contents than they need to be (as the extra commas do not result in ambiguities). JScript doesn't and so sees the comma as a syntax error, and so that is a very likely cause of differences in behaviour between IE and other browsers. Particularly if the behaviour on IE looks like total failure to act on a script.
[jQuery] Re: All is well except in IE - links initially not clickable
Could I get some help on this please? Thank you, Precar. On Jan 30, 8:52 am, precar pranshua...@gmail.com wrote: Hi, Yes, I'm using the bind() method with 'click'. Is that the correct approach? Precar. On Jan 28, 9:47 am, amuhlou amysch...@gmail.com wrote: It looks like it's not appending the selected class to the li onClick in IE7. Are you using the bind() method to apply the click functionality? On Jan 28, 10:34 am, precar pranshua...@gmail.com wrote: Hi, My site (http://pthesis.com) works fine in Firefox/Opera/Safari, but inIE7 there is a small hitch. Sometimes when I click the portfolio link and open it, the links to the sites in the left column aren't clickable. If I close it and re-open it, they work, and if I do Refine by category and then click, they work. As I mentioned, this only happens inIE7. I've tested inIE8 beta 2 and it works fine. Does anyone have any suggestions for a workaround? If it would be helpful I'll post the page code here, or you may view it directly from the site. Thanks for your help, Precar.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: All is well except in IE - links initially not clickable
I've tried using Firebug for debugging but since there's nothing technically wrong in the script, I can't get much out of it. Is there a way to use Firebug for debugging something that's not broken but isn't functioning like you want it to? On Feb 6, 11:27 am, precar pranshua...@gmail.com wrote: Could I get some help on this please? Thank you, Precar. On Jan 30, 8:52 am, precar pranshua...@gmail.com wrote: Hi, Yes, I'm using the bind() method with 'click'. Is that the correct approach? Precar. On Jan 28, 9:47 am, amuhlou amysch...@gmail.com wrote: It looks like it's not appending the selected class to the li onClick in IE7. Are you using the bind() method to apply the click functionality? On Jan 28, 10:34 am, precar pranshua...@gmail.com wrote: Hi, My site (http://pthesis.com) works fine in Firefox/Opera/Safari, but inIE7 there is a small hitch. Sometimes when I click the portfolio link and open it, the links to the sites in the left column aren't clickable. If I close it and re-open it, they work, and if I do Refine by category and then click, they work. As I mentioned, this only happens inIE7. I've tested inIE8 beta 2 and it works fine. Does anyone have any suggestions for a workaround? If it would be helpful I'll post the page code here, or you may view it directly from the site. Thanks for your help, Precar.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Jquery plugin localisation nightmare
allRules appears to be a var (global?) inside the validationEngine function, not a property. Isn't it easier to just rewrite the whole validation js? On Feb 6, 12:46 pm, Karnius cedric.du...@gmail.com wrote: Hi guys, I got a plugin I want to do the localisation in french. I decided to go with a similar solution of the UI datepicker. Adding a french js and reparse my json object in french from there. But it just do not work and i don't have a clue how. Please help Live english version :http://www.position-relative.net/formValidator/test.html The core js : jQuery.fn.validationEngine = function(settings) { allRules = {required:{ // Add your regex rules here, you can take telephone as an example regex:none, alertText:* This field is required} } .. }; The French js: jQuery(function($){ $.validationEngine.allRules = {required:{ regex:none, alertText:* Ce champs est requis} } });
[jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' with Columns)
v0.6a is out http://www.nicolas.rudas.info/jQuery/Finder/ Following up on Nikola's idea, I've also made this: http://www.nicolas.rudas.info/jQuery/Finder/v0.6a/api.html The jQuery API, finder style. It's doesn't give any API docs tho at the moment, just a list of methods (the json data provided by jquery are a bit messy and a bit of a hussle to translate to html)
[jQuery] jMaps: Unable to continue, in need of new maintainer.
Hi folks, Unfortunately this has been on the cards for a while now. Due to an increase in my work schedule, and major move into Android application development I simply cannot afford the time to maintain this library any more. However I don't want to see the project die and I am looking for a maintainer or maintainers to take over the project and continue to improve it and fix any bugs. The maintainer would take control of this group and the google code repository. If you think you are up to the task, please email me off the list. Thanks, Tane Piper
[jQuery] Re: jqURL plugin throwing JS errors
Unfortunately it's in an administration area. I could provide some code for you though if that would help. andy _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Josh Nathanson Sent: Friday, February 06, 2009 12:10 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jqURL plugin throwing JS errors Andy - that's my plugin - do you have a link I could look at? -- Josh _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Andy Matthews Sent: Friday, February 06, 2009 9:50 AM To: jquery-en@googlegroups.com Subject: [jQuery] jqURL plugin throwing JS errors Is there anyone using the jqURL plugin who has noticed errors on page load? All of a sudden I've noticed the following error: Permission denied to get property XULElement.accessibleType, line 139 'width=' + args.w + ',height=' + arg...eft=' + args.l + ',scrollbars,resizable' The implementation: // open the media library in a new window $.jqURL.loc( dspPhotoAdministration.cfm?category=4process=admincouponSelect=true,{ w:750, h:750, target:'imageSelect' }); It's tied to the click event on an IMG tag, and event still works...I'm just getting tired of seeing the error. Andy Matthews Senior Web Developer OLE Object: Picture (Metafile) www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com. attachment: winmail.dat
[jQuery] $().jqGrid is not a function
Hi. I'm making my first attempt at utilizing JQGrid with a CGIDEV2 application. When loading the page, I keep getting an error that says $(#results').jqGrid is not a function. Here's my JS: $(document).ready(function() { var columnNames = ['Product Group','Description','Turnover Rate','Gross Margin','Rating']; var columnModel = [ {name:'productGroup',index:'order asc',width:70,align:center}, {name:'description',index:'job',width:200,sortable:false}, {name:'itemClass',index:'purchaseOrder',width: 150,sortable:false}]; var gridwidth = $('.tableContainer').width(); gridwidth = gridwidth-25; $(#results).jqGrid( { url: turnover2, datatype: json, mtype: 'GET', colNames: columnNames, colModel: columnModel, pager: jQuery('#pager2'), rowNum:20, rowList:0, imgpath:images/images, sortname:'Product Group', sortorder:desc, viewrecords:true, multiselect: true, width:gridwidth, height:'100%', loadComplete: function() { //$('#cb').prev().remove(); if($(#results).getGridParam(records)==0) { $('#noResults').dialog(open); } else { var page = $('#results').getGridParam(page); var records = $('#results').getGridParam(records); var recordsPP = $('#results').getGridParam(rowNum); var x = records/recordsPP; var returnArray = []; if(x page) { iterLimit = records%recordsPP; } else { iterLimit = recordsPP; } for(var i=1; i=iterLimit; i++) { $('#'+i).children('td:first').next().addClass('link'); var ord = $('#'+i).children('td:first').next().text(); returnArray = orderList.find(ord); var truefalse = typeof returnArray; if(truefalse != 'boolean') { $('#results').setSelection(i); } $('#'+i).children('td:first').next().click(function() { ord = $(this).text(); window.location.href = turnover2; }); } } }, shrinkToFit: true, jsonReader : { root: rows, page: page, total: total, records: records, repeatitems : false } }); }); Here's my HTML: div class=tableContainer div class=searchResults id=table table id=results class=scroll cellpadding=0 cellspacing=0 /table div id=pager2 class=scroll style=text- align:center;/div /div /div Does anyone know something for me to try here?
[jQuery] Re: list traversing
Just for the record, if you weren't able to modify the html, you could use my Text Children plugin, which, unlike .text(). isn't recursive: http://plugins.learningjquery.com/textchildren/ --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 5, 2009, at 5:01 PM, amazz...@gmail.com wrote: You know how sometimes you are working on a problem and you stare at it so long that the most obvious answers escape you until someone points it out and it is like a smack in the face? Yeah. Serious 'duh' moment on my part. Thanks. On Feb 5, 3:32 pm, MorningZ morni...@gmail.com wrote: Can you just make life REALLY easy on yourself and put the text in a span tag or something? ie/ ul lispanList Item1/span/li lispanList Item2/span ul liSub Item1/li liSub Item2/li /ul /li /ul then http://docs.jquery.com/Selectors/firstChild would make it a snap to get the text() On Feb 5, 3:00 pm, amazz...@gmail.com amazz...@gmail.com wrote: Hi, I'm trying to traverse a list that has some sub-lists nested, i.e. ul liList Item1/li liList Item2 ul liSub Item1/li liSub Item2/li /ul /li /ul I'm trying to grab the text of List Item2, but without the text of the sublist items. Right now if I use: $('ul li').text() -- it returns the text of the List Item and the text of any sub items. I'm thinking I may have to write a regular expression to filter out the sublist, but was wondering if jQuery could handle this? Any ideas appreciated. AM
[jQuery] Re: What is difference between ADO and RDO
sorry about that, folks. The user is now banned.. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 6, 2009, at 1:36 AM, Michael Geary wrote: And let me Google that for you: http://groups.google.com/groups?q=agile.scrapping%40gmail.com -Mike From: Charlie Griefer Sent: Thursday, February 05, 2009 9:00 PM On Thu, Feb 5, 2009 at 8:57 PM, Agile Consulting agile.scrapp...@gmail.com wrote: Explain ADO and RDO http://letmegooglethatforyou.com/?q=ado%20rdo -- I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: jqURL plugin throwing JS errors
Hey Andy - looks like this might be a Firebug bug - read down to the bottom of this link: http://code.google.com/p/fbug/issues/detail?id=581 -- Josh _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Andy Matthews Sent: Friday, February 06, 2009 11:01 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: jqURL plugin throwing JS errors Unfortunately it's in an administration area. I could provide some code for you though if that would help. andy _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Josh Nathanson Sent: Friday, February 06, 2009 12:10 PM To: jquery-en@googlegroups.com Subject:[jQuery] Re: jqURL plugin throwing JS errors Andy - that's my plugin - do you have a link I could look at? -- Josh _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Andy Matthews Sent: Friday, February 06, 2009 9:50 AM To: jquery-en@googlegroups.com Subject: [jQuery] jqURL plugin throwing JS errors Is there anyone using the jqURL plugin who has noticed errors on page load? All of a sudden I've noticed the following error: Permission denied to get property XULElement.accessibleType, line 139 'width=' + args.w + ',height=' + arg...eft=' + args.l + ',scrollbars,resizable' The implementation: // open the media library in a new window $.jqURL.loc( dspPhotoAdministration.cfm?category=4process=admincouponSelect=true,{ w:750, h:750, target:'imageSelect' }); It's tied to the click event on an IMG tag, and event still works...I'm just getting tired of seeing the error. Andy Matthews Senior Web Developer OLE Object: Picture (Metafile) www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com. attachment: winmail.dat
[jQuery] Re: Jquery plugin localisation nightmare
The easiest way to setup for localizations is to do local aliases for basically anything important. The idea is to have definition files (like localization.fr.js, localization.en.js) and abstracted variable names. For instance, you'd do things like: jQuery.fn[loc.validationEngine] = function(settings){ allRules = loc.allRules; } And in the localization files: // en.js loc = { validationEngine: 'validationEngine', allRules: {'required': {'regex': 'none', 'alertText': '* This field is required'}}; } // fr.js loc = { validationEngine: 'frenchForValidationEngine', allRules:{'frForRequired': {'frForRegex': 'frForNone', 'frForAlertText': '* Ce champs est requis'}}; } Working like that will allow you to create a fully localized plugin. If you just want to localize some output strings, and not the actual function names, the same sort of methodology applies. It all depends on how you limit your scope. Also, sorry about the frForRequired stuff. I don't speak a lick of french. :( On Feb 6, 1:49 pm, Ricardo Tomasi ricardob...@gmail.com wrote: allRules appears to be a var (global?) inside the validationEngine function, not a property. Isn't it easier to just rewrite the whole validation js? On Feb 6, 12:46 pm, Karnius cedric.du...@gmail.com wrote: Hi guys, I got a plugin I want to do the localisation in french. I decided to go with a similar solution of the UI datepicker. Adding a french js and reparse my json object in french from there. But it just do not work and i don't have a clue how. Please help Live english version :http://www.position-relative.net/formValidator/test.html The core js : jQuery.fn.validationEngine = function(settings) { allRules = {required:{ // Add your regex rules here, you can take telephone as an example regex:none, alertText:* This field is required} } .. }; The French js: jQuery(function($){ $.validationEngine.allRules = {required:{ regex:none, alertText:* Ce champs est requis} } });