[jQuery] Re: Dynamic Form Validation?
Jörn Zaefferer escribió: howa schrieb: Hello, anyone has idea how to do dynamic form validation? e.g. using http://bassistance.de/jquery-plugins/jquery-plugin-validation/ input name=t1 type=text / input name=t2 type=text / I only want to check for required field for t2 ONLY if t1 is equal to some value e.g. If t1 = test, then t2 cannot be null, else never mind abt t2 Try this: $(...).validate({ rules: { t2: { required: function(element) { return element.value == test } } } }); By passing a function as the argument to the required-rule you can specify whatever dependency you can think of. More examples can be found here: http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatormethodsrequiredStringElementBooleanStringFunction -- Jörn How I can see the correct code would be: $(#theform).validate({ rules:{ t2: { required: function(element){ return $(t1).value == test; } } } }); -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: Dynamic Form Validation?
Mario Moura escribió: Hi SeVir and Folks My form have a ajax button. Ajax button always is type=submit so I tested ValidationAide and Jquery Validation (bassistance.de http://bassistance.de) Both plugins have the following bad behavior. When I click in Ajax Button (value=Attach id=attach-button name=attach) both think that I am trying send the form and try validate. So My Ajax function cant work :( Can I bypass this? How can I hack this? Ideas? How can I say to Jquery Validation to validate id=edit-submit and not type=submit? Or how can exclude id=attach-button from Validation? Because $(#myform).validate(); already declared. My Form is: form enctype=multipart/form-data id=myform method=post action=/send/invoice input type=submit class=form-submit value=Attach id=attach-button name=attach/ input type=submit class=form-submit value=Submit id=edit-submit name=op/ /form Regards Mario Using any validation library, in your HTML example you can bypass the validation using this code: //inside document.ready $(#attach-button).click(function(){ $(#myform)[0].submit();//DOM submit trigger, not jQuery submit trigger return false; }); -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: Dynamically assigning validation rules with Validation plugin
voltron escribió: Hi all, I have a text input field declared to be used for searching a database. The users can search for a zipcode, city or company name based on what the choose using a radio button. How can I then dynamically assign different validation rules to the input field using Jörns Validation plugin? Thanks Maybe calling again to validate() method using the new rules?, also I suppose that if you use metadata rules, the rules are evaluated on submit, so you can insert the input fields dinamically with the rules inline the html code. -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: how to delay a event?
are u trying to achieve something like autocomplete (like google suggest), if that is the case, then you should look at http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ -GTG On 8/22/07, james_027 [EMAIL PROTECTED] wrote: hi, I have a small jQuery script, that get some data over the server on every keypress by the user, but I don't to perform such action every time when the user presses a key, specially if between key presses happens in short amount of time. How do I delay this event? Here is my script $('[EMAIL PROTECTED]').keyup(function(e){ if (e.target.value != ''){ $.get('/main/search_item/', {search_item:e.target.value }, function(data){ $('[EMAIL PROTECTED]').html(data); } ); } }); thanks james
[jQuery] Re: Updating metadata
I have found a solution to my problem and thought I'd share it in case I'm not the only one in this situation. First thing I did was to switch to an alternative way of storing metadata (using the data attribute) since using the class attribute was more dificult to parse / update when there were also CSS classes set for the same element. So my HTML looks something like this: li id=item_1 data={name:'first item', subitems_count:3}a href=#Update/a/li li id=item_2 data={name:'second item', subitems_count:7}a href=#Update/a/li When someone clicks a link the metadata is loaded into an object and any modifications are made on the object (in my case I make an ajax call to the server, get the new subitems_count and update the object). Now I'm using a JSON stringifier (thanks to Thomas Frank for this one, http://www.thomasfrank.se/json_stringify_revisited.html) to transform the object back into a JSON string. After that I'm using jQuery's attr(key, value) to reset the data attribute to the new string. Pretty easy but my noobiness prevented me from figuring it out earlier. Have a nice day!
[jQuery] Re: how to delay a event?
Hi, On Aug 23, 2:34 pm, Ganeshji Marwaha [EMAIL PROTECTED] wrote: are u trying to achieve something like autocomplete (like google suggest), if that is the case, then you should look athttp://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ -GTG No I am doing a auto complete here... THanks james
[jQuery] Re: how to delay a event?
sorry, am i missing something. -GTG On 8/22/07, james_027 [EMAIL PROTECTED] wrote: Hi, On Aug 23, 2:34 pm, Ganeshji Marwaha [EMAIL PROTECTED] wrote: are u trying to achieve something like autocomplete (like google suggest), if that is the case, then you should look athttp://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ -GTG No I am doing a auto complete here... THanks james
[jQuery] end(), this bug unknown
Hi all, recently I have read the slides published by John Resig about his first Google Tech Talk: http://ejohn.org/blog/building-a-javascript-library/ In the slide number 50 there is a little example code: $(div.section) .find(dt) .addClass(section) .onclick() .next().toogle().end() .end() .end() .find(dd) .hide() .filter(:first) .show() .end() .end(); In a first moment, I thought: ok, wait a moment, I need read this more slow. And later, I opened my mouth, and said wooowww!!!, Can I do that with jQuery?? This is the first example of end() method that I can see and, now, I see the power of the end() method. Thanks John and the jQuery team for open our eyes with each JavaScript experience ;-) -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: how to delay a event?
I think he wants to delay the keyup event but i don't think you can't delay that because it's the trigger for the actions. -- David Ganeshji Marwaha schreef: sorry, am i missing something. -GTG On 8/22/07, *james_027* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, On Aug 23, 2:34 pm, Ganeshji Marwaha [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: are u trying to achieve something like autocomplete (like google suggest), if that is the case, then you should look athttp://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ -GTG No I am doing a auto complete here... THanks james No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.12.1/965 - Release Date: 21/08/2007 16:02 -- David Duymelinck [EMAIL PROTECTED]
[jQuery] Re: how to delay a event?
Check out my response to this question when it came up back in March: http://www.mail-archive.com/[EMAIL PROTECTED]/msg18931.html Hope it helps. --Erik On 8/22/07, james_027 [EMAIL PROTECTED] wrote: hi, I have a small jQuery script, that get some data over the server on every keypress by the user, but I don't to perform such action every time when the user presses a key, specially if between key presses happens in short amount of time. How do I delay this event? Here is my script $('[EMAIL PROTECTED]').keyup(function(e){ if (e.target.value != ''){ $.get('/main/search_item/', {search_item:e.target.value}, function(data){ $('[EMAIL PROTECTED]').html(data); } ); } }); thanks james
[jQuery] Re: end(), this bug unknown
;-) No problem. I love .end(). Although, it should be noted that this snippet: .onclick() .next().toggle().end() .end() does not work - .onclick() doesn't exist (yet). That's something else that I'm working on so that you won't need to write all those annoying function(){ ... } anymore. We'll see if I can end up doing it in a way that doesn't cause a big complexity hit. So yeah, for right now this is completely valid: $(div.section) .find(dt) .addClass(section) .click(function(){ $(this).next().toggle().end() }) .end() .find(dd) .hide() .filter(:first) .show() .end() .end(); --John On 8/23/07, SeViR [EMAIL PROTECTED] wrote: Hi all, recently I have read the slides published by John Resig about his first Google Tech Talk: http://ejohn.org/blog/building-a-javascript-library/ In the slide number 50 there is a little example code: $(div.section) .find(dt) .addClass(section) .onclick() .next().toogle().end() .end() .end() .find(dd) .hide() .filter(:first) .show() .end() .end(); In a first moment, I thought: ok, wait a moment, I need read this more slow. And later, I opened my mouth, and said wooowww!!!, Can I do that with jQuery?? This is the first example of end() method that I can see and, now, I see the power of the end() method. Thanks John and the jQuery team for open our eyes with each JavaScript experience ;-) -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: end(), this big unknown
wops! I wrote bug instead of big :-P sorry for this confussion. -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: How to have multiple repeating forms with different targets on the same page using ajaxform plugin
When you just pass a selector string as the target, the Form plugin literally uses that selector (with no additional context) to assign the returned value, eg. 214$(options.target).attr(innerHTML, data).evalScripts().each(oldSuccess, [data, status]); target will take a selector string, a jQuery object, or a DOM element so you could try... $(document).ready(function() { var options = { target:false, beforeSubmit: showRequest, success: showResponse }; $('.form_addresses_edit').each(function(){ options.target = $('.address_edit_display', this); $(this).ajaxForm(options); }); }); GM-6 wrote: I have searched all over and tried many different things for a solution to my problem. I'm hoping that someone here can help. I am trying to have 1 to 20 forms on one page - they are all basically the same form. It gets repeated 1 to 20 times depending on how many different addresses are available. I am using the ajaxForm plugin. When I submit the form, the target field (.address_edit_display) is updated with the response from the server. BUT it is updated for all of the address_edit_display divs. I only want it to update the address_edit_display div above that corresponds to the address_edit_modify div below (which contains the form). I understand is is probably becuase I am using .address_edit_display as the target div - which is used multiple times. Does anyone know how I can only update the preceeding address_edit_display div with the server response? Thanks My code is below: javascript: $(document).ready(function() { var options = { target:'.address_edit_display', beforeSubmit: showRequest, success: showResponse }; $('.form_addresses_edit').ajaxForm(options); }) html: /// START: the following code gets repeated 1-20 times depending on how different types of addresses there are /// div class=address_edit_display /div div class=address_edit_modify form action=http://www.mysite.com/ajax_submit_addresses; method=post class=form_addresses_edit input type=hidden name=AddressID/ input type=text name=AddressType/ input type=text name=Address/ input type=text name=City/ input type=text name=State/ input type=text name=ZipCode/ input type=submit name=mysubmit value=Make Changes / /form /div /// END: repeating code /// -- View this message in context: http://www.nabble.com/How-to-have-multiple-repeating-forms-with-different-targets-on-the-same-page-using-ajaxform-plugin-tf4314034s15494.html#a12289000 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: end(), this bug unknown
Yep, sure thing. I personally like to include the extra .end() (especially when I'm writing long indented statements like that) just so that I can be sure that I have my closing ends. I just think of it as like a closing brace - always good to have, breeds good practices. (Especially for the time where .onclick() might return a statement that /requires/ a .end() to exist.) --John On 8/23/07, Wizzud [EMAIL PROTECTED] wrote: Very minor point, but since you only need to end() where you want to restore, and subsequently do something with, the original set of elements, the following is also valid... $(div.section) .find(dt) .addClass(section) .click(function(){ $(this).next().toggle(); }) .end() .find(dd) .hide() .filter(:first) .show(); John Resig wrote: ;-) No problem. I love .end(). Although, it should be noted that this snippet: .onclick() .next().toggle().end() .end() does not work - .onclick() doesn't exist (yet). That's something else that I'm working on so that you won't need to write all those annoying function(){ ... } anymore. We'll see if I can end up doing it in a way that doesn't cause a big complexity hit. So yeah, for right now this is completely valid: $(div.section) .find(dt) .addClass(section) .click(function(){ $(this).next().toggle().end() }) .end() .find(dd) .hide() .filter(:first) .show() .end() .end(); --John On 8/23/07, SeViR [EMAIL PROTECTED] wrote: Hi all, recently I have read the slides published by John Resig about his first Google Tech Talk: http://ejohn.org/blog/building-a-javascript-library/ In the slide number 50 there is a little example code: $(div.section) .find(dt) .addClass(section) .onclick() .next().toogle().end() .end() .end() .find(dd) .hide() .filter(:first) .show() .end() .end(); In a first moment, I thought: ok, wait a moment, I need read this more slow. And later, I opened my mouth, and said wooowww!!!, Can I do that with jQuery?? This is the first example of end() method that I can see and, now, I see the power of the end() method. Thanks John and the jQuery team for open our eyes with each JavaScript experience ;-) -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain -- View this message in context: http://www.nabble.com/end%28%29%2C-this-bug-unknown-tf4315861s15494.html#a12289057 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: jQuery and Mootools Problem
Hi, i have same problem.. and i already try include mootools before jQuery and then .noConflict() And this problem with mootools is not recognized as a bug by mootools developer :( All the best Carlos On Aug 22, 5:59 pm, John Resig [EMAIL PROTECTED] wrote: Try includingMootools, then jQuery, then doing the .noConflict() stuff and see if that works. --John On 8/22/07, kj187 [EMAIL PROTECTED] wrote: Hi, i use jquery and mootools. But i have a problem, after loading the site, i became an js error this.$events[type].keys has no properties mootools.v1.11.js Line 2878 Here is a screenshot:http://gfx.kj187.de/jqueryMootoolsProblem.tiff Has anybody an idea ?? regards kj187 (julian)
[jQuery] Interface scrollTo - needing callback functionality (attn Stefan)
According tot he documentation on the Interface website the scrollTo method should support callback functions. I am not sure if it does, upon looking at the source. From Stefan's website: durationinteger or string mandatory callbackfunction optional Callback function that will get fired once the effect is completed. easing string optional The name of the easing effect you want to use. I am seeking to run the scrollTo function first - in the following scenario: scrollTo to top of page (500ms) fadeOut page container (500ms) ajax call ajax method to load new content (CMS server request) FadeIn page container with new content (500ms) Has anybody managed to get the callback to file after the scrollTo is completed? I am not sure of the syntax - have tried several schemes - I have tried: several tests - trying to trigger a simple alert function - as the basis of connecting it to the fadeOut Ajax fadeIn function which is working function alertMe(){ alert(finished); } this does not trigger alertMe() upon completion: function scrollToTopAnchor(){ $(#top).ScrollTo(1000,'easeinout',function() { alertMe(); }); } this triggers alertMe() before completion: $('#top').ScrollTo(1000,'easeinout',alertMe()); Since I am more a designer than a coder, any suggestions (or workarounds) would be appreciated. cheers (-john-)
[jQuery] Re: Couple of Bugs, css + jquery
I'd say the layout problem is the use of min-height and min-width css attributes, which IE6 does not understand. VP
[jQuery] Re: end(), this bug unknown
In the slide number 50 there is a little example code: $(div.section) .find(dt) .addClass(section) .onclick() .next().toogle().end() .end() .end() .find(dd) .hide() .filter(:first) .show() .end() .end(); In a first moment, I thought: ok, wait a moment, I need read this more slow. And later, I opened my mouth, and said wooowww!!!, Can I do that with jQuery?? This is exactly the same reaction I had! This is the first example of end() method that I can see and, now, I see the power of the end() method. I still don't fully understand how to use it through, maybe a nice tutorial should be written... -Nicolas -- Nicolas Brush HOIZEY Clever Age : http://www.clever-age.com/ Gastero Prod : http://www.gasteroprod.com/ Photos : http://www.flickr.com/gp/[EMAIL PROTECTED]/M1c002
[jQuery] how do iterate through array of JQery objects
I'm having problems iterating through an array of JQuery objects. Here's my code: var x = $(#skip a); for (var i=0;ia.length;i++){ var n = x[i]; $(n).click(function(){ $(n.hash).hide(); $(#primary h1).after( $(n.hash)[0] ); $(n.hash).fadeIn(slow); return false; }); } x=$(skip a) is an array of links which have named anchors for their href. I want each link to not jump to the named anchor, but to dynamically change the page layout by moving the named anchor to a new area of the page. But each link moves the same named anchor. what am I doing wrong?
[jQuery] Form Plugin - How to repopulate fields with updated data?
Hi All, I'm using the Form plugin to submit data to a processing page and upon success, show a notification to the user. My form has 6 fields, one text and 5 textarea. When the form is initially filled out and submitted the user sees a div get updated for confirmation. Now if the user changes any of the fields and submits, they get the confirmation but the changed fields revert back to the data they were showing before the update. I'd like to repopulate the fields with the updated data if possible. My code: $(document).ready(function() { var options = { target: '#resultDiv', resetForm: true }; $('#frmTop5').ajaxForm(options); }); Server code is just an update query with a static div that gets returned to the calling page if the query is successful. Thx! Mike
[jQuery] Re: Select box help from ajax
thnx sir for ur help ...can u provide me plugin for that purpose On 8/22/07, Wizzud [EMAIL PROTECTED] wrote: First off, you need to read this http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax tutorial by Jorn Zaefferer, particularly the bit the starts 'A very common problem encountered...' about half way down. Having read that... You either need to look into the Behaviors plugin - which will automatically attach existing events to any new (and appropriate) elements loaded - or you need to include event assignment for the new selects in your callback. Muhammad Mohsin wrote: Hello I want to associate a select box coming from ajax to change function of form which is defined in the page. Can anyone help me $('#frmNewDev select').each(function() { $(this).change(function() { if(this.id != sl_developer) { var load_image = http://; + this_domain + /images/ common/loading.gif ; //$('#nn').html(load_image); $.get('http://' + this_domain + '/cp/ajax_cp_locality.php', {cat_id: this.value}, function(str) {$(#nn).append(str);}); return false; } }); }); I m using above code for associate all select box with this function but select which are coming from ajax page are not associatedhow can I associate that select box with this function. thnx -- View this message in context: http://www.nabble.com/Select-box-help-from-ajax-tf4311393s15494.html#a12277377 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: bind/unbind leak
The nightly build, compressed and uncompressed, do not suffer from the leak. Thanks, Austin On Aug 22, 2:58 pm, Brandon Aaron [EMAIL PROTECTED] wrote: Would you mind testing with the latest nightlies to see if this issue is fixed in the up coming 1.1.4 release?http://code.jquery.com/jquery-nightly.jshttp://code.jquery.com/jquery-nightly.pack.js -- Brandon Aaron On 8/22/07, abarton [EMAIL PROTECTED] wrote: The following code when ran in IE6 (not sure about 7) will produce some kind of leak. It can be identified by bringing up 'Windows Task Manager' and viewing the CPU Usage History. The CPU hits slowly increase over time. (Link against jquery-1.1.3.1.pack.js) Is there an error in my code? html head script language=javascript src=jquery.js/script script language=javascript var timerTask; $(document).ready(function() { timerTask = window.setTimeout( callback, 500 ); }); function callback() { $( 'a' ).each( function( index ) { $( this ).unbind( 'click' ).click( 'linkClicked' ); this.onclick = null; }); window.clearTimeout( timerTask ); timerTask = window.setTimeout( callback, 500 ); } /script /head div id=count /div div id=testing a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ /div /html
[jQuery] Re: bind/unbind leak
Last post didn't go through. The nightly build does not suffer from the problem in both cases, compressed and uncompressed. On Aug 22, 2:58 pm, Brandon Aaron [EMAIL PROTECTED] wrote: Would you mind testing with the latest nightlies to see if this issue is fixed in the up coming 1.1.4 release?http://code.jquery.com/jquery-nightly.jshttp://code.jquery.com/jquery-nightly.pack.js -- Brandon Aaron On 8/22/07, abarton [EMAIL PROTECTED] wrote: The following code when ran in IE6 (not sure about 7) will produce some kind of leak. It can be identified by bringing up 'Windows Task Manager' and viewing the CPU Usage History. The CPU hits slowly increase over time. (Link against jquery-1.1.3.1.pack.js) Is there an error in my code? html head script language=javascript src=jquery.js/script script language=javascript var timerTask; $(document).ready(function() { timerTask = window.setTimeout( callback, 500 ); }); function callback() { $( 'a' ).each( function( index ) { $( this ).unbind( 'click' ).click( 'linkClicked' ); this.onclick = null; }); window.clearTimeout( timerTask ); timerTask = window.setTimeout( callback, 500 ); } /script /head div id=count /div div id=testing a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ a href=testing.htmlTest/abr/ /div /html
[jQuery] jQuery in the wild
jQuery does some animation on this site... simple but effective. http://www.dmdirectmail.com (warning: heavy image content -- it is a kind of portfolio site!)
[jQuery] Extra code for re-instantiating interface:imagebox -- after ajax load methods
I just wanted to post this information, related to interfaceimagebox usage - it is a really great plugin, btw! I spent a wee bit of time trying to debug FF issues - related to loading imagebox html using jquery's ajax methods. Seems it stalled after first click - that is when clicking second image of hml loaded via ajax the script stalled. -- subsequent clicks did not load image... I perused these and other forums - with no answer. What I discovered is the need to remove residual imagebox divs and then re-instantiate Imagebox itself my problem code for FF was: function initAjaxImageBox(){ $.ImageBox.init( { loaderSRC: 'img/imagebox/loading.gif', closeHTML: 'img src=img/imagebox/close.gif / border=0', // etc } ); } the solution code is: function initAjaxImageBox(){ $(#ImageBoxOverlay).remove(); $(#ImageBoxOuterContainer).remove(); $.ImageBox.init( { loaderSRC: 'img/imagebox/loading.gif', closeHTML: 'img src=img/imagebox/close.gif / border=0', // etc } ); } initAjaxImageBox is called within an ajax method (on success) i hope this helps others just posting this for general info. cheers (-john-)
[jQuery] Re: jQuery and Mootools Problem
It looks like Mootools is also using the $events expando, but differently... it expects it to be an object that can have a keys attribute. -- Yehuda On 8/22/07, Sekmet [EMAIL PROTECTED] wrote: Hi, i have same problem.. and i already try include mootools before jQuery and then .noConflict() And this problem with mootools is not recognized as a bug by mootools developer :( All the best Carlos On Aug 22, 5:59 pm, John Resig [EMAIL PROTECTED] wrote: Try includingMootools, then jQuery, then doing the .noConflict() stuff and see if that works. --John On 8/22/07, kj187 [EMAIL PROTECTED] wrote: Hi, i use jquery and mootools. But i have a problem, after loading the site, i became an js error this.$events[type].keys has no properties mootools.v1.11.js Line 2878 Here is a screenshot:http://gfx.kj187.de/jqueryMootoolsProblem.tiff Has anybody an idea ?? regards kj187 (julian) -- Yehuda Katz Web Developer | Procore Technologies (ph) 718.877.1325
[jQuery] Re: Karl, cluetip questions: Select IE6 bug ETA, and incorporating JTIP?
On Aug 23, 1:03 am, Karl Swedberg [EMAIL PROTECTED] wrote: I like jTip for all the same reasons, I really like the arrow, and wish Karl's had it It does have it if you set the option for it. See my reply to Kim. snip FWIW, when I tried one of the svn version, the arrows option wasn't obeying; the arrow was coming only if we use jTip class. Not sure, if it's still applicable. -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
[jQuery] Re: end(), this bug unknown
John Resig escribió: Yep, sure thing. I personally like to include the extra .end() (especially when I'm writing long indented statements like that) just so that I can be sure that I have my closing ends. I just think of it as like a closing brace - always good to have, breeds good practices. (Especially for the time where .onclick() might return a statement that /requires/ a .end() to exist.) --John I am writing some code using end() method and really, I don't see the time where .onclick() might return a statement that /requires/ a .end() to exist Some example?? -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: Developing for Opera
it's actually pretty easy to get everything to work in Opera I found the opposite to be the case. When applying certain Javascripts to a page, Opera suddenly loses styles. I couldn't really narrow it down specifically, but one case would be a script that changes the height of a page element, and all of a sudden, the font applied to the body is lost, rendering everthing in Times default font. After long attempts at trying to identify the source of the problem, I decided to do a if(!($.browser.opera)) { } Bernd
[jQuery] Re: [NEWS] Brandon Aaron on Ajaxian...AGAIN!
Rey Bango wrote: jQuery team member and JS superstar Brandon Aaron is all over the place these days and with good reason; his coding skills rock. Brandon's Live Query plugin made it to Ajaxian, Brandon's second mention on the premier Ajax blog! http://ajaxian.com/archives/jquery-live Great job Brandon! Rey... Congratulations Brandon! This is by far one of the greatest plugins I know. One question out of curiousity: Would it be possible to use DOM mutation events, like DOMSubtreeModified, DOMNodeInserted, DOMNodeRemoved? I don't even know which browser supports them. I could imagine that this would improve performance even more? Or is this a completely different story? --Klaus
[jQuery] [NEWS] Minglets - jQuery on the iPhone
Just read on Ajaxian that Minglets.com, a social chat app for the iPhone uses jQuery and YShout... http://ajaxian.com/archives/iphone-apps-facebook-and-minglets http://minglets.com/ I don't have an iPhone, so I couldn't see for myself. --Klaus
[jQuery] Re: Developing for Opera
On 8/23/07, Bernd Matzner [EMAIL PROTECTED] wrote: it's actually pretty easy to get everything to work in Opera I found the opposite to be the case. When applying certain Javascripts to a page, Opera suddenly loses styles. I couldn't really narrow it down specifically, but one case would be a script that changes the height of a page element, and all of a sudden, the font applied to the body is lost, rendering everthing in Times default font. After long attempts at trying to identify the source of the problem, I decided to do a if(!($.browser.opera)) { } Bernd Hi Bernd, I think the unstyled content quirk can be avoided by ensuring that all CSS and links to same come before all your JavaScript links in the HTML source order. Have you tried that? In practice I find that, as long as you develop to web standards, Opera tends to just work without spending additional time on it. That said, you do occasionally need to use one standards compliant method over another to stay on the golden path of the cross-browser balancing act. Joel Birch.
[jQuery] $('tagname/') syntax in IE
In IE, $('div/') is ok but $('span/') always returns an empty set. It seems that tagname/ syntax is only ok for block elements. So it's safer to always use $('tagname/tagname') syntax for elements that requires a closing tag. -- Arrix
[jQuery] Rails: attaching js to a partial
Hi, Im currently using Jquery withing my rails project and im having the following issue. Once an option is clicked on the navigation bar a partial is loaded in to a container div. The same thing happens for each of these options. When the partial is loaded in though I am unable to attach click events to the buttons within that partial because the partial doesnt actually pick up on the document.ready (obviously as it didnt exist when the document originally loaded). I'm aware that I can fire a function on the completion of the AJAX request which could possibly attach my clicks, but i would prefer to keep the javascripts for each partial separate and have them load in along with the partial. I've heard that there is an option called 'loadjs' out there. I cant find much documentation on it... could this be of use to me. so for example could i fire the ajax load and then on success load in a .js file by using this method? Cheers, Chris
[jQuery] jquery.media, plugin detection , flip4mac
Hi there, I am looking into the jquery.media plugin, however I need to be able to include multiple formats into the one page, and then make them switchable with links, ie we will have videos in both flash and windows media. The problem here is , there doesnt seem to be any detection features and display an error if the plugin is missing, it doesnt detect for flip4mac and display that instead of the windows media plugin, and then it also doesnt seem to support the express installer for the flash installer. Any ideas ?
[jQuery] Re: how to delay a event?
james_027 wrote: hi, I have a small jQuery script, that get some data over the server on every keypress by the user, but I don't to perform such action every time when the user presses a key, specially if between key presses happens in short amount of time. How do I delay this event? Here is my script $('[EMAIL PROTECTED]').keyup(function(e){ if (e.target.value != ''){ $.get('/main/search_item/', {search_item:e.target.value}, function(data){ $('[EMAIL PROTECTED]').html(data); } ); } }); thanks james var delayed; $('[EMAIL PROTECTED]').keyup(function() { clearTimeout(delayed); var value = this.value; if (value) { delayed = setTimeout(function() { $.get('/main/search_item/', { search_item: value }, function(data) { $('#search_item_result]').html(data); }); }, 400); } }); I've optimized a few things as well, like using the faster #id selector and using this instead of e.target... --Klaus
[jQuery] Re: how to delay a event?
Klaus Hartl wrote: var delayed; $('[EMAIL PROTECTED]').keyup(function() { clearTimeout(delayed); var value = this.value; if (value) { delayed = setTimeout(function() { $.get('/main/search_item/', { search_item: value }, function(data) { $('#search_item_result]').html(data); }); }, 400); } }); There's a typo, use $('#search_item_result').html(data); --Klaus
[jQuery] [NEWS] Comparison of different compressed jQuery Versions with GZip
Julien Lecomte has just released 1.1 of his YUI Compressor. As a test, he decided to use jQuery with GZip and came up with some interesting results compared to packer! http://www.julienlecomte.net/blog/2007/08/21/gzip-your-minified-javascript-files/ -- Tane Piper http://digitalspaghetti.me.uk This email is: [ x ] blogable [ ] ask first [ ] private
[jQuery] Animate scrollTop
I was wondering if the changes that allow animate scrollTop would be making it to the next release? e.g. http://dev.jquery.com/~john/ticket/step/test2.html
[jQuery] Re: Dynamic Form Validation?
Hi SeVir and Jörn, Yes I was thinking about this tonight. I need avoid the click event. $(#attach-button).each(function(){ $(this).bind(click, function(){ $(#node-form)[0].submit(); return false; }); }); I tested your function but I can only click attach-button one time. The second click dont work.(I cant attach more files) I made a lot of variations. I was thinking insert another function to unbind the event or something like this. So I tried but dont work $(#attach-button).each(function(){ $(this).bind(click, function(){ $(#node-form)[0].submit( function() { $(#attach-button).unbind(); } ); return false; }); }); Ideas? Regards Mario 2007/8/23, SeViR [EMAIL PROTECTED]: Mario Moura escribió: Hi SeVir and Folks My form have a ajax button. Ajax button always is type=submit so I tested ValidationAide and Jquery Validation (bassistance.de http://bassistance.de) Both plugins have the following bad behavior. When I click in Ajax Button (value=Attach id=attach-button name=attach) both think that I am trying send the form and try validate. So My Ajax function cant work :( Can I bypass this? How can I hack this? Ideas? How can I say to Jquery Validation to validate id=edit-submit and not type=submit? Or how can exclude id=attach-button from Validation? Because $(#myform).validate(); already declared. My Form is: form enctype=multipart/form-data id=myform method=post action=/send/invoice input type=submit class=form-submit value=Attach id=attach-button name=attach/ input type=submit class=form-submit value=Submit id=edit-submit name=op/ /form Regards Mario Using any validation library, in your HTML example you can bypass the validation using this code: //inside document.ready $(#attach-button).click(function(){ $(#myform)[0].submit();//DOM submit trigger, not jQuery submit trigger return false; }); -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain -- Mário Alberto Chaves Moura [EMAIL PROTECTED] 31-9157-6000
[jQuery] Re: [NEWS] Brandon Aaron on Ajaxian...AGAIN!
Thank Klaus. Actually the jQuery architecture lends itself nicely to this plugin so that we don't have to worry about the DOM Mutation events. I think trying to wrap those events and make them cross browser would just add unnecessary complication. -- Brandon Aaron On 8/23/07, Klaus Hartl [EMAIL PROTECTED] wrote: Rey Bango wrote: jQuery team member and JS superstar Brandon Aaron is all over the place these days and with good reason; his coding skills rock. Brandon's Live Query plugin made it to Ajaxian, Brandon's second mention on the premier Ajax blog! http://ajaxian.com/archives/jquery-live Great job Brandon! Rey... Congratulations Brandon! This is by far one of the greatest plugins I know. One question out of curiousity: Would it be possible to use DOM mutation events, like DOMSubtreeModified, DOMNodeInserted, DOMNodeRemoved? I don't even know which browser supports them. I could imagine that this would improve performance even more? Or is this a completely different story? --Klaus
[jQuery] Re: jQuery and Mootools Problem
Time to namespace our expandos. -- Brandon Aaron On 8/23/07, Yehuda Katz [EMAIL PROTECTED] wrote: It looks like Mootools is also using the $events expando, but differently... it expects it to be an object that can have a keys attribute. -- Yehuda On 8/22/07, Sekmet [EMAIL PROTECTED] wrote: Hi, i have same problem.. and i already try include mootools before jQuery and then .noConflict() And this problem with mootools is not recognized as a bug by mootools developer :( All the best Carlos On Aug 22, 5:59 pm, John Resig [EMAIL PROTECTED] wrote: Try includingMootools, then jQuery, then doing the .noConflict() stuff and see if that works. --John On 8/22/07, kj187 [EMAIL PROTECTED] wrote: Hi, i use jquery and mootools. But i have a problem, after loading the site, i became an js error this.$events[type].keys has no properties mootools.v1.11.js Line 2878 Here is a screenshot: http://gfx.kj187.de/jqueryMootoolsProblem.tiff Has anybody an idea ?? regards kj187 (julian) -- Yehuda Katz Web Developer | Procore Technologies (ph) 718.877.1325
[jQuery] Re: how do iterate through array of JQery objects
On 8/22/07, Neal [EMAIL PROTECTED] wrote: I'm having problems iterating through an array of JQuery objects. Here's my code: var x = $(#skip a); for (var i=0;ia.length;i++){ var n = x[i]; $(n).click(function(){ $(n.hash).hide(); $(#primary h1).after( $(n.hash)[0] ); $(n.hash).fadeIn(slow); return false; }); } x=$(skip a) is an array of links which have named anchors for their href. I want each link to not jump to the named anchor, but to dynamically change the page layout by moving the named anchor to a new area of the page. But each link moves the same named anchor. what am I doing wrong? First, in your for loop, did you mean 'i x.length' instead of a.length? That's the only mention of 'a' I see. Assuming, you meant 'x', let's break this down a little. Your for loop can be replaced by .each, and 'this' refers to each DOMElement: $(#skip a).each(function(i) { var n = this; ... }); Since all you're doing inside .each is calling .click, .each can be replaced by .click (which will in turn call .each): $(#skip a).click(function() { var n = this; ... }) That should get us here: $(#skip a).click(function() { var toMove = $(this.hash); toMove.hide(); $(#primary h1).after(toMove); toMove.fadeIn(slow); return false; }); I assume .hash is an expando property on your anchor? Or maybe you want $(this).attr('href')? A little more slimming: $(#skip a).click(function() { $( $(this).attr('href') ).hide().insertAfter(#primary h1).fadeIn(slow); return false; }); The above code is tested and works assuming your named anchors have ids with the same value as name. - Richard
[jQuery] Re: Karl, cluetip questions: Select IE6 bug ETA, and incorporating JTIP?
On Aug 22, 2007, at 11:36 PM, Rey Bango wrote: @Karl: What I would suggest is that if the fx is left out, default to using show() as opposed to fadeIn() and then on line 340, change this line: $cluetip.hide()[defaults.fx.open](defaults.fx.openSpeed); to $cluetip.hide()[defaults.fx.open](defaults.fx.open != 'show' (defaults.fx.openSpeed)); so that way if the show is the selected effect, the box instantly appears and no speed method call is necessary. By doing this, I was able to achieve the same effect as Cody's jTip while still maintaining all of the cool and extensive functionality available in clueTip. The best of both worlds. thanks, Rey! You rock! I'll get those changes in the code for the next update. I think it was Glen Lipka who suggested using fadeIn() as a default. So, Glen, do you foresee any issues with changing the default to an immediate show, as long as the fadeIn is still available as an option? --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Comparison of different compressed jQuery Versions with GZip
Perhaps it should be part of the build process? So you can get packed, min'd and YUI'd versions of jQuery. On Aug 23, 12:43 pm, Tane Piper [EMAIL PROTECTED] wrote: Julien Lecomte has just released 1.1 of his YUI Compressor. As a test, he decided to use jQuery with GZip and came up with some interesting results compared to packer! http://www.julienlecomte.net/blog/2007/08/21/gzip-your-minified-javas... -- Tane Piperhttp://digitalspaghetti.me.uk This email is: [ x ] blogable [ ] ask first [ ] private
[jQuery] Place value of navigator.cookieEnabled into an object. Why won't this work?!?!?
I'm using Javascript to collect some information about the user's browser and setup to pass into an AJAX call. The goal is to load up a page, have this code run and submit this packet to a page in the background, then redirect the user. I've got this code: $(document).ready(function(){ var userInfo = {}; userInfo['v_cookies'] = navigator.cookieEnabled; // this line appears to throw an error alert(navigator.cookieEnabled); // this line works just fine. }); I can alert(navigator.cookieEnabled) just fine, but when I try to assign the value of navigator.cookieEnabled into this object I get what appears to be a jQuery error. Node cannot be inserted at the specified point in the hierarchy code: 3 http://localhost/browserdetect/jquery.js Line 11 Does anyone know what I can do to get around this? Alternately, is there a better, or more reliable way to check if the browser has cookiesEnabled? Andy Matthews Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/ attbe9de.bmp
[jQuery] Re: Need tips on how i can optimize the scripts on this page...
Hi Trinodia, I'm afraid you're unlikely to get any responses from that - there're always people on this list who will help you with debugging, but you have to help us. Posting a link and asking people to play around and find the problems themselves will rarely result in what you want. I did just visit, but a minute of clicking things yielded no error for me, so I have given up. What are the errors you're receiving? Have you tried debugging? --rob On 8/22/07, Trinodia [EMAIL PROTECTED] wrote: Hi all! Just have gotten my head into the jQuery stuff and while updating the companys website this summer i have now run into some problems. The scripts on the page causes an error message to pop up from time to time (mostly on IE6 but also in IE7 and in Firefox). Any tips on how i can get these errors to, if not disapear completly atleast lower in amount of times... The website is located at http://www.restaurangguiden.com ... the content is in Swedish so to try it out, click on any of the graphic buttons to the right, Välj ort on the left or A till Ö on the left. The english version does not have large enough pages to cause the error from what i can tell. Thanks in advance! //Trinodia -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Karl, cluetip questions: Select IE6 bug ETA, and incorporating JTIP?
Karl, if it poses any issues, you can just ensure that you document show as the option for immediate display and no effects. Rey... Karl Swedberg wrote: On Aug 22, 2007, at 11:36 PM, Rey Bango wrote: @Karl: What I would suggest is that if the fx is left out, default to using show() as opposed to fadeIn() and then on line 340, change this line: $cluetip.hide()[defaults.fx.open](defaults.fx.openSpeed); to $cluetip.hide()[defaults.fx.open](defaults.fx.open != 'show' (defaults.fx.openSpeed)); so that way if the show is the selected effect, the box instantly appears and no speed method call is necessary. By doing this, I was able to achieve the same effect as Cody's jTip while still maintaining all of the cool and extensive functionality available in clueTip. The best of both worlds. thanks, Rey! You rock! I'll get those changes in the code for the next update. I think it was Glen Lipka who suggested using fadeIn() as a default. So, Glen, do you foresee any issues with changing the default to an immediate show, as long as the fadeIn is still available as an option? --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Can someone explain this string behavior?
I think I have a theory about why this is happen and it might not be jQuery related but just Javascript, but maybe someone can explain this because it is so odd. This is the code: logln(wcError +IsHidden('wcError')?hidden:not hidden); logln() is a function tha basically appends text to a log window. However, I don't see wcError hidden or wcError not hidden but rather: hidden or not hidden in other words, the left side string wcError is not concentated. But the following works: s = IsHidden('wcError')?hidden:not hidden logln(wcError +s); or this by enclosing it with () logln(wcError +(IsHidden('wcError')?:not )+hidden); but not this (without parenthesis) logln(wcError +IsHidden('wcError')?:not +hidden); IsHidden() just returns true or false function IsHidden(s) { var e = document.getElementById(s); return !e?true:e.style.display != block; } Anyway, logln() was first a jQuery method for my plugin and in trying to see what is going I am made it strictly DOM so I see it isn't jQuery related. What am I missing here? Something about how JS sees strings that I am missing here. In the same vain, I now see it is similar to a fix I had to make in another project where I had a table paging logic: function $(v) { return(document.getElementById(v)); } function gotoPrevPage() { $(start).value -= 1*$(rows).value;// - WORKS AS EXPECTED } function gotoNextPageBUG() { $(start).value += 1*$(rows).value; // - BUG!! } function gotoNextPageFIX() { $(start).value -= -1*$(rows).value; // - FIX!! } I was multiplying by 1 to help JS type cast the operaton. But that didn't work went using the inclusive += operatoin. Worked fine with -= operation. So I used the reverse logic to multiply by -1 instead with -=. To me, that looks look like a JS bug? No? --- HLS
[jQuery] OT: Is this a Javascript bug?
I posted this as a subtopic in another message, http://groups.google.com/group/jquery-en/browse_thread/thread/f54857cfb9e24dd9/fa98fe39cc523699#fa98fe39cc523699 but I now see that probably is a separate JS issue that the purist here might appreciate. Not to long ago, I came across JS behavior and just noted it down. The issue in the reference link above reminded me of this. This code is basically part of First, Prev, Next, Last, table navigator for our ad hoc report/table generator. It is pre-jQuery work. So here I am using the $() function to get the element. function $(v) { return(document.getElementById(v)); } function gotoPrevPage() { $(start).value -= 1*$(rows).value;// - WORKS AS EXPECTED } function gotoNextPageBUG() { $(start).value += 1*$(rows).value; // - BUG!! } function gotoNextPageFIX() { $(start).value -= -1*$(rows).value; // - FIX!! } I was multiplying by 1 to help JS type cast the operation to tell it that it adding or substracting a number rather than a string. If you remove the multiplier, JS will naturally concatentate strings. But that didn't work for the gotoNextPage() function using the inclusive += operation. It worked fine with -= operation in gotoPrevPage(). So I used the reverse logic to multiply by -1 instead with -= and it worked. To me, that looks look like a JS type casting bug or inclusive addition bug? What say you? -- HLS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: [NEWS] Comparison of different compressed jQuery Versions with GZip
Simply amazing! 10k gzipped! Tane Piper wrote: Julien Lecomte has just released 1.1 of his YUI Compressor. As a test, he decided to use jQuery with GZip and came up with some interesting results compared to packer! http://www.julienlecomte.net/blog/2007/08/21/gzip-your-minified-javascript-files/
[jQuery] Re: Can someone explain this string behavior?
Pops wrote: I think I have a theory about why this is happen and it might not be jQuery related but just Javascript, but maybe someone can explain this because it is so odd. This is the code: logln(wcError +IsHidden('wcError')?hidden:not hidden); logln() is a function tha basically appends text to a log window. However, I don't see wcError hidden or wcError not hidden but rather: hidden or not hidden in other words, the left side string wcError is not concentated. But the following works: s = IsHidden('wcError')?hidden:not hidden logln(wcError +s); or this by enclosing it with () logln(wcError +(IsHidden('wcError')?:not )+hidden); but not this (without parenthesis) logln(wcError +IsHidden('wcError')?:not +hidden); IsHidden() just returns true or false function IsHidden(s) { var e = document.getElementById(s); return !e?true:e.style.display != block; } Anyway, logln() was first a jQuery method for my plugin and in trying to see what is going I am made it strictly DOM so I see it isn't jQuery related. What am I missing here? Something about how JS sees strings that I am missing here. That is a matter of operator precedence. The plus operator has higher precedence than the conditional operator, thus wcError +IsHidden('wcError') gets evaluated first, afterwards the ?: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operators:Operator_Precedence --Klaus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: [NEWS] Comparison of different compressed jQuery Versions with GZip
I've just tried it with the latest nightly: jQuery 1.4(a2) Uncompressed: 4 bytes jQuery 1.4(a2) Minified: 37709 bytes jQuery 1.4(a2) Min + GZip: 11989 bytes On 8/23/07, Rey Bango [EMAIL PROTECTED] wrote: Simply amazing! 10k gzipped! Tane Piper wrote: Julien Lecomte has just released 1.1 of his YUI Compressor. As a test, he decided to use jQuery with GZip and came up with some interesting results compared to packer! http://www.julienlecomte.net/blog/2007/08/21/gzip-your-minified-javascript-files/ -- Tane Piper http://digitalspaghetti.me.uk This email is: [ ] blogable [ x ] ask first [ ] private
[jQuery] Re: Can someone explain this string behavior?
On Aug 23, 9:36 am, Klaus Hartl [EMAIL PROTECTED] wrote: That is a matter of operator precedence. The plus operator has higher precedence than the conditional operator, thus wcError +IsHidden('wcError') gets evaluated first, afterwards the ?: Ahh! That didn't hit me. Wonderful... Thanks for the link. Can you explain the other post regarding the presumed JS bug? PutElementValue(v2) += 1*GetElementValue(v1); with a fix is done using a negation? PutElementValue(v2) -= -1*GetElementValue(v1); -- HLS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: Dynamic Form Validation?
Mario Moura schrieb: Yes I was thinking about this tonight. I need avoid the click event. $(#attach-button).each(function(){ ... each ID are FALSE ;) ID are uniq!!! try so: $(.attach-button).each(function(){ And give a Class -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de www.akitafreund.de ---
[jQuery] Re: Can someone explain this string behavior?
Pops wrote: On Aug 23, 9:36 am, Klaus Hartl [EMAIL PROTECTED] wrote: That is a matter of operator precedence. The plus operator has higher precedence than the conditional operator, thus wcError +IsHidden('wcError') gets evaluated first, afterwards the ?: Ahh! That didn't hit me. Wonderful... Thanks for the link. Can you explain the other post regarding the presumed JS bug? PutElementValue(v2) += 1*GetElementValue(v1); with a fix is done using a negation? PutElementValue(v2) -= -1*GetElementValue(v1); No, I can't tell. A quick test on the Firebug console gave expected results: var x = 1 x += 1 * '4' 5 --Klaus
[jQuery] Re: event-binding
link is down i need that plugin On Jul 14, 6:04 am, Brandon Aaron [EMAIL PROTECTED] wrote: Yay another happy user of behavior! :) -- Brandon Aaron On 7/13/07, kaimeder [EMAIL PROTECTED] wrote: There is a plugin called Behavior that does this. I think its:http://brandonaaron.net/jquery/plugins/behavior/ Or check the plugin repository. works like a charm. thanks alot!
[jQuery] Re: Interface scrollTo - needing callback functionality (attn Stefan)
In the meantime - managed to use the setTimeout method - as a workaround function ajax_getPage(param1,param2){ jQuery.noConflict(); jQuery('#top').ScrollTo(900, 'easeinout'); setTimeout( function() { jQuery(#footer_wrapper).fadeOut(700); jQuery(#mainblock_760).fadeOut(700,function() { getAjax(param1,param2); }); }, 900 ); } I am guessing the documentation for scrollTo might need a wee bit of updating regarding callbacks - great plugin nonetheless!!! Along with JQuery ! cheers (-john-)
[jQuery] Re: Select box help from ajax
i am new to jquery and cann't figure out way to do it On 8/23/07, Muhammad Mohsin [EMAIL PROTECTED] wrote: thnx sir for ur help ...can u provide me plugin for that purpose On 8/22/07, Wizzud [EMAIL PROTECTED] wrote: First off, you need to read this http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax tutorial by Jorn Zaefferer, particularly the bit the starts 'A very common problem encountered...' about half way down. Having read that... You either need to look into the Behaviors plugin - which will automatically attach existing events to any new (and appropriate) elements loaded - or you need to include event assignment for the new selects in your callback. Muhammad Mohsin wrote: Hello I want to associate a select box coming from ajax to change function of form which is defined in the page. Can anyone help me $('#frmNewDev select').each(function() { $(this).change(function() { if(this.id != sl_developer) { var load_image = http://; + this_domain + /images/ common/loading.gif ; //$('#nn').html(load_image); $.get('http://' + this_domain + '/cp/ajax_cp_locality.php', {cat_id: this.value}, function(str) {$(#nn).append(str);}); return false; } }); }); I m using above code for associate all select box with this function but select which are coming from ajax page are not associatedhow can I associate that select box with this function. thnx -- View this message in context: http://www.nabble.com/Select-box-help-from-ajax-tf4311393s15494.html#a12277377 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: Interface scrollTo - needing callback functionality (attn Stefan)
I think that's a bug in the Interface code. I haven't found any calls to the callback function in their code anyway. Anders
[jQuery] use $getScript load .js multiple time
Dear Friend: I use $getScript to load some .js and include another html into my div code like $(#news1).bind(click,function(){ $.getScript(/admin_css/includeme0.js); $.get(/myadmin/query.xhtml?r=disw=chkandreplacepage=news,function(data){ $(#showhere).show(slow).html(data); }); }); it work fine !! but i use firebug to check it ...found includeme0.js load over and over again when use click any solution to solve this ? I use $getScript because i don't want the main html load too much .js Thanks !! Michael
[jQuery] Re: jCarousel infinite loop problem on Internet Explorer
Problem solved! It was due to my incorrect skin css initilization, that while still working in ff caused problems in ie. thorfinn On 22 Ago, 15:36, thorfinn [EMAIL PROTECTED] wrote: Hi, i've got a jcarousel implementation wich adds elements on runtime via the add function. While in ff it works as expected in ie seems like triggering some sort of javascript infinite loop... Is it a known problem? Is there a workaround? It looks like something connected with css width and height... but i'm very unsure about that Any hint will be greatly appreciated..! thanks in advance thorfinn
[jQuery] Re: Floating box that follows the user down the screen
Heh, Ok, well, the site is set out something like this: +--+ | | | | +--+---+ | |+-+| | ||Help || | ||Box || | |+-+| | | | | | | +--+---+ As the user scrolls down and the header box disappears into the aether, the help box should move up the screen in the position it's in, but as the sidebar in which it sits disappears out of the viewport the help box needs to start scrolling downwards, so it always sits within that sidebar, but moves up and down if the sidebar is at or out of the top of the screen. Does that make sense? Ben. On 8/22/07, Tamm Sjödin [EMAIL PROTECTED] wrote: what's wrong with a fixed position? :) $('p').css({position:'fixed',left:'50%',top:'50%'}); or perhaps you just need to make a more indepth description ^^ GL, Tamm On 8/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hiya, On part of a site I'm working on I want to add a floating help box which moves down the screen as the user scrolls down the page. It shouldn't move horizontally, and vertically it should remain within its container so that it doesn't cover the site header or footer. Is this possible using jQuery? It's not mentioned in the tutorials, but the interface demos on eyecon.ro imply it might be. Thanks, Ben. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: jQuery in the wild
It looks great. There is an html version of this site as well linked at the bottom. I thought the whole idea behind jquery was that it was unobtrusive, and degrades gracefully, so you didn't need multiple versions of sites like this. Then again, if you make single page sites with nice jquery effects like this, do you end up being less bookmarkable, search engine friendly, and efficient bandwidth wise, and end up needing a html only backup, like this site has? Chris
[jQuery] Re: Select box help from ajax
thnx i found live query and it is replace of behaviour thnx for help man On 8/22/07, Wizzud [EMAIL PROTECTED] wrote: First off, you need to read this http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax tutorial by Jorn Zaefferer, particularly the bit the starts 'A very common problem encountered...' about half way down. Having read that... You either need to look into the Behaviors plugin - which will automatically attach existing events to any new (and appropriate) elements loaded - or you need to include event assignment for the new selects in your callback. Muhammad Mohsin wrote: Hello I want to associate a select box coming from ajax to change function of form which is defined in the page. Can anyone help me $('#frmNewDev select').each(function() { $(this).change(function() { if(this.id != sl_developer) { var load_image = http://; + this_domain + /images/ common/loading.gif ; //$('#nn').html(load_image); $.get('http://' + this_domain + '/cp/ajax_cp_locality.php', {cat_id: this.value}, function(str) {$(#nn).append(str);}); return false; } }); }); I m using above code for associate all select box with this function but select which are coming from ajax page are not associatedhow can I associate that select box with this function. thnx -- View this message in context: http://www.nabble.com/Select-box-help-from-ajax-tf4311393s15494.html#a12277377 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] auto scrool
Hi, I have to find a solution for auto scroll. I'm thinking of an iframe and a script which would scroll a page without user interaction. When it would reach the end of the document (page) it would start again from the top (or go backwards up). Has anyone found something similar? Thanks! BR
[jQuery] Re: OT: Is this a Javascript bug?
To llustrate the problem, type the following in the firebug console and run it: x = 100 y = 200 x += 1*y console.log(x = +x); x = 100 y = 200 x = x + 1*y console.log(x expanded = +x); You will see the string concatenation and result: x= 100200 x expanded = 100200 The JS core documentation says that the addition + operator has a left- to-right association and it also has a lower precedence over the multiplication. So 1*y should evaluated first to produce a numeric value, so we have: string = string + postive_number*string which becomes: string = string + number That would be a string concatenation as shown in the console above. However using the unary negation resolve this: x = 100 y = 200 x -= -1*y console.log(x = +x); and you get x = 300. Understanding this, this is how it expands: x = x - -1*y or string = string - negative_number * string which reduces to string = string - number so I guess, there is no bug here because this is not expected to concatenate the parts here. A negative operator natually has the presumption of arithmetic. No bug! Just one of those odd things one needs to keep in mind when using the assigment += operator. Never mind! -- HLS On Aug 23, 9:39 am, Pops [EMAIL PROTECTED] wrote: I posted this as a subtopic in another message, http://groups.google.com/group/jquery-en/browse_thread/thread/f54857c... but I now see that probably is a separate JS issue that the purist here might appreciate. Not to long ago, I came across JS behavior and just noted it down. The issue in the reference link above reminded me of this. This code is basically part of First, Prev, Next, Last, table navigator for our ad hoc report/table generator. It is pre-jQuery work. So here I am using the $() function to get the element. function $(v) { return(document.getElementById(v)); } function gotoPrevPage() { $(start).value -= 1*$(rows).value;// - WORKS AS EXPECTED } function gotoNextPageBUG() { $(start).value += 1*$(rows).value; // - BUG!! } function gotoNextPageFIX() { $(start).value -= -1*$(rows).value; // - FIX!! } I was multiplying by 1 to help JS type cast the operation to tell it that it adding or substracting a number rather than a string. If you remove the multiplier, JS will naturally concatentate strings. But that didn't work for the gotoNextPage() function using the inclusive += operation. It worked fine with -= operation in gotoPrevPage(). So I used the reverse logic to multiply by -1 instead with -= and it worked. To me, that looks look like a JS type casting bug or inclusive addition bug? What say you? -- HLS
[jQuery] Re: OT: Is this a Javascript bug?
On 8/23/07, Pops [EMAIL PROTECTED] wrote: This code is basically part of First, Prev, Next, Last, table navigator for our ad hoc report/table generator. It is pre-jQuery work. So here I am using the $() function to get the element. function $(v) { return(document.getElementById(v)); } function gotoPrevPage() { $(start).value -= 1*$(rows).value;// - WORKS AS EXPECTED } function gotoNextPageBUG() { $(start).value += 1*$(rows).value; // - BUG!! } function gotoNextPageFIX() { $(start).value -= -1*$(rows).value; // - FIX!! } Hi Pops, This is interesting. Maybe it's because $('start').value is considered as string instead of integer? What was the property type from alert anyway? Regards, Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: event-binding
The plugin has changed to here: http://jquery.com/plugins/project/livequery/ -- Brandon Aaron On 8/23/07, mohsin [EMAIL PROTECTED] wrote: link is down i need that plugin On Jul 14, 6:04 am, Brandon Aaron [EMAIL PROTECTED] wrote: Yay another happy user of behavior! :) -- Brandon Aaron On 7/13/07, kaimeder [EMAIL PROTECTED] wrote: There is a plugin called Behavior that does this. I think its:http://brandonaaron.net/jquery/plugins/behavior/ Or check the plugin repository. works like a charm. thanks alot!
[jQuery] How do i group events?
Hi, I have a 'a' element with the onclick event. I wanna use this event with another. Something like this: $( 'a' ).click( function() { // if this element already has a event this.click this.click(); $( this ).css( border, 1px solid red ); }); Estevão Lucas
[jQuery] Re: OT: Is this a Javascript bug?
On 8/23/07, Pops [EMAIL PROTECTED] wrote: To llustrate the problem, type the following in the firebug console and run it: Oops.. seems i was too late pressing the Send button :D Cheers, Mike
[jQuery] Re: Form Plugin - How to repopulate fields with updated data?
Mike, I'm using the Form plugin to submit data to a processing page and upon success, show a notification to the user. My form has 6 fields, one text and 5 textarea. When the form is initially filled out and submitted the user sees a div get updated for confirmation. Now if the user changes any of the fields and submits, they get the confirmation but the changed fields revert back to the data they were showing before the update. I'd like to repopulate the fields with the updated data if possible. My code: $(document).ready(function() { var options = { target: '#resultDiv', resetForm: true }; $('#frmTop5').ajaxForm(options); }); Check out the Field Plug-in for more methods of interacting with form fields: http://jquery.com/plugins/project/field The Field Plug-in includes a method called formHash() which will allow you to populate a form based upon a hash/structure. -Dan
[jQuery] Use jQuery to get the Flash version?
Is there something built into jQuery (or a plugin hanging around) which can give me the Flash version on the user's browser? Andy Matthews Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/ dealerskinslogo.bmp
[jQuery] AjaxStart and AjaxStop only on certain requests
Hi, I'm using this piece of code: $().ajaxStart(showblock).ajaxStop(hideblock); To show and hide an overlay with the loading... message in it when an ajax funcion is running. I'm using also jtip, with an ajax request, and here come the problem. When I point the mouse over the element that open jtip my overlay continues to open and close, without showing the tooltip. In this moment I can't view the doc site then I ask you. There's a way to avoid for particular call the default ajaxstart and ajaxStop? thank you
[jQuery] Re: Use jQuery to get the Flash version?
Ive just been discussing with the developer of jquery.media about the need for a standard plugin detection API like jqbrowser. I think thats what you may want, there is plenty of these roll your owns around the place, need a standard one which may help alot of people. Maybe an extention to jwbrowser is all thats needed ? Andy Matthews wrote: Is there something built into jQuery (or a plugin hanging around) which can give me the Flash version on the user's browser? * Andy Matthews *Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/
[jQuery] Re: auto scrool
While this isn't exactly what you're looking for it would give you a base to build upon if you were to write your own. It would have the calculations for scrolling as well as some timing events. http://jdsharp.us/jQuery/plugins/AutoScroll/ Cheers, -Jonathan On 8/23/07, rayfidelity [EMAIL PROTECTED] wrote: Hi, I have to find a solution for auto scroll. I'm thinking of an iframe and a script which would scroll a page without user interaction. When it would reach the end of the document (page) it would start again from the top (or go backwards up). Has anyone found something similar? Thanks! BR
[jQuery] Re: OT: Is this a Javascript bug?
On Aug 23, 10:32 am, Mike Fern [EMAIL PROTECTED] wrote: Hi Pops, This is interesting. Maybe it's because $('start').value is considered as string instead of integer? What was the property type from alert anyway? Hi Mike, I just finished posting an analysis that shows in JS theory, it isn't a bug. :-) Its one of those nice powerful things about the JS langauge where you don't need to type case and it will figure out things for you base on the variable type. For our intepreter, I do similar automatic type casting logic as well and it the same based on the input of dyadic operators (operators with input on both sides as oppose to monadic with one right side input). The difference is that I test for what the string converts to, not that it is a string type. in other words, if the left side string is a alphanumeric, then it is a number for operators. Example. The conversion of both sides input determines the type of operation for the operator: string operator string = string operation string operator number = string operation number operator number = numeric operation number operator string = numeric operation, i.e., number operator atoi(string) I should of known what JS was doing. :-) But you bring up a point to explore. What if you have this? 1*x += 1*y in this case, you help the interpreter type case both sides. But I don't think that would be a legal JS syntax. Lets try this under firebug: x = 100; y = 200; 1*x += 1*y; console.log(x = +x); invalid assignment left-hand side 1*x += 1*y Interesting. :-) -- HLS
[jQuery] Re: OT: Is this a Javascript bug?
On Aug 23, 3:39 pm, Pops [EMAIL PROTECTED] wrote: $(start).value -= 1*$(rows).value;// - WORKS AS EXPECTED $('start').value is a STRING, but no -= operator is available for strings, so it converts the value to a number. $(start).value += 1*$(rows).value; // - BUG!! Aha - .value is a STRING, but operator += IS defined for Strings, so it uses it and appends to the value. To me, that looks look like a JS type casting bug or inclusive addition bug? It's not a bug, but a confusion about how the operators and type conversion apply. IMO += should not be overloaded for strings, to avoid exactly this type of problem. The fact that SOME of the built-in types have special operator overloads, but users of the language cannot overload any operators (except, indirectly, toString()), is a language design flaw, IMO.
[jQuery] Re: Can someone explain this string behavior?
No, I can't tell. A quick test on the Firebug console gave expected results: var x = 1 x += 1 * '4' 5 Change x to an alphanumeric: var x = '1';
[jQuery] Re: OT: Is this a Javascript bug?
Pops wrote: $(start).value -= 1*$(rows).value;// - WORKS AS EXPECTED $(start).value += 1*$(rows).value; // - BUG!! $(start).value -= -1*$(rows).value; // - FIX!! To me, that looks look like a JS type casting bug or inclusive addition bug? I don't think so. I simply think of += as shorthand, e.g., a += b is simple shorthand for a = a + b; Because a = a - b cannot be a concatenation, the casting is done and a numeric value is returned. But a = a + b is legitimate for strings, so no casting is necessary, and a string is returned. That's the downside of using + for concatenation. -- Scott
[jQuery] Re: jQuery in the wild
[EMAIL PROTECTED] wrote: http://www.dmdirectmail.com There is an html version of this site as well linked at the bottom. I thought the whole idea behind jquery was that it was unobtrusive, and degrades gracefully, so you didn't need multiple versions of sites like this. I'm not sure that's the whole idea behind JQuery. :-) But it's an important point, and what's more, it should be straightforward to do for this site. While I like the design, I'm sorry not to see this carried out more dynamically. I think they could maintain bookmarkability and search-engine friendliness without having a separate JS-based site. -- Scott
[jQuery] Re: Use jQuery to get the Flash version?
I'd LOVE to have a plugin that's simple. Jquery().flashversion Or something simple like that. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Rossi Sent: Thursday, August 23, 2007 9:50 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Use jQuery to get the Flash version? Ive just been discussing with the developer of jquery.media about the need for a standard plugin detection API like jqbrowser. I think thats what you may want, there is plenty of these roll your owns around the place, need a standard one which may help alot of people. Maybe an extention to jwbrowser is all thats needed ? Andy Matthews wrote: Is there something built into jQuery (or a plugin hanging around) which can give me the Flash version on the user's browser? * Andy Matthews *Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/
[jQuery] Re: OT: Is this a Javascript bug?
Mike Fern wrote: Oops.. seems i was too late pressing the Send button :D Me too, and I don't even have the excuse of close times on the clock. But Your Honor, I swear the analysis wasn't there when I wrote my response. Really! :-) -- Scott
[jQuery] Re: Use jQuery to get the Flash version?
Maybe someone could combine everything if its licensed to do so ? So you wont get into trouble for lifting bits of code its just organising. Andy Matthews wrote: I'd LOVE to have a plugin that's simple. Jquery().flashversion Or something simple like that. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dan Rossi Sent: Thursday, August 23, 2007 9:50 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Use jQuery to get the Flash version? Ive just been discussing with the developer of jquery.media about the need for a standard plugin detection API like jqbrowser. I think thats what you may want, there is plenty of these roll your owns around the place, need a standard one which may help alot of people. Maybe an extention to jwbrowser is all thats needed ? Andy Matthews wrote: Is there something built into jQuery (or a plugin hanging around) which can give me the Flash version on the user's browser? * Andy Matthews *Senior ColdFusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com http://www.dealerskins.com/
[jQuery] Re: Very confused!
goodieboy wrote: What am I doing wrong? Here is an example: for(i=0; i10; i++){ $('input').each(function(){ $(this).attr('name', i); }); } John's response shows how to get this, if that index is really what you want. Why this goes wrong, though is a different matter. You have a nested loop. The .each loop is setting the name attribute to the current value of i for each input. The the outer loop runs again and resets each one to a new value. If this is just a simplification of what you're doing though, and you need something more than the index, you might also run into issues with closures. Google should help with that: http://www.google.com/search?q=javascript+closure Good luck, -- Scott
[jQuery] JSON MIME type?
I'm using the jQuery Form plugin to call an ASP.NET 2.0 page. The call works just fine, but the response never comes back right. If the Response.ContentType is set to text/plain the page gets forwarded to a plain text JSON result. If the Response.ContentType is set to application/json the browser attempts to download my aspx page. All I want is for the result to be forwarded to the success event handler. Could it be the content type parameter, or is there more going on here that I haven't seen? I can post code if necessary. Thanks, MR
[jQuery] Re: OT: Is this a Javascript bug?
On Aug 23, 10:56 am, Stephan Beal [EMAIL PROTECTED] wrote: $(start).value += 1*$(rows).value; // - BUG!! Aha - .value is a STRING, but operator += IS defined for Strings, so it uses it and appends to the value. and numbers too :-) It depends on the language, some languages have specific CONCAT() like functions. To me, that looks look like a JS type casting bug or inclusive addition bug? It's not a bug, but a confusion about how the operators and type conversion apply. IMO += should not be overloaded for strings, to avoid exactly this type of problem. The fact that SOME of the built-in types have special operator overloads, but users of the language cannot overload any operators (except, indirectly, toString()), is a language design flaw, IMO. Right, in JS theory it isn't a bug. :-) Today, I work in about 7, maybe 10 different languages, including my own languages for our product, keeping it all straight can be daunting. In our WCT processing, an intepreter with its own type- less DOM, what I do is a conversion on both sides of dyadic operators. For example: @SET v1 = 100@ @SET v2 = 200@ In our DOM, its it all store as strings so doing this: @ADD V1 V2@ or in expanded form: @SET V1 = V1 + V2@ both produced a numeric operation. To force a string concatenation would be: @SET V1 = + V1 + V2@ @SET V1 = {V1}{V2}@ So part of the (my) problem was mentally thinking the similar ideas I use across the board. :-) Overall, in JS DOM, one needs to mindful that storing a number can be view as a string. Without thinking deeping of what you are saying as a flaw, jQuery, because of things like this and other things I came across in the past 2+ weeks, it has pretty much force me to take a step back and study the DOM and the JS OOPS framework. Basically, in short, there a String variables and there are String objects as illustrated here: s1 = Stephan; s2 = new String(Stephan); console.log(s1.valueOf()); console.log(s2.valueOf()); As you can see in DOM, s1 and s2 are fundamentally different, but both can be used as strings. s2 is a basically a class object, but as you see above when you begin to access s1, JS will automagically type case it as a String object allowing you to use String methods as well. -- HLS
[jQuery] Re: JSON MIME type?
On Aug 23, 5:33 pm, Michael Randolph [EMAIL PROTECTED] wrote: I'm using the jQuery Form plugin to call an ASP.NET 2.0 page. The call works just fine, but the response never comes back right. If the Response.ContentType is set to text/plain the page gets forwarded to a plain text JSON result. json is in fact plain text. It is only turned into an Object by passing that text to eval(). Once you get the response text, simply do: eval(responseText).
[jQuery] Re: Very confused!
Hi John, Actually that was a bad example sorry! What about something like this: $('form div.options').each(){function( i ){ $(this).children('[EMAIL PROTECTED]').each(function(){ $(this).attr('name', 'option_num_' + i); }); }); How do you access i from within the inner loop? I'm guessing that the execution of the inner each loop doesn't really occur until the outer one has? I just can't seem to get dynamic values into each handlers like that. I know that with Prototype, there is a function(){}.bind feature, is that used on each also? Thanks, Matt On Aug 23, 12:16 am, John Resig [EMAIL PROTECTED] wrote: Like so: $('input').each(function(i){ $(this).attr('name', i); }); Nice and simple! --John On 8/23/07, goodieboy [EMAIL PROTECTED] wrote: OK, I thought I knew jQuery pretty well. But this is completely stumping me. What I want to do is iterate through a newly attached set of input elements, and set their names based on a dynamic (incrementing) number. But the only value that ever gets used is the initial value of the variable. I've tried everything, attaching the value to the dom object, and then in the loop trying to access it (still the same original value), using a global variable, a function to get the value, all return the original value that I set the variable to. What am I doing wrong? Here is an example: for(i=0; i10; i++){ $('input').each(function(){ $(this).attr('name', i); }); } Here, all of the inputs get the value 9. How can I make then all get the current incremented value of i? Thank you for any tips! Matt
[jQuery] Re: Animate scrollTop
http://docs.jquery.com/JQuery_1.2_Roadmap#Animating_scrollLeft.2FscrollTop On 8/23/07, James Dempster [EMAIL PROTECTED] wrote: I was wondering if the changes that allow animate scrollTop would be making it to the next release? e.g. http://dev.jquery.com/~john/ticket/step/test2.html
[jQuery] Re: end(), this bug unknown
I am writing some code using end() method and really, I don't see the time where .onclick() might return a statement that /requires/ a .end() to exist Some example?? Right, that's because it doesn't exist :-) Only the following code is guaranteed to work: $(div.section) .find(dt) .addClass(section) .click(function(){ $(this).next().toggle().end() }) .end() .find(dd) .hide() .filter(:first) .show() .end() .end();
[jQuery] Re: Place value of navigator.cookieEnabled into an object. Why won't this work?!?!?
On Aug 23, 3:11 pm, Andy Matthews [EMAIL PROTECTED] wrote: userInfo['v_cookies'] = navigator.cookieEnabled; alert(navigator.cookieEnabled); ... Does anyone know what I can do to get around this? Alternately, is there a better, or more reliable way to check if the browser has cookiesEnabled? While i see no particular problem with your code, are you SURE you don't have a typo in your function body? Double-check the spelling of 'cookieEnabled'. The last line of your post has a different spelling (one which i was able to google).
[jQuery] Re: Animate scrollTop
ahh that's brilliant, :¬) what a fantastic page. I very much look forward to 1.2 /James On 8/23/07, John Resig [EMAIL PROTECTED] wrote: http://docs.jquery.com/JQuery_1.2_Roadmap#Animating_scrollLeft.2FscrollTop On 8/23/07, James Dempster [EMAIL PROTECTED] wrote: I was wondering if the changes that allow animate scrollTop would be making it to the next release? e.g. http://dev.jquery.com/~john/ticket/step/test2.html
[jQuery] Re: Place value of navigator.cookieEnabled into an object. Why won't this work?!?!?
On Aug 23, 5:53 pm, Stephan Beal [EMAIL PROTECTED] wrote: While i see no particular problem with your code, are you SURE you don't have a typo in your function body? Double-check the spelling of 'cookieEnabled'. The last line of your post has a different spelling (one which i was able to google). After more googling around, it seems that cookieEnabled (as opposed to cookiesEnabled) is indeed the proper spelling: http://developer.mozilla.org/en/docs/DOM:window.navigator.cookieEnabled While i disagree highly with their choice of spellings, it seems that that's simply the way it is. So... i can't offer you an answer as to why your code isn't working. The only suggestion i can offer is to try window.navigator instead of simply navigator. ??
[jQuery] Re: Very confused!
Your code looks like it'll work, it could even be reduced to: $('form div.options').each(){function( i ){ $(this).children('[EMAIL PROTECTED]').attr('name', 'option_num_' + i); }); --John On 8/23/07, goodieboy [EMAIL PROTECTED] wrote: Hi John, Actually that was a bad example sorry! What about something like this: $('form div.options').each(){function( i ){ $(this).children('[EMAIL PROTECTED]').each(function(){ $(this).attr('name', 'option_num_' + i); }); }); How do you access i from within the inner loop? I'm guessing that the execution of the inner each loop doesn't really occur until the outer one has? I just can't seem to get dynamic values into each handlers like that. I know that with Prototype, there is a function(){}.bind feature, is that used on each also? Thanks, Matt On Aug 23, 12:16 am, John Resig [EMAIL PROTECTED] wrote: Like so: $('input').each(function(i){ $(this).attr('name', i); }); Nice and simple! --John On 8/23/07, goodieboy [EMAIL PROTECTED] wrote: OK, I thought I knew jQuery pretty well. But this is completely stumping me. What I want to do is iterate through a newly attached set of input elements, and set their names based on a dynamic (incrementing) number. But the only value that ever gets used is the initial value of the variable. I've tried everything, attaching the value to the dom object, and then in the loop trying to access it (still the same original value), using a global variable, a function to get the value, all return the original value that I set the variable to. What am I doing wrong? Here is an example: for(i=0; i10; i++){ $('input').each(function(){ $(this).attr('name', i); }); } Here, all of the inputs get the value 9. How can I make then all get the current incremented value of i? Thank you for any tips! Matt
[jQuery] Re: Very confused!
goodieboy wrote: Hi John, Actually that was a bad example sorry! What about something like this: $('form div.options').each(){function( i ){ $(this).children('[EMAIL PROTECTED]').each(function(){ $(this).attr('name', 'option_num_' + i); }); }); Try this: $('form div.options').each(){function( i ){ var j = i; $(this).children('[EMAIL PROTECTED]').each(function(){ $(this).attr('name', 'option_num_' + j); }); }); If that works, then try looking up Javascript closures. If not, then I'm a little stumped. -- Scott
[jQuery] Re: How do i group events?
Not exactly sure what you are trying to do. Are you trying to have 2 separate click events, like this: http://www.commadot.com/jquery/events/multipleEvents.htm Or are you trying to unbind the original event? Like this? $(p).unbind( click ) Or something else? Glen On 8/23/07, Estevão Lucas [EMAIL PROTECTED] wrote: Hi, I have a 'a' element with the onclick event. I wanna use this event with another. Something like this: $( 'a' ).click( function() { // if this element already has a event this.click this.click(); $( this ).css( border, 1px solid red ); }); Estevão Lucas
[jQuery] Re: OT: Is this a Javascript bug?
Just a note on terminology... You're not talking about the DOM here, but rather core JavaScript. String, Number, Array, and all those kinds of types are part of core JavaScript. The DOM is stuff like document.getElementById(). Overall, in JS DOM, one needs to mindful that storing a number can be view as a string. Without thinking deeping of what you are saying as a flaw, jQuery, because of things like this and other things I came across in the past 2+ weeks, it has pretty much force me to take a step back and study the DOM and the JS OOPS framework. Basically, in short, there a String variables and there are String objects as illustrated here: s1 = Stephan; s2 = new String(Stephan); console.log(s1.valueOf()); console.log(s2.valueOf()); As you can see in DOM, s1 and s2 are fundamentally different, but both can be used as strings. s2 is a basically a class object, but as you see above when you begin to access s1, JS will automagically type case it as a String object allowing you to use String methods as well.
[jQuery] [ANNOUNCE] LavaLamp for jQuery lovers released!
Hi friends, Thank you! both for all your patience and valuable feedback. This sure helped shaped this plugin into whatever it is today. LavaLamp is a very simple menu plugin for jQuery. As many of you already know, fancy hover effects is what gives it character. It was originally written by Guillermo Rauchhttp://devthought.com/cssjavascript-true-power-fancy-menu/ for the mootools library. I just ported it for the benefit of jQuery lovers. You can get a complete overview and how to implement it in your site here - http://gmarwaha.com/blog/?p=7 Special thanks to Stephan Beal who gave it its name and to Glen Lipka who generously chipped in and helped with image sprites. If you like it, don't resist the urge to digg it at http://digg.com/design/Lava_Lamp_for_jQuery_lovers. I would be really glad if more people came to know about it. I would be happy to answer any questions, comments or suggestions you may have... Thanks again, -GTG
[jQuery] Re: [ANNOUNCE] LavaLamp for jQuery lovers released!
SWWTTT!!! On 8/23/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: Hi friends, Thank you! both for all your patience and valuable feedback. This sure helped shaped this plugin into whatever it is today. LavaLamp is a very simple menu plugin for jQuery. As many of you already know, fancy hover effects is what gives it character. It was originally written by Guillermo Rauch for the mootools library. I just ported it for the benefit of jQuery lovers. You can get a complete overview and how to implement it in your site here - http://gmarwaha.com/blog/?p=7 Special thanks to Stephan Beal who gave it its name and to Glen Lipka who generously chipped in and helped with image sprites. If you like it, don't resist the urge to digg it at http://digg.com/design/Lava_Lamp_for_jQuery_lovers. I would be really glad if more people came to know about it. I would be happy to answer any questions, comments or suggestions you may have... Thanks again, -GTG -- Tane Piper http://digitalspaghetti.me.uk This email is: [ ] blogable [ x ] ask first [ ] private