[jQuery] Re: question about dealing with JSON callback
On Apr 16, 5:14 pm, mkmanning michaell...@gmail.com wrote: As I said before: it's a string until it's eval'd, which happens with the 'json' response type within jQuery, or as I said you can eval the Notice carefully what 'sneaks' used for his dataType: jQuery.post( /wp/wp-admin/admin-ajax.php, { action: getProductInfo, 'cookie': encodeURIComponent(document.cookie), 'product_id': product_id },function(obj) { jQuery.each(obj, function(i, val) { jQuery('#' + i).attr('value',val); }); },JSON); } - the dataType is JSON, not json. (I pointed this out earlier in this thread) So, the conditional below is false and following statement does not execute:- | [...] | if ( type == json ) | data = window[eval](( + data + )); | return data; | }, What happens in this case is that jQuery.ajax does not handle a case for dataType == JSON and passes the xhr's responseText through to the callback function. Identifier json holds a string value. Sneaks resolved his issue by using eval directly, as: var obj=eval('('+json+')'); If |json| is an object, that would be interpreted as:- eval(([object Object])); - which would result in EvalError. OK. I think this clarifies that |json| is not an object, but a string. Garrett
[jQuery] need help with jqGrid
I' m trying to use the jquery jqGrid plugin but i can't see it working with ASP code. this is the xml generated file. rows page /page total /total records114/records row id=191 cell191/cell cell15/cell /row row id=192 cell192/cell cell15/cell /row row id=193 cell193/cell cell15/cell /row /rows and this is the html: html head titlejqGrid Demo/title link rel=stylesheet type=text/css media=screen href=/jqgrid/ themes/basic/grid.css / link rel=stylesheet type=text/css media=screen href=themes/ jqModal.css / script src=/jqgrid/jquery.js type=text/javascript/script script src=/jqgrid/jquery.jqGrid.js type=text/javascript/ script script src=/jqgrid/js/jqDnR.js type=text/javascript/script script src=/jqgrid/js/jqModal.js type=text/javascript/script script type=text/javascript jQuery(document).ready(function(){ jQuery(#list).jqGrid({ url:'listDisponibilidade.asp', datatype: 'xml', mtype: 'GET', colNames:['id','Cdigo'], colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, ], pager: jQuery('#pager'), rowNum:10, rowList:[10,20,30], sortname: 'id', sortorder: desc, viewrecords: true, imgpath: '/jqgrid/themes/basic/images', caption: 'My first grid' }); }); /script /head body table id=list class=scroll/table div id=pager class=scroll style=text-align:center;/div /body /html I can't see what i'm doing wrong. Please help.
[jQuery] Re: help with jqgrid
Hello, The most common error when writing is the comma. You have colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, --- Error ], Remove the comma and will be ok Regards Tony On Apr 17, 3:12 am, led l.r@sapo.pt wrote: b.jgrid is undefined . i'm having this error when everything seems to be in place . I'm just starting to try this plugin . http://realferias.com/jqgrid_demo.htm thanks
[jQuery] Re: need help with jqGrid
Hello, Already replayed. Please check your code - you have a unneeded coma in colModel Regards Tony On Apr 17, 1:33 pm, led l.r@sapo.pt wrote: I' m trying to use the jquery jqGrid plugin but i can't see it working with ASP code. this is the xml generated file. rows page /page total /total records114/records row id=191 cell191/cell cell15/cell /row row id=192 cell192/cell cell15/cell /row row id=193 cell193/cell cell15/cell /row /rows and this is the html: html head titlejqGrid Demo/title link rel=stylesheet type=text/css media=screen href=/jqgrid/ themes/basic/grid.css / link rel=stylesheet type=text/css media=screen href=themes/ jqModal.css / script src=/jqgrid/jquery.js type=text/javascript/script script src=/jqgrid/jquery.jqGrid.js type=text/javascript/ script script src=/jqgrid/js/jqDnR.js type=text/javascript/script script src=/jqgrid/js/jqModal.js type=text/javascript/script script type=text/javascript jQuery(document).ready(function(){ jQuery(#list).jqGrid({ url:'listDisponibilidade.asp', datatype: 'xml', mtype: 'GET', colNames:['id','Cdigo'], colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, ], pager: jQuery('#pager'), rowNum:10, rowList:[10,20,30], sortname: 'id', sortorder: desc, viewrecords: true, imgpath: '/jqgrid/themes/basic/images', caption: 'My first grid' });}); /script /head body table id=list class=scroll/table div id=pager class=scroll style=text-align:center;/div /body /html I can't see what i'm doing wrong. Please help.
[jQuery] Re: help with jqgrid
Hello, Please see my previous mail, remove the comma at last item - ie. the col model should be colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55} ], and not colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, ], See the diffrence On Apr 17, 1:50 pm, Led l.r@sapo.pt wrote: i'm happy to contact with you. You have done a great job with this plugin , but i can't see it working. See the sample inhttp://realferias.com/jqgrid_demo.htm I'm trying to implement this in a project but the basic sample is not working. Again , please... On 17 Abr, 11:41, Tony t...@trirand.com wrote: Hello, The most common error when writing is the comma. You have colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, --- Error ], Remove the comma and will be ok Regards Tony On Apr 17, 3:12 am, led l.r@sapo.pt wrote: b.jgrid is undefined . i'm having this error when everything seems to be in place . I'm just starting to try this plugin . http://realferias.com/jqgrid_demo.htm thanks- Ocultar texto citado - - Mostrar texto citado -
[jQuery] Re: [validate] invalidHandler is called before the errors are shown, maybe better vice versa?
The suggestion makes sense, though there are probably also cases where the current order makes more sense, and changing it will cause other issues. Take a look at this tabs demo for an alternative implementation: http://jquery.bassistance.de/validate/demo/tabs/ Jörn On Fri, Apr 17, 2009 at 12:26 PM, snobo g...@riga.ahlers.com wrote: Hi Jörn, incredibly awesome plugin you've made, thanks a million! Started to explore and using it, and stumbled onto situation. In my invalidHandler, I'm trying to access the first input which is marked as invalid (in order to ensure that it is visible - my form is split on tabs, and I need to select a proper tab if the currently selected one has no invalid fields). I'm doing this via $ ('#myform :input.error:first') query, but there is a problem: in your code, you mark fields as invalid AFTER the invalidHandler call (line 302): if (!this.valid()) $(this.currentForm).triggerHandler(invalid-form, [this]); this.showErrors(); So, as a workaround at the moment I simply call showErrors(); in my invalidHandler, but maybe - unless you have a special reason for this - it's better to swap these lines in the jquery.validate.js? That's actually my $0.02 suggestion. cheers
[jQuery] Re: help with jqgrid
See it my friend, but i've changed and nothing On 17 Abr, 11:55, Tony t...@trirand.com wrote: Hello, Please see my previous mail, remove the comma at last item - ie. the col model should be colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55} ], and not colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, ], See the diffrence On Apr 17, 1:50 pm, Led l.r@sapo.pt wrote: i'm happy to contact with you. You have done a great job with this plugin , but i can't see it working. See the sample inhttp://realferias.com/jqgrid_demo.htm I'm trying to implement this in a project but the basic sample is not working. Again , please... On 17 Abr, 11:41, Tony t...@trirand.com wrote: Hello, The most common error when writing is the comma. You have colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, --- Error ], Remove the comma and will be ok Regards Tony On Apr 17, 3:12 am, led l.r@sapo.pt wrote: b.jgrid is undefined . i'm having this error when everything seems to be in place . I'm just starting to try this plugin . http://realferias.com/jqgrid_demo.htm thanks- Ocultar texto citado - - Mostrar texto citado -- Ocultar texto citado - - Mostrar texto citado -
[jQuery] Iframe auto height
I can't find any cross browser solution for setting iframe height depending on its content.
[jQuery] Re: Creating custom attributes in html
On Apr 17, 3:34 pm, RobG rg...@iinet.net.au wrote: [...] OK, here is a dead basic proof of concept. Of course it is nowhere near production code, but I think you can see where it's going. I would wrap the entire thing in the module pattern, but I've just used basic globals at this stage. My intention is to show that efficient DOM manipulation is possible and that access to related data isn't hard. It took me about 45 minutes to write the entire thing (more than half of that was writing the function to generate the test data set), tested in Firefox 3 and IE 6 on a 3.4GHz Pentium 4, Windows XP, the insert runs in less than 500ms. I'll test it on the G4 iBook for reference later. Safari 4 on iBook takes around 132ms, Firefox was around 1900. [...] function showData(evt) { var evt = evt || window.event; var tgt = evt.target || evt.srcElement; var data; if (tgt tgt.tagName tgt.tagName.toLowerCase() == 'a') { data = dataObj[tgt.id]; // Should guard against error here if (typeof data != 'undefined') { // Have data related to this element, do // something with it alert( 'Name: ' + data.name + '\nType: ' + data.type + '\nAbout: ' + data.about ); } } } -- Rob
[jQuery] Re: need help with jqGrid
tony , check that is not that. On 17 Abr, 11:46, Tony t...@trirand.com wrote: Hello, Already replayed. Please check your code - you have a unneeded coma in colModel Regards Tony On Apr 17, 1:33 pm, led l.r@sapo.pt wrote: I' m trying to use the jquery jqGrid plugin but i can't see it working with ASP code. this is the xml generated file. rows page /page total /total records114/records row id=191 cell191/cell cell15/cell /row row id=192 cell192/cell cell15/cell /row row id=193 cell193/cell cell15/cell /row /rows and this is the html: html head titlejqGrid Demo/title link rel=stylesheet type=text/css media=screen href=/jqgrid/ themes/basic/grid.css / link rel=stylesheet type=text/css media=screen href=themes/ jqModal.css / script src=/jqgrid/jquery.js type=text/javascript/script script src=/jqgrid/jquery.jqGrid.js type=text/javascript/ script script src=/jqgrid/js/jqDnR.js type=text/javascript/script script src=/jqgrid/js/jqModal.js type=text/javascript/script script type=text/javascript jQuery(document).ready(function(){ jQuery(#list).jqGrid({ url:'listDisponibilidade.asp', datatype: 'xml', mtype: 'GET', colNames:['id','Cdigo'], colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, ], pager: jQuery('#pager'), rowNum:10, rowList:[10,20,30], sortname: 'id', sortorder: desc, viewrecords: true, imgpath: '/jqgrid/themes/basic/images', caption: 'My first grid' });}); /script /head body table id=list class=scroll/table div id=pager class=scroll style=text-align:center;/div /body /html I can't see what i'm doing wrong. Please help.- Ocultar texto citado - - Mostrar texto citado -
[jQuery] Adding properties to $.ajax(options)
$.ajax({ type: GET, url: prefix+url, success: script_saved, custom_property : someVar }); Is there anything wrong with this?
[jQuery] Re: Internet Explorer - my jQuery is not working
Somewhere there is a problem with your code or syntax without posting more information than not working or examples of what you are trying to do and how you are doing it makes it absolutely impossible for others to help you On Apr 17, 7:40 am, hybris77 dist...@yahoo.com wrote: anyone aware of what is the problem with my jQuery code that makes it nor run in IE? are there particular issues to be aware of? /pär
[jQuery] [autocomplete] Submit form on click result
Hi there, My jquery is pretty sketchy so I was wondering if anybody knew how to submit the form that the search field appears in on click of a result (after having populated the textfield and any other fields)? Not sure how to do this... Thanks! Dan.
[jQuery] How to select sub element text on clicking the parent element.
Hi, I am newbie to the jquery. Please let me know, how i can do this. div id=questions-page div id=question pquestion1/p ul lianswer1/li /ul /div div id=question pquestion2/p ul lianswer2/li /ul /div /div The question is.. Onclicking question1, I should popup answer1. code script window.onload = function() { $(#questions-page #questions p).click(function(){ text=; // I want here to get the value of answer. alert('answer is'+text); }); }; /script /code
[jQuery] Validation plugin (bassistance.de) problem
Example form: http://jquery.bassistance.de/validate/demo/milk/ (this is the demo for the script on bassistance.de) When it does 'live' validation (on blur) it tells the user if the field is correct or incorrect. When you fill in the first field, tab to the next field, go back to the previous (allready filled in) field and clear it, it still counts as valid (notice the icon next to the field). Since the field is now empty, it should state as invalid, but it doesn't. This behaviour is random, sometimes it works, sometimes it doesn't. Sometimes it happens in the first field, sometimes on one of the other. It only happens before you try to submit the form, after a page submit everything works fine. Anybody who has a clue?
[jQuery] Help choosing JavaScript library
Hi, I know.. probably a bit naive but still. Sorry if something... Guys, can you please help me to choose JS library and say your experienced opinion on each one: http://dnagir.blogspot.com/2009/04/javascript-library-survey.html Much appreciated and many thanks in advance! Dmitriy.
[jQuery] Re: jQuery problem in php
JACK3985 wrote: hi all,i face some problem in php,when i using html2php (http:// www.quasarcr.com/html2php/ ) convert my html code to php the jquery scrollTop will not work. Forgive me for asking, but why would you even do such a thing? Anyway, the best you can do is view the source of the page in your browser, and compare it to the html that you entered in html2php. Jonathan -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: Validation plugin (bassistance.de) problem
The behaviour is described here: http://docs.jquery.com/Plugins/Validation/Reference#Validation_event Jörn On Fri, Apr 17, 2009 at 10:46 AM, Jonas jonassa...@gmail.com wrote: Example form: http://jquery.bassistance.de/validate/demo/milk/ (this is the demo for the script on bassistance.de) When it does 'live' validation (on blur) it tells the user if the field is correct or incorrect. When you fill in the first field, tab to the next field, go back to the previous (allready filled in) field and clear it, it still counts as valid (notice the icon next to the field). Since the field is now empty, it should state as invalid, but it doesn't. This behaviour is random, sometimes it works, sometimes it doesn't. Sometimes it happens in the first field, sometimes on one of the other. It only happens before you try to submit the form, after a page submit everything works fine. Anybody who has a clue?
[jQuery] Re: tabs collapsed by default on open
THANK YOU SO SO MUCH! On Apr 16, 7:29 pm, Klaus Hartl klaus.ha...@googlemail.com wrote: On 16 Apr., 20:38, robintrain...@yahoo.com robintrain...@yahoo.com wrote: Hello everyone. Is there a way to have tabs created in jQuery that are collapsed when the page loads? I use this: $(document).ready(function(){ $(#tabs).tabs({ collapsible: true }); }); to allow the user to click on the tab to collapse it once the page loads. But how do I get the tab content to be hidden to begin with? Use: $(document).ready(function(){ $(#tabs).tabs({ collapsible: true, selected: -1 }); }); You don't necessarily have to use collapsible in this case by the way. --Klaus
[jQuery] Re: help with jqgrid
i'm happy to contact with you. You have done a great job with this plugin , but i can't see it working. See the sample in http://realferias.com/jqgrid_demo.htm I'm trying to implement this in a project but the basic sample is not working. Again , please... On 17 Abr, 11:41, Tony t...@trirand.com wrote: Hello, The most common error when writing is the comma. You have colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, --- Error ], Remove the comma and will be ok Regards Tony On Apr 17, 3:12 am, led l.r@sapo.pt wrote: b.jgrid is undefined . i'm having this error when everything seems to be in place . I'm just starting to try this plugin . http://realferias.com/jqgrid_demo.htm thanks- Ocultar texto citado - - Mostrar texto citado -
[jQuery] Re: can jquery capture these events all in one: user closes browser window/tab, or leaves my domain?
On Fri, Apr 17, 2009 at 3:25 AM, Govinda govinda.webdnat...@gmail.com wrote: Hi all, I am brand new here. Except for quick installs of pre-written scripts over the years, I have very little experience of javascript (do we use the acronym js here?) I have written in visual basic (I was last semi-fluent with the 1998 version), and in WebDNA for 10 years (server- side web scripting language, like PHP, only much less known). I am writing to ask your opinions about accomplishing a solution to our need. I am not sure if we can do this with jQuery or js? Here is what I need your opinion about how to solve: We have a series of forms for the user to submit. We gather various data from the user at each form. We save his input to disk at every form submission but also eventually want to do some final processing on his input (do some math, over and above just saving his input). We only want to process his data once we have accumulated as much data from his as possible.. i.e. as much as he has patience to input for us. *One special thing is that we can only do this final processing one time.* Ideally we want to wait until he reaches formN to do this final processing of his data. But if we knew he was only going to stick around to see form3 and then leave.. then we would simply do the final processing after he submitted form2. The problem is that we never know when the user will get tired and leave. We would do the final processing earlier before losing him, but we can only process once and we don't want to miss the chance to gather yet more data from him before we process. If he leaves our site at form2 (or form3, or form4, for example) then we want to process whatever data we have gathered from him in total... meaning *as if he had submitted the form* he is now looking at after having checked the checkbox which says this is my last form!. We want to process as though he submitted one last form after alerting us that it was going to be his last submission - even though he is actually now leaving our site by closing the browser window, or closing the browser tab, or entering a new URL to go to.. or using a browser bookmark .. I assume there is a way to capture the event that fires when someone closes the browser window, closes the tab, (or also even if he just leaves our domain within the current window/tab?)..? Can I capture all these possible events (and others that you can think of that I neglect to mention here) into one umbrella event that fires and effectively submits the current form one last time - thus signaling to our server to go ahead with the final processing? If jQuery does not have this capability, then what about javascript? Please advise! Thanks for your time reading this. -Govinda Try unload event on body tag. you even try jquery way. $(window).unload(function { //whatever you want to do }); refer: http://docs.jquery.com/Events/unload#fn -raja koduru
[jQuery] Re: How to select sub element text on clicking the parent element.
* var answer_text = $(ul li, this).text(); alert(answer is + answer_text); does this help? -raja koduru
[jQuery] [validate] invalidHandler is called before the errors are shown, maybe better vice versa?
Hi Jörn, incredibly awesome plugin you've made, thanks a million! Started to explore and using it, and stumbled onto situation. In my invalidHandler, I'm trying to access the first input which is marked as invalid (in order to ensure that it is visible - my form is split on tabs, and I need to select a proper tab if the currently selected one has no invalid fields). I'm doing this via $ ('#myform :input.error:first') query, but there is a problem: in your code, you mark fields as invalid AFTER the invalidHandler call (line 302): if (!this.valid()) $(this.currentForm).triggerHandler(invalid-form, [this]); this.showErrors(); So, as a workaround at the moment I simply call showErrors(); in my invalidHandler, but maybe - unless you have a special reason for this - it's better to swap these lines in the jquery.validate.js? That's actually my $0.02 suggestion. cheers
[jQuery] Re: [autocomplete] Submit form on click result
Dan, Do you want an ajax post or form submit Can you provide some information on what you are looking for? - raja koduru On Fri, Apr 17, 2009 at 4:44 PM, dajaniel daniel.howe...@googlemail.com wrote: Hi there, My jquery is pretty sketchy so I was wondering if anybody knew how to submit the form that the search field appears in on click of a result (after having populated the textfield and any other fields)? Not sure how to do this... Thanks! Dan.
[jQuery] Re: Adding properties to $.ajax(options)
don't see any.. what is the error you are experiencing? - raja koduru On Fri, Apr 17, 2009 at 5:30 PM, blasto333 m...@chrismuench.com wrote: $.ajax({ type: GET, url: prefix+url, success: script_saved, custom_property : someVar }); Is there anything wrong with this?
[jQuery] Internet Explorer - my jQuery is not working
anyone aware of what is the problem with my jQuery code that makes it nor run in IE? are there particular issues to be aware of? /pär
[jQuery] Re: Setting a newly inserted option as the selected option
$(#refSelectBox option[text^= + author + ]).attr(selected,selected); I guess the above is doable. let me know. - raja koduru On Thu, Apr 16, 2009 at 11:16 PM, Nando d.na...@gmail.com wrote: I'd like set a newly inserted option in a select box as the selected option. I'm trying to use jQuery to select the option using the option text, which begins with the author name as defined in the function. In the examples I've found, $(#refSelectBox option[text^=author]) would presumably select any option that begins with the literal author, but I need it evaluated instead. Given the following ... $(#addRefForm).submit(function() { var author = $(#author).val() var detail = $(#detail).val() var refYear = $(#refYear).val() var refType = $(#refType option:selected).val() var newReference = 1 $.post('index.cfm?view=saveReferenceFromPopup', { author:author, detail:detail, refYear:refYear, refType:refType, newReference:newReference }, function(data,status) { if(status == 'success'){ $(#refSelectBox).trigger('refreshOpts'); $(#refSelectBox option[text^=author]).attr (selected,selected); } } ); $('#dialog').dialog('close'); return false; }); ... how to select the newly inserted option in #refSelectBox using the text attribute and set it to the selected option? Any alternate suggestions are most welcome! Thanks, Nando
[jQuery] Re: Autocomplete plugin for multiple form fields from a JSON source [autocomplete]
On 4/16/09 6:44 PM, tatlar robertlnew...@gmail.com wrote: So, I got around this by creating another JSON file that is just an array of station names. Autocomplete now parses this just fine, and my first field is completed. The next part was more tricky - how to populate the second input field based on the number of report types (I actually ended up using a select element with the option list populated with the reports available. My solution is pretty inelegant, but uses a nice option in Jorns plugin, the result() option (http:// docs.jquery.com/Plugins/Autocomplete/result#handler). Using this, I can get the match from the first autocomplete call, and write a callback function that then goes via AJAX to my original complex JSON object to just get the matching stations object. so in the end you used only a simple autocomplete and circumvented the issues of handling automatic pre-stuffing of multiple dependent autocomplete fields with your ajax-stuffed select element. if it works, it works. since this isn't the kind of solution i'm interested in, i only briefly read your code to see how you did it. you've avoided solving the problems i'm interested in. i have one comment on the code: you embedded an ajax query inside the .result() handler of an .autocomplete(). this works if users move in one direction through the form, which, in your case, is from autocompleting text field to the select. this is something i wanted to avoid; i need a non-hierarchical ui. the user has three text fields and can start typing in any of them and then move from there to either of the other two text fields, and when he or she does, the autocomplete list appears on focus constrained by the entries already selected.
[jQuery] Re: .navButtonAdd Quick Question...
Can you provide more details. Feels like doable just by fiddling with class attribute -- raja koduru On Thu, Apr 16, 2009 at 9:40 PM, briandus bri...@virtual-essentials.com wrote: Hi there - I'm adding a custom button using the .navButtonAdd function. I see that there is an option for an image, but I'm wondering if I can create a button and apply a class instead. I have a toggle button that I'm adding and the image will change with the toggle state. Is this possible? Thanks!
[jQuery] Re: [autocomplete] Submit form on click result
On 4/17/09 7:14 AM, dajaniel daniel.howe...@googlemail.com wrote: My jquery is pretty sketchy so I was wondering if anybody knew how to submit the form that the search field appears in on click of a result (after having populated the textfield and any other fields)? Not sure how to do this... check out the documentation for .result() in the autocomplete plugin, then look at the docs for jquery's .trigger(), here's the links: http://docs.jquery.com/Plugins/Autocomplete/result#handler http://docs.jquery.com/Events/trigger#eventdata
[jQuery] Re: Error messages is repeating !!
name collision could be a reason like a function and a variable(non function) having same name..and you try to call the variable provide more info on the problem you are facing -- raja koduru On Thu, Apr 16, 2009 at 9:02 PM, akmsharma amit.mca...@gmail.com wrote: Hi , Frnds I had encountered a unusual problem in one of the forms I had validated through jQuery in my prjt. The error messages are getting repeated if I keep presing the submit button without entering any value. any the form gets as many error messages as many time I click the submit button . Any sugesstion will be a welcome Thanks Amit
[jQuery] Re: [validate] invalidHandler is called before the errors are shown, maybe better vice versa?
Hmm, interesting alternative solution! Thanx, I will consider this. Well, if you are sure there WILL be issues, let it be, although purely theoretically for me it seems more logical to have invalidHandler being run at the moment where errors are shown. cheers On Apr 17, 1:55 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: The suggestion makes sense, though there are probably also cases where the current order makes more sense, and changing it will cause other issues. Take a look at this tabs demo for an alternative implementation:http://jquery.bassistance.de/validate/demo/tabs/ Jörn On Fri, Apr 17, 2009 at 12:26 PM, snobo g...@riga.ahlers.com wrote: Hi Jörn, incredibly awesome plugin you've made, thanks a million! Started to explore and using it, and stumbled onto situation. In my invalidHandler, I'm trying to access the first input which is marked as invalid (in order to ensure that it is visible - my form is split on tabs, and I need to select a proper tab if the currently selected one has no invalid fields). I'm doing this via $ ('#myform :input.error:first') query, but there is a problem: in your code, you mark fields as invalid AFTER the invalidHandler call (line 302): if (!this.valid()) $(this.currentForm).triggerHandler(invalid-form, [this]); this.showErrors(); So, as a workaround at the moment I simply call showErrors(); in my invalidHandler, but maybe - unless you have a special reason for this - it's better to swap these lines in the jquery.validate.js? That's actually my $0.02 suggestion. cheers
[jQuery] Re: Validation plugin (bassistance.de) problem
i also detected some difference between the demo's behavior and the docs. i'm not sure what sequence of ui actions led to the result in the attached png but i've seen it twice now. On 4/17/09 8:17 AM, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: The behaviour is described here: http://docs.jquery.com/Plugins/Validation/Reference#Validation_event Jörn On Fri, Apr 17, 2009 at 10:46 AM, Jonas jonassa...@gmail.com wrote: Example form: http://jquery.bassistance.de/validate/demo/milk/ (this is the demo for the script on bassistance.de) When it does 'live' validation (on blur) it tells the user if the field is correct or incorrect. When you fill in the first field, tab to the next field, go back to the previous (allready filled in) field and clear it, it still counts as valid (notice the icon next to the field). Since the field is now empty, it should state as invalid, but it doesn't. This behaviour is random, sometimes it works, sometimes it doesn't. Sometimes it happens in the first field, sometimes on one of the other. It only happens before you try to submit the form, after a page submit everything works fine. Anybody who has a clue? attachment: Picture-1a.png
[jQuery] [validate] remote vs depends
I've been trying to use remote method coupled with depends, like this: remote: { depends: function(element) { element.value = $.trim(element.value); return element.defaultValue != element.value; }, url: 'my.php', type: 'post', data: { action: 'check_user_name' } } and this doesn't work, because the whole remote parameter array gets overwritten with the result of evaluating my 'depends' function (so instead of array it becomes a scalar, true or false). Therefore in case of false the AJAX call doesn't happen, and in case of true an error occurs (because there's no url, no type, and no data anymore). I assume remote and depends are incompatible, is it correct? If yes, is there a workaround for this? TIA cheers
[jQuery] Re: [validate] invalidHandler is called before the errors are shown, maybe better vice versa?
Sure, it makes sense. Its just not that easy a descision to change something in a stable API. Jörn On Fri, Apr 17, 2009 at 2:55 PM, snobo g...@riga.ahlers.com wrote: Hmm, interesting alternative solution! Thanx, I will consider this. Well, if you are sure there WILL be issues, let it be, although purely theoretically for me it seems more logical to have invalidHandler being run at the moment where errors are shown. cheers On Apr 17, 1:55 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: The suggestion makes sense, though there are probably also cases where the current order makes more sense, and changing it will cause other issues. Take a look at this tabs demo for an alternative implementation:http://jquery.bassistance.de/validate/demo/tabs/ Jörn On Fri, Apr 17, 2009 at 12:26 PM, snobo g...@riga.ahlers.com wrote: Hi Jörn, incredibly awesome plugin you've made, thanks a million! Started to explore and using it, and stumbled onto situation. In my invalidHandler, I'm trying to access the first input which is marked as invalid (in order to ensure that it is visible - my form is split on tabs, and I need to select a proper tab if the currently selected one has no invalid fields). I'm doing this via $ ('#myform :input.error:first') query, but there is a problem: in your code, you mark fields as invalid AFTER the invalidHandler call (line 302): if (!this.valid()) $(this.currentForm).triggerHandler(invalid-form, [this]); this.showErrors(); So, as a workaround at the moment I simply call showErrors(); in my invalidHandler, but maybe - unless you have a special reason for this - it's better to swap these lines in the jquery.validate.js? That's actually my $0.02 suggestion. cheers
[jQuery] Re: Adding properties to $.ajax(options)
There is not an error, I was just wondering if this is frowned upon. On Apr 17, 8:32 am, Raja Koduru kscr...@gmail.com wrote: don't see any.. what is the error you are experiencing? - raja koduru On Fri, Apr 17, 2009 at 5:30 PM, blasto333 m...@chrismuench.com wrote: $.ajax({ type: GET, url: prefix+url, success: script_saved, custom_property : someVar }); Is there anything wrong with this?
[jQuery] Re: Adding properties to $.ajax(options)
There is not an error, I was just wondering if this is frowned upon. On Apr 17, 8:32 am, Raja Koduru kscr...@gmail.com wrote: don't see any.. what is the error you are experiencing? - raja koduru On Fri, Apr 17, 2009 at 5:30 PM, blasto333 m...@chrismuench.com wrote: $.ajax({ type: GET, url: prefix+url, success: script_saved, custom_property : someVar }); Is there anything wrong with this?
[jQuery] Re: [validate] remote vs depends
This is indeed a bug, in this case something never tested for. Is using required: function() {} together with remote an option? Jörn On Fri, Apr 17, 2009 at 3:03 PM, snobo g...@riga.ahlers.com wrote: I've been trying to use remote method coupled with depends, like this: remote: { depends: function(element) { element.value = $.trim(element.value); return element.defaultValue != element.value; }, url: 'my.php', type: 'post', data: { action: 'check_user_name' } } and this doesn't work, because the whole remote parameter array gets overwritten with the result of evaluating my 'depends' function (so instead of array it becomes a scalar, true or false). Therefore in case of false the AJAX call doesn't happen, and in case of true an error occurs (because there's no url, no type, and no data anymore). I assume remote and depends are incompatible, is it correct? If yes, is there a workaround for this? TIA cheers
[jQuery] Re: Works in IE7 but not IE6
That's what I have now: a simple jQuery action and as far as IE6 is concerned it is not there at all. At this point, the issue could be related to jQuery itself, or to the css for mainDiv. That's why I recommended something simple like an alert, so that you could determine if the issue is actually with the jQuery framework, or if it is related to IE6's quirky css model. Can I save each script file using UTF-8 encoding in Notepad? If not, how do I do it? Notepad does allow you to save files with UTF-8 encoding, BUT it prefixes the file contents with a Byte Order Mark (usually called 'BOM'), which causes a lot of problems, so I wouldn't recommend using notepad for this. Honestly, this may not be the issue at all -- that's why I suggest trying some other option to determine if jQuery is running in IE6 before you worry about the file's encoding.
[jQuery] Re: [validate] remote vs depends
well, I don't see how required can help me... what I want is to make a remote call/check ONLY under certain circumstances. Plus, this field is constantly-required already anyway... actually, now I think there might be various workarounds, e.g. creating a custom method, which would check the condition first and then making an AJAX call manually only if needed... On Apr 17, 4:16 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: This is indeed a bug, in this case something never tested for. Is using required: function() {} together with remote an option? Jörn On Fri, Apr 17, 2009 at 3:03 PM, snobo g...@riga.ahlers.com wrote: I've been trying to use remote method coupled with depends, like this: remote: { depends: function(element) { element.value = $.trim(element.value); return element.defaultValue != element.value; }, url: 'my.php', type: 'post', data: { action: 'check_user_name' } } and this doesn't work, because the whole remote parameter array gets overwritten with the result of evaluating my 'depends' function (so instead of array it becomes a scalar, true or false). Therefore in case of false the AJAX call doesn't happen, and in case of true an error occurs (because there's no url, no type, and no data anymore). I assume remote and depends are incompatible, is it correct? If yes, is there a workaround for this? TIA cheers
[jQuery] Re: Internet Explorer - my jQuery is not working
morningZ, you are very correct however what im after is particular things not fully compatible with IE 7 for example, maybe there's a guide or something stating those issues if anyone knows, please message me /pär On 17 Apr, 14:05, MorningZ morni...@gmail.com wrote: Somewhere there is a problem with your code or syntax without posting more information than not working or examples of what you are trying to do and how you are doing it makes it absolutely impossible for others to help you On Apr 17, 7:40 am, hybris77 dist...@yahoo.com wrote: anyone aware of what is the problem with my jQuery code that makes it nor run in IE? are there particular issues to be aware of? /pär
[jQuery] jQuery AIR stripped
Someone might have already asked this, but I could not find anything. Has there been any thought given to providing a dist of jQuery which has all cross-browser functionality and checks stripped, specifically for AIR? While those checks are limited and as streamlined as possible, would it not allow the most speed to be squeezed out of jQ in AIR?
[jQuery] Re: jQuery AIR stripped
Interesting concept. I doubt that the jQuery team itself would approach that project as it would require forked code, but it might be a fun project for an individual. andy -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Spot Sent: Friday, April 17, 2009 9:05 AM To: jQuery (English) Subject: [jQuery] jQuery AIR stripped Someone might have already asked this, but I could not find anything. Has there been any thought given to providing a dist of jQuery which has all cross-browser functionality and checks stripped, specifically for AIR? While those checks are limited and as streamlined as possible, would it not allow the most speed to be squeezed out of jQ in AIR?
[jQuery] Re: [validate] remote vs depends
Ok, that makes it a bit more difficult. For a workaround, try something like this: $.validator.addMethod(customRemote, function(value, element) { if (!remoteRequired(element) { return dependency-mismatch; } return $.validator.methods.remote.apply(this, arguments); }, $.validator.messages.remote); The idea is to write a custom method that does the dependency-check. If it isn't necessary, return a special string to have the plugin skip the method. Otherwise, delegate to the default remote method to perform its task. Let me know if that works for you, might be worthwhile adding to the docs (until depends/remote is fixed). Jörn On Fri, Apr 17, 2009 at 3:34 PM, snobo g...@riga.ahlers.com wrote: well, I don't see how required can help me... what I want is to make a remote call/check ONLY under certain circumstances. Plus, this field is constantly-required already anyway... actually, now I think there might be various workarounds, e.g. creating a custom method, which would check the condition first and then making an AJAX call manually only if needed... On Apr 17, 4:16 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: This is indeed a bug, in this case something never tested for. Is using required: function() {} together with remote an option? Jörn On Fri, Apr 17, 2009 at 3:03 PM, snobo g...@riga.ahlers.com wrote: I've been trying to use remote method coupled with depends, like this: remote: { depends: function(element) { element.value = $.trim(element.value); return element.defaultValue != element.value; }, url: 'my.php', type: 'post', data: { action: 'check_user_name' } } and this doesn't work, because the whole remote parameter array gets overwritten with the result of evaluating my 'depends' function (so instead of array it becomes a scalar, true or false). Therefore in case of false the AJAX call doesn't happen, and in case of true an error occurs (because there's no url, no type, and no data anymore). I assume remote and depends are incompatible, is it correct? If yes, is there a workaround for this? TIA cheers
[jQuery] Re: jQuery AIR stripped
Yeah, I can see why they would not be interested, but it might be pretty easy to mark cross browser checks, so that they can be parsed out. It wouldn't allow you to strip everything, but would think the browser checks could possibly be stripped. However I could be completely off. :) Andy Matthews wrote: Interesting concept. I doubt that the jQuery team itself would approach that project as it would require forked code, but it might be a fun project for an individual. andy -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Spot Sent: Friday, April 17, 2009 9:05 AM To: jQuery (English) Subject: [jQuery] jQuery AIR stripped Someone might have already asked this, but I could not find anything. Has there been any thought given to providing a dist of jQuery which has all cross-browser functionality and checks stripped, specifically for AIR? While those checks are limited and as streamlined as possible, would it not allow the most speed to be squeezed out of jQ in AIR?
[jQuery] Re: cluetip ajax authentication
Thanks a lot for bringing this to my attention. I'm working on this one now. I think I have something in place, but need to test it. Basically, all the ajax callback functions will execute the one passed in through the options object first, before anything that needs to be done within the plugin itself. The only exception will be the error callback, which will override the plugin's function. How does that sound? I'll post an update when I think I have something working. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 16, 2009, at 8:51 PM, DotnetShadow wrote: Hi there, I've been using cluetip calling an ajax page. The problem I am finding is that the ajax page is part of forms authentication so if this expires and a person hovers over an element to display the cluetip it will try and request the ajax page but come up with NTLM prompt. How can I detect that the ajax page tried to redirect to login page and suppress the NTLM username/password prompt? Regards DotnetShadow
[jQuery] Re: cluetip IE8 very slow adding to table rows
Not sure what's going on there, to be honest. I'll have to take a look as soon as I find some more time. It might just be that binding cluetip to a whole lot of elements won't work. I've used event delegation to get around this sort of problem with other plugins, but unfortunately I can't do it here without a complete re-architecting of the plugin and the elimination of the hoverIntent feature. I don't think this will improve performance, but you could write your script like this: $(document).ready(function() { $(.user).cluetip(); }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 16, 2009, at 11:07 AM, DotnetShadow wrote: Hi there, I've recently been using cluetip on a datable of about 400 rows. Recently I tested this against IE8 and found it very very slow. Doing simply the following: $(document).ready(function() { $(.user).each(function(i) { $(this).cluetip(); } }); Basically for each row in my table (400 rows) it would attach the cluetip to it. In IE8 it would freeze the browser for a good minute, if I pushed the compatibility mode button to run in IE7 mode it worked as expected. In all other browsers it worked perfectly. Is there something different going on with IE8? Thanks in advance DotnetShadow
[jQuery] Re: need help with jqGrid
Hello, The version of jquery 1.3.1 that you use is not compatible with jqGrid version 3.4 Download the latest 3.4.3 version of jqGrid On Apr 17, 2:51 pm, Led l.r@sapo.pt wrote: tony , check that is not that. On 17 Abr, 11:46, Tony t...@trirand.com wrote: Hello, Already replayed. Please check your code - you have a unneeded coma in colModel Regards Tony On Apr 17, 1:33 pm, led l.r@sapo.pt wrote: I' m trying to use the jquery jqGrid plugin but i can't see it working with ASP code. this is the xml generated file. rows page /page total /total records114/records row id=191 cell191/cell cell15/cell /row row id=192 cell192/cell cell15/cell /row row id=193 cell193/cell cell15/cell /row /rows and this is the html: html head titlejqGrid Demo/title link rel=stylesheet type=text/css media=screen href=/jqgrid/ themes/basic/grid.css / link rel=stylesheet type=text/css media=screen href=themes/ jqModal.css / script src=/jqgrid/jquery.js type=text/javascript/script script src=/jqgrid/jquery.jqGrid.js type=text/javascript/ script script src=/jqgrid/js/jqDnR.js type=text/javascript/script script src=/jqgrid/js/jqModal.js type=text/javascript/script script type=text/javascript jQuery(document).ready(function(){ jQuery(#list).jqGrid({ url:'listDisponibilidade.asp', datatype: 'xml', mtype: 'GET', colNames:['id','Cdigo'], colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, ], pager: jQuery('#pager'), rowNum:10, rowList:[10,20,30], sortname: 'id', sortorder: desc, viewrecords: true, imgpath: '/jqgrid/themes/basic/images', caption: 'My first grid' });}); /script /head body table id=list class=scroll/table div id=pager class=scroll style=text-align:center;/div /body /html I can't see what i'm doing wrong. Please help.- Ocultar texto citado - - Mostrar texto citado -
[jQuery] Re: How to rotate image (in degrees)?
Isn't there someone who knows of such a plugin, or a means to accomplish what I need? On Apr 16, 8:37 am, banacan banaca...@gmail.com wrote: Is there a jquery plugin that will allow an image to be rotated by say 90 - 180 degrees? I'm using it in my background (multiple times) and I want it to appear in different places and rotated so it doesn't appear to be the same image. TIA
[jQuery] Re: Internet Explorer - my jQuery is not working
hybris77 half of the web resources about web development is about issues related to IE. jQuery is correcting quite a few of them. Now you are having a specific issue with IE7, this is no surprise but there is no way to guess what it is. If you don t describe your issue, as morningZ said, there is no way to help you. hybris77 wrote: morningZ, you are very correct however what im after is particular things not fully compatible with IE 7 for example, maybe there's a guide or something stating those issues if anyone knows, please message me /pär On 17 Apr, 14:05, MorningZ morni...@gmail.com wrote: Somewhere there is a problem with your code or syntax without posting more information than not working or examples of what you are trying to do and how you are doing it makes it absolutely impossible for others to help you On Apr 17, 7:40 am, hybris77 dist...@yahoo.com wrote: anyone aware of what is the problem with my jQuery code that makes it nor run in IE? are there particular issues to be aware of? /pär
[jQuery] Re: passing more than 1 param via click()?
Here's a better example with HTML. See, I said it was hard to explain in the first place :). Ok, so basically think of this as a list of things where the HTML is always going to be the same, but there could be between 1 and N rows. I'm trying to remove the onClick, and target just the link's class so that when a specific link is licked, that specific row is removed. Here's some example HTML iterated: div id=123 h1Example A/h1 a href=#remove class=remove-link onclick=removeDept ('123','listA');return false;Remove/a /div div id=456 h1Example B/h1 a href=#remove class=remove-link onclick=remove ('456','listB');return false;Remove/a /div I want to take out the onClick. So here's what I got in the JavaScript: $(document).ready(function(){ // consider the example 123 as the dynamic ROW_ID // consider the example listA as the dynamic LIST_ID $(.remove-link).click(function(){ exampleAjaxFunction(ROW_ID,LIST_ID,function(){ // call back if deleted from DB $(this).parent().remove(); }); return false; }); }); And so my question is. I don't know how to pass ROW_ID and LIST_ID to the single function like the onClick could.. Normally with just one param to pass, I could grab it by targeting an a's rel attribute. But now there are TWO, and that's my point...There has to be a better way to get those than just getting attributes, and that's what I'm trying to figure out. Thanks for the help again everyone. On Apr 17, 12:15 am, Michael Geary m...@mg.to wrote: I must be missing something obvious, but it sounds like you're not just working with some predetermined HTML, but you have the flexibility to tweak that HTML code, is that right? Then why can't you generate this as part of your HTML page: script type=text/javascript // initialize some variables here /script That *is* HTML code, isn't it? -Mike From: kgosser I have two values that are only found in a loop in the HTML. They need to be passed to the single function in the document.ready(). I can't set them in the JavaScript. I have to find them somehow in the HTML. Whether I find them as hidden inputs or something, or as tags to the anchor, or as params passed in somehow. I'm not sure what's best.
[jQuery] Re: jQuery script simplification question
Hi Richard, Thanks for taking time out of your schedule to help me learn how to write simplified code! Cheers, Calvin On Thu, Apr 16, 2009 at 9:47 PM, Richard D. Worth rdwo...@gmail.com wrote: You only need one document.ready, and there's a shorthand: $(function() { $(li.one).click(function() { $(div.a).toggle(highlight, {}, 1000); }); $(li.two).click(function() { $(div.b).toggle(highlight, {}, 1000); }); $(li.three).click(function() { $(div.c).toggle(highlight, {}, 1000); }); }); If you're wanting to go even more minimal: $(function() { var hash = { one: a, two: b, three: c }; $(li.one,li.two,li.three).click(function() { $(div. + hash[this.className]).toggle(highlight, {}, 1000); }) }); - Richard On Fri, Apr 17, 2009 at 12:26 AM, Calvin cstephe...@gmail.com wrote: I'm having trouble simplifying my jQuery script... I tried but I am at beginner level with this stuff. Here is the jQuery script: $(document).ready(function() { (li.one).click(function() { $(div.a).toggle(highlight, {}, 1000); }); }); $(document).ready(function() { (li.two).click(function() { $(div.b).toggle(highlight, {}, 1000); }); }); $(document).ready(function() { (li.three).click(function() { $(div.c).toggle(highlight, {}, 1000); }); }); Here is the mark-up: ul li class=onetext/li li class=twotext/li li class=threetext/li /ul div class=atext/div div class=btext/div div class=ctext/div
[jQuery] Re: [validate] remote vs depends
Thanx a ton for the ultra-quick reply help! Worked like a charm, I did it like this: rules.UserName = { xRemote: { condition: function(element) { element.value = $.trim (element.value); return element.defaultValue != element.value; }, url: 'myurl.php', data: { action: 'check_user_name' } } } $.validator.addMethod(xRemote, function(value, element) { var rule = this.settings.rules[element.name].xRemote; if (rule.condition $.isFunction(rule.condition) ! rule.condition.call(this,element)) return dependency-mismatch; return $.validator.methods.remote.apply(this, arguments); }, $.validator.messages.remote); is this the correct way to reference the current rule? On Apr 17, 5:13 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Ok, that makes it a bit more difficult. For a workaround, try something like this: $.validator.addMethod(customRemote, function(value, element) { if (!remoteRequired(element) { return dependency-mismatch; } return $.validator.methods.remote.apply(this, arguments); }, $.validator.messages.remote); The idea is to write a custom method that does the dependency-check. If it isn't necessary, return a special string to have the plugin skip the method. Otherwise, delegate to the default remote method to perform its task. Let me know if that works for you, might be worthwhile adding to the docs (until depends/remote is fixed). Jörn On Fri, Apr 17, 2009 at 3:34 PM, snobo g...@riga.ahlers.com wrote: well, I don't see how required can help me... what I want is to make a remote call/check ONLY under certain circumstances. Plus, this field is constantly-required already anyway... actually, now I think there might be various workarounds, e.g. creating a custom method, which would check the condition first and then making an AJAX call manually only if needed... On Apr 17, 4:16 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: This is indeed a bug, in this case something never tested for. Is using required: function() {} together with remote an option? Jörn On Fri, Apr 17, 2009 at 3:03 PM, snobo g...@riga.ahlers.com wrote: I've been trying to use remote method coupled with depends, like this: remote: { depends: function(element) { element.value = $.trim(element.value); return element.defaultValue != element.value; }, url: 'my.php', type: 'post', data: { action: 'check_user_name' } } and this doesn't work, because the whole remote parameter array gets overwritten with the result of evaluating my 'depends' function (so instead of array it becomes a scalar, true or false). Therefore in case of false the AJAX call doesn't happen, and in case of true an error occurs (because there's no url, no type, and no data anymore). I assume remote and depends are incompatible, is it correct? If yes, is there a workaround for this? TIA cheers
[jQuery] Re: help with jqgrid
please tony , help me with that. I've made the change and still not working . Maybe i have to drop the plugin? On 17 Abr, 11:55, Tony t...@trirand.com wrote: Hello, Please see my previous mail, remove the comma at last item - ie. the col model should be colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55} ], and not colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, ], See the diffrence On Apr 17, 1:50 pm, Led l.r@sapo.pt wrote: i'm happy to contact with you. You have done a great job with this plugin , but i can't see it working. See the sample inhttp://realferias.com/jqgrid_demo.htm I'm trying to implement this in a project but the basic sample is not working. Again , please... On 17 Abr, 11:41, Tony t...@trirand.com wrote: Hello, The most common error when writing is the comma. You have colModel :[ {name:'id', index:'id', key:true, width:55}, {name:'cod_casa', index:'cod_casa', width:55}, --- Error ], Remove the comma and will be ok Regards Tony On Apr 17, 3:12 am, led l.r@sapo.pt wrote: b.jgrid is undefined . i'm having this error when everything seems to be in place . I'm just starting to try this plugin . http://realferias.com/jqgrid_demo.htm thanks- Ocultar texto citado - - Mostrar texto citado -- Ocultar texto citado - - Mostrar texto citado -
[jQuery] Re: remote vs depends
huh, only one minor thing... wicked things happen to the error messages. I specify a message for my input in the validate() call: messages: { UserName: { required: , remote: 'User name already exists or invalid' }, ... } so, in case the input value is invalid, my custom message is correctly displayed, but only on blur. On submit, when I click the submit button, the default message (Please fix this field) is displayed. How can this be fixed? On Apr 17, 6:02 pm, snobo g...@riga.ahlers.com wrote: Thanx a ton for the ultra-quick reply help! Worked like a charm, I did it like this: rules.UserName = { xRemote: { condition: function(element) { element.value = $.trim (element.value); return element.defaultValue != element.value; }, url: 'myurl.php', data: { action: 'check_user_name' } } } $.validator.addMethod(xRemote, function(value, element) { var rule = this.settings.rules[element.name].xRemote; if (rule.condition $.isFunction(rule.condition) ! rule.condition.call(this,element)) return dependency-mismatch; return $.validator.methods.remote.apply(this, arguments); }, $.validator.messages.remote); is this the correct way to reference the current rule? On Apr 17, 5:13 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: Ok, that makes it a bit more difficult. For a workaround, try something like this: $.validator.addMethod(customRemote, function(value, element) { if (!remoteRequired(element) { return dependency-mismatch; } return $.validator.methods.remote.apply(this, arguments); }, $.validator.messages.remote); The idea is to write a custom method that does the dependency-check. If it isn't necessary, return a special string to have the plugin skip the method. Otherwise, delegate to the default remote method to perform its task. Let me know if that works for you, might be worthwhile adding to the docs (until depends/remote is fixed). Jörn On Fri, Apr 17, 2009 at 3:34 PM, snobo g...@riga.ahlers.com wrote: well, I don't see how required can help me... what I want is to make a remote call/check ONLY under certain circumstances. Plus, this field is constantly-required already anyway... actually, now I think there might be various workarounds, e.g. creating a custom method, which would check the condition first and then making an AJAX call manually only if needed... On Apr 17, 4:16 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: This is indeed a bug, in this case something never tested for. Is using required: function() {} together with remote an option? Jörn On Fri, Apr 17, 2009 at 3:03 PM, snobo g...@riga.ahlers.com wrote: I've been trying to use remote method coupled with depends, like this: remote: { depends: function(element) { element.value = $.trim(element.value); return element.defaultValue != element.value; }, url: 'my.php', type: 'post', data: { action: 'check_user_name' } } and this doesn't work, because the whole remote parameter array gets overwritten with the result of evaluating my 'depends' function (so instead of array it becomes a scalar, true or false). Therefore in case of false the AJAX call doesn't happen, and in case of true an error occurs (because there's no url, no type, and no data anymore). I assume remote and depends are incompatible, is it correct? If yes, is there a workaround for this? TIA cheers
[jQuery] Re: Creating custom attributes in html
Josh, Since you aren't creating nodes, why not wait until after you insert the string of html onto the page, at which point you will have access to those nodes, so you can loop through them and set all of the corresponding properties on them using .data() or just the usual document.getElementById('id').property = value method? You could also store all of the data in an object with the element ids as keys, such as: var data_store = { elementId1: { name: name, type: type, about: about }, elementId2: { name: name, type: type, about: about } } Then it is easy to access that information by binding events to the elements that access data_store[this.id] On Apr 17, 5:50 am, RobG rg...@iinet.net.au wrote: On Apr 17, 3:34 pm, RobG rg...@iinet.net.au wrote: [...] OK, here is a dead basic proof of concept. Of course it is nowhere near production code, but I think you can see where it's going. I would wrap the entire thing in the module pattern, but I've just used basic globals at this stage. My intention is to show that efficient DOM manipulation is possible and that access to related data isn't hard. It took me about 45 minutes to write the entire thing (more than half of that was writing the function to generate the test data set), tested in Firefox 3 and IE 6 on a 3.4GHz Pentium 4, Windows XP, the insert runs in less than 500ms. I'll test it on the G4 iBook for reference later. Safari 4 on iBook takes around 132ms, Firefox was around 1900. [...] function showData(evt) { var evt = evt || window.event; var tgt = evt.target || evt.srcElement; var data; if (tgt tgt.tagName tgt.tagName.toLowerCase() == 'a') { data = dataObj[tgt.id]; // Should guard against error here if (typeof data != 'undefined') { // Have data related to this element, do // something with it alert( 'Name: ' + data.name + '\nType: ' + data.type + '\nAbout: ' + data.about ); } } } -- Rob
[jQuery] Re: How to rotate image (in degrees)?
This is going to require canvas. So a google search for 'rotate image javascript canvas' turned up: http://snippets.dzone.com/posts/show/5514 http://code.google.com/p/jquery-rotate/ http://wilq32.googlepages.com/wilq32.rollimage222 - Richard On Fri, Apr 17, 2009 at 10:44 AM, banacan banaca...@gmail.com wrote: Isn't there someone who knows of such a plugin, or a means to accomplish what I need? On Apr 16, 8:37 am, banacan banaca...@gmail.com wrote: Is there a jquery plugin that will allow an image to be rotated by say 90 - 180 degrees? I'm using it in my background (multiple times) and I want it to appear in different places and rotated so it doesn't appear to be the same image. TIA
[jQuery] CTRL+S to Insert Record PHP+JQUERY
Hi , Can u tell me , i have to create any div ID ? , Or simply paste this code ? jQuery(function($) { var pressed = {}; $(document).keydown(function(event) { // Capture the key being pressed var keyCode = event.keyCode; pressed[keyCode] = true; // Check if 'S' was pressed if (83 == keyCode) { // Check if Ctrl + S (Windows) or Command + S (Mac) was pressed if (pressed[17] || pressed[224]) { alert('Custom save dialog!'); event.preventDefault(); // prevent the default save dialog } } }); $(document).keyup(function(event) { delete pressed[event.keyCode]; }); }); -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] Re: Autocomplete problems with multiple fields
On 4/16/09 2:50 PM, Lance A. Brown la...@bearcircle.net wrote: I'm working on adding autocomplete to a form which describes a discussion paper. Each paper can have multiple authors and I want to provide autocomplete on the author names. I'm new to jQuery so this code is kind of rough. My java script is: // Begin function parse_search(data) { var result = []; for (var i = 0; i data.names.length; i++) { result[i] = { data: data.names[i].name, value: data.names[i].id, result: data.names[i].name }; } return result; } function format_item(row, i, max) { return row; } function set_author_autocomplete() { var searchurl = $(#authsearch_url).attr(href); $(.author_name).each(function (i) { $(this).autocomplete(searchurl, { dataType: 'json', parse: parse_search, what autocomplete plugin are you using? this one does not have a documented parse option: http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions formatItem: format_item } ) } ); } $(document).ready(set_author_autocomplete); //End two more points, though i don't know if they make any odds: it seems to be more conventional jq style (see http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery) to put all your jq script inside a block like this: $(document).ready(function() { }); and is there a reason to prefer: $(.author_name).each(function (i) { $(this).autocomplete(); }); over $(.author_name).autocomplete(); ?
[jQuery] fadeOut Callback Trigger Count
Callback function of fadeOut effect is executed once for each element animated against. Is it possible to make it executed once after all elements faded?
[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY
No need for a div with that code, the keyup and keydown events are observed at the document level. -Hector On Fri, Apr 17, 2009 at 8:52 AM, bharani kumar bharanikumariyer...@gmail.com wrote: Hi , Can u tell me , i have to create any div ID ? , Or simply paste this code ? jQuery(function($) { var pressed = {}; $(document).keydown(function(event) { // Capture the key being pressed var keyCode = event.keyCode; pressed[keyCode] = true; // Check if 'S' was pressed if (83 == keyCode) { // Check if Ctrl + S (Windows) or Command + S (Mac) was pressed if (pressed[17] || pressed[224]) { alert('Custom save dialog!'); event.preventDefault(); // prevent the default save dialog } } }); $(document).keyup(function(event) { delete pressed[event.keyCode]; }); }); -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] Re: Autocomplete problems with multiple fields
Tom Worster wrote: what autocomplete plugin are you using? this one does not have a documented parse option: http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions Its the standard autocomplete plugin available at http://docs.jquery.com/Plugins/Autocomplete I found the syntax for handling json data in it on another web page. two more points, though i don't know if they make any odds: it seems to be more conventional jq style (see http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery) to put all your jq script inside a block like this: $(document).ready(function() { }); I'm going to need to be able to call the autocomplete setup function again later so I pulled it into a separate function. and is there a reason to prefer: $(.author_name).each(function (i) { $(this).autocomplete(); }); over $(.author_name).autocomplete(); ? This was me struggling to figure out what was wrong with my code, which I did figure out this morning. I've removed the call to 'each'. And now for the solution to my problem. This bit of js: var searchurl = $(#authsearch_url).attr(href); extracts the url I'm giving to autocomplete from the web page, allowing me to use my templating system to set that URL. Idiot me failed to include that html fragment in the 2nd page, where I edit a paper, therefor causing autocomplete to fail because it had a bad url. Once I realized my error it was the work of a moment to correct things and get autocomplete working properly. --[Lance] -- GPG Fingerprint: 409B A409 A38D 92BF 15D9 6EEE 9A82 F2AC 69AC 07B9 CACert.org Assurer
[jQuery] Re: Creating custom attributes in html
On Apr 14, 3:34 pm, Ricardo ricardob...@gmail.com wrote: If you insert these attributes server-side, the page will not validate and might trigger quirks mode in the browser. Which browser? Thanks, Garrett
[jQuery] How can i access iframe content... and manupulate the elements from jquery script from parent ?
Need help!! How can i access iframe content... and manupulate the elements from jquery script from parent ? any ideas... ??
[jQuery] [validate] form with multiple buttons and multiple submit handlers
I've a paged form with back and next buttons on each form. Each button invokes an ajaxSubmit() using submitHandler. Next button should display next form using slideUp() and slideDown(). Back button should display previous form using slideUp() and slideDown (). Here's an example of 2nd form (step) with 2 buttons (back and next). HTML [code] form id=step2form button type=submit name=action value=back class=backlt; Back/button button type=submit name=action value=next class=nextNext gt;/button /form [/code] jQuery [code] $('#step2form button.back').click(function() { $('#step2form').validate({ submitHandler: function() { $('#step2form').ajaxSubmit(); $('#step1form').slideDown(500); $('#step2form').slideUp(500); } }); }); $('#step2form button.next').click(function() { $('#step2form').validate({ submitHandler: function() { $('#step2form').ajaxSubmit(); $('#step3form').slideDown(500); $('#step2form').slideUp(500); } }); }); [/code] The code looks the same for other forms. Bot buttons works fine on the very first submit of the form, regardless which button was clicked first. But on the subsequent submits of the same form, the initially used submitHandler seems to be used instead. I.e. when 'back' was first clicked and later when you click 'next' on the same form, then the submitHandler set by 'back' is been used instead (and vice versa). As far as my knowledge concerns, it look like that the submitHandler appends the new functions to the form's submit event instead of overriding/replacing them. This will cause that only the first functions will be used until it returns false. Should I see this as a bug or a feature? How can I solve/workaround this the best way?
[jQuery] Using message in $.blockUI
Hi all, I have some problem with code: When I try code like this: $('#showDialog').click(function() { $('#question').load('wait.php?ID=1NUMBER=1'); $.blockUI({message: $('#question'), css:{width:'275px'}}); }); I have some error in IE: Unexpected call to method or treatment to the property. How I can get content from wait.php and return it to message? Am trying this: $('#showDialog').click(function() { $.blockUI({ message: function() { $('#question').load('wait.php?ID=1NUMBER=1'); return $('#question'); }, css:{width:'275px'}}); }); and this: $('#showDialog').click(function() { $.blockUI({ message: function() { $('#question').load('wait.php?ID=1NUMBER=1'); return $('#question'); }, css:{width:'275px'}}); }); and this: $('#showDialog').click(function() { $.blockUI({ message: function() { $.ajax({url: 'wait.php?ID=374LOT_NUMBER=1', cache: false, success: function(msg) {return $('#question').html(msg);}}); return $('#question'); }, css:{width:'275px'}}); }); How I can do it correct? Help me please. Thanks a lot.
[jQuery] Re: How to select sub element text on clicking the parent element.
Problem: If that's actual code, you have duplicate IDs and nothing based on those IDs will fire correctly. In which case use classes instead. If they're all unique, your function doesn't handle them - and you'd need to loop through finding the one that fired the event, and *then* find the next-li text. Assuming this markup: div id=questions-page div class=question pquestions goes here/p ulliAnswer to it goes here/li/ul /div this should work: $(#questions-page p).click(function(){ var answer_text = $(this).next(li).text(); alert('Answer is'+answer_text); }); You don't need to ID/class everything either, in order to work with it. The #questions-page p finds all p's inside #questions-page, and when they're clicked on, it finds the next li after the clicked p, and gives you it's text. On Apr 16, 9:07 pm, Kapse kapse.nar...@gmail.com wrote: div id=questions-page div id=question pquestion1/p ul lianswer1/li /ul /div
[jQuery] Using jQuery On Widget Service For My Site
I would like to use jquery to add behaviors to a UI widget that people can grab from my site by copying a javascript snippet. I am wondering about best practices for this. Do I * Include a direct call to jquery bundled up with the snippet? * Do I use jQuery's no conflict and then namespace my widget (in case the snippet grabber already has jquery running on their page / site)? * Use document.write? * Or is it better to do inline javascript on the written html? Any advice is appreciated. Thanks.
[jQuery] Re: Iframe auto height
If I remember correctly, this is the script I used to auto-adjust the size of my iframes : http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm Good luck! On Apr 17, 7:19 am, Lauri B. lau...@gmail.com wrote: I can't find any cross browser solution for setting iframe height depending on its content.
[jQuery] Jquery content Scrolling
Hi, NOTE : I am using Mozilla FireFox 3 for this. Once i get this working popper I will do testing and correcting on Other Browsers. ( im sure IE6 will be the daemon here ) I am a bit new to jquery and as a test project i decided to create a content scroll-er. it works quite nicely but has a few bugs I'm trying to sort out. may someone could help me. the functionality works good you, however if you play around with clicking on the seeker bar and arrows for a a bit you will notice a bug...any thoughts ? Version Of Jquery : 1.3.2.min HTML MARKUP div id=container align=center div class=padding width-max txt-l div id=content-box div id=content class=float-l div The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. /div /div div id=scrollbar class=float-l span id=up/\/spanbr / div id=seek div id=seeker /div /div span id=down\//span /div /div /div /div CSS MARKUP html { width:100%; height:100%; } * { margin:0; padding:0; line-height:1.8em; } .width-max { width:600px; } .wdith { width:100%; } .padding { padding:10px; } .txt-l { text-align:left; } .float-l { float:left; } .clear-l { clear:left; } .none { height:0!important; width:0!Important; overflow:hidden!Important; border:medium none!important; font-size:0!Important; } #content { overflow:hidden; height:200px; width:200px; } #up, #down { cursor:pointer; } .height { height:auto!important; } #seek { height:200px; width:10px; background-color:#999; cursor:pointer; position:relative; } #seeker { width:10px; height:10px; background-color:#666; cursor:pointer; position:absolute; top:0; left:0; } JQUERY //![CDATA[ $(function() { /* STEP ONE : add class that contains the following style to the effected element height:auto!important this adjusts the element to its original height before the content is hidden so I can extract the maximum height */ $(#content).addClass(height); var height_max = $(#content).height(); /* STEP TWO: I remove the class i added so I may get the element back to its' desired height */
[jQuery] Jquery content Scroller
Hi, NOTE : I am using Mozilla FireFox 3 for this. Once i get this working popper I will do testing and correcting on Other Browsers. ( im sure IE6 will be the daemon here ) I am a bit new to jquery and as a test project i decided to create a content scroll-er. it works quite nicely but has a few bugs I'm trying to sort out. may someone could help me. the functionality works good you, however if you play around with clicking on the seeker bar and arrows for a a bit you will notice a bug...any thoughts ? Version Of Jquery : 1.3.2.min HTML MARKUP div id=container align=center div class=padding width-max txt-l div id=content-box div id=content class=float-l div The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. The Quick Brown Fox Jumped Over The Lazy Dog. /div /div div id=scrollbar class=float-l span id=up/\/spanbr / div id=seek div id=seeker /div /div span id=down\//span /div /div /div /div CSS MARKUP html { width:100%; height:100%; } * { margin:0; padding:0; line-height:1.8em; } .width-max { width:600px; } .wdith { width:100%; } .padding { padding:10px; } .txt-l { text-align:left; } .float-l { float:left; } .clear-l { clear:left; } .none { height:0!important; width:0!Important; overflow:hidden!Important; border:medium none!important; font-size:0!Important; } #content { overflow:hidden; height:200px; width:200px; } #up, #down { cursor:pointer; } .height { height:auto!important; } #seek { height:200px; width:10px; background-color:#999; cursor:pointer; position:relative; } #seeker { width:10px; height:10px; background-color:#666; cursor:pointer; position:absolute; top:0; left:0; } JQUERY //![CDATA[ $(function() { /* STEP ONE : add class that contains the following style to the effected element height:auto!important this adjusts the element to its original height before the content is hidden so I can extract the maximum height */ $(#content).addClass(height); var height_max = $(#content).height(); /* STEP TWO: I remove the class i added so I may get the element back to its' desired height */ $(#content).removeClass(height); /* I get the height of my seeker bar I did this so i could have it as
[jQuery] Forward and back buttons for a gallery
Hello, I would greatly appreciate any help I can get. I currently have an image gallery that is navigated by clicking on numbers 1 through 'n' (n being the last photo). When you click on the number the image is loaded into a div and the clicked numbers class is changed to active. This works fine. What I am trying to do is add a forward and back option after the 1 | 2 | 3 | 4 | ... | n navigation. If you click on the '' back link the previous image will load and it's respective link will become active. If you click the '' forward link the next image will load and the link will become active. I also need to make sure that the back and forward links will not work if the first or last images, respectively, have been loaded.
[jQuery] Newbie Question - Show/Hide on a:link
Hi guys -- very basic question here I think. I've got some documentation and a book in front of me, but I can't get this to work! I want to click the Welcome nav item to show the div named welcome on the page. If I use just the hide line of code, the page loads up with the DIV hidden properly. But, once I add the click/show code -- nothing happens, including the hide onLoad. Thoughts? Thanks so much! $(document).ready(function() { $(#welcome).hide(); ${a.welcomenav).click(function() { $(#welcome).show(); return false; }); }); ul id=sliding-navigation li class=sliding-elementa href=# class=welcomenavWelcome/a/li /ul
[jQuery] Re: Autocomplete problems with multiple fields
On 4/17/09 12:49 PM, Lance A. Brown la...@bearcircle.net wrote: Tom Worster wrote: what autocomplete plugin are you using? this one does not have a documented parse option: http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions Its the standard autocomplete plugin available at http://docs.jquery.com/Plugins/Autocomplete I found the syntax for handling json data in it on another web page. standard warnings on using undocumented api features apply.
[jQuery] [validate] form with multiple buttons and multiple submit handlers
I thought I already have added the [validate] tag to the subject? Anyway, now it's done again. On Apr 17, 12:31 pm, BalusC bal...@gmail.com wrote: I've a paged form with back and next buttons on each form. Each button invokes an ajaxSubmit() using submitHandler. Next button should display next form using slideUp() and slideDown(). Back button should display previous form using slideUp() and slideDown (). Here's an example of 2nd form (step) with 2 buttons (back and next). HTML [code] form id=step2form button type=submit name=action value=back class=backlt; Back/button button type=submit name=action value=next class=nextNext gt;/button /form [/code] jQuery [code] $('#step2form button.back').click(function() { $('#step2form').validate({ submitHandler: function() { $('#step2form').ajaxSubmit(); $('#step1form').slideDown(500); $('#step2form').slideUp(500); } }); }); $('#step2form button.next').click(function() { $('#step2form').validate({ submitHandler: function() { $('#step2form').ajaxSubmit(); $('#step3form').slideDown(500); $('#step2form').slideUp(500); } }); }); [/code] The code looks the same for other forms. Bot buttons works fine on the very first submit of the form, regardless which button was clicked first. But on the subsequent submits of the same form, the initially used submitHandler seems to be used instead. I.e. when 'back' was first clicked and later when you click 'next' on the same form, then the submitHandler set by 'back' is been used instead (and vice versa). As far as my knowledge concerns, it look like that the submitHandler appends the new functions to the form's submit event instead of overriding/replacing them. This will cause that only the first functions will be used until it returns false. Should I see this as a bug or a feature? How can I solve/workaround this the best way?
[jQuery] Re: cluetip ajax authentication
Okay, tested the new version and it seems to be working well. Please give it a shot and let me know if you run into any problems: http://github.com/kswedberg/jquery-cluetip/tree/master thanks! --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 17, 2009, at 10:30 AM, Karl Swedberg wrote: Thanks a lot for bringing this to my attention. I'm working on this one now. I think I have something in place, but need to test it. Basically, all the ajax callback functions will execute the one passed in through the options object first, before anything that needs to be done within the plugin itself. The only exception will be the error callback, which will override the plugin's function. How does that sound? I'll post an update when I think I have something working. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 16, 2009, at 8:51 PM, DotnetShadow wrote: Hi there, I've been using cluetip calling an ajax page. The problem I am finding is that the ajax page is part of forms authentication so if this expires and a person hovers over an element to display the cluetip it will try and request the ajax page but come up with NTLM prompt. How can I detect that the ajax page tried to redirect to login page and suppress the NTLM username/password prompt? Regards DotnetShadow
[jQuery] Change li class to current and remove all other current classes onclick
I have already read the similar post in this group, and have scoured the internet in search of an answer, but nothing is working for me! My website is all contained on one page. I have the jQuery lavalamp menu at the top of the page with the About Me tab set to class=current when the page loads. When you click the tabs it scrolls to the appropriate part of the page. Basically, when you click one of the li's, I want it's class to be changed to current and the previously selected tab to remove it's current class. This is my HTML: div id=menu ul class=menu li class=currenta href=#aboutAbout Me/a/li lia href=#portfolioMy Portfolio/a/li lia href=#contactContact Me/a/li /ul /div Thanks a lot, Mat.
[jQuery] Re: Works in IE7 but not IE6
Well, my jQuery tests didn't work and I thought they were very simple but I can try an alert test.
[jQuery] Re: Newbie Question - Show/Hide on a:link
Try using toggle instead: ${a.welcomenav).toggle(function(){ $(#welcome).show(); return false; },function(){ $(#welcome).hide(); return false; }); -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of KetanMV Sent: Friday, April 17, 2009 11:36 AM To: jQuery (English) Subject: [jQuery] Newbie Question - Show/Hide on a:link Hi guys -- very basic question here I think. I've got some documentation and a book in front of me, but I can't get this to work! I want to click the Welcome nav item to show the div named welcome on the page. If I use just the hide line of code, the page loads up with the DIV hidden properly. But, once I add the click/show code -- nothing happens, including the hide onLoad. Thoughts? Thanks so much! $(document).ready(function() { $(#welcome).hide(); ${a.welcomenav).click(function() { $(#welcome).show(); return false; }); }); ul id=sliding-navigation li class=sliding-elementa href=# class=welcomenavWelcome/a/li /ul
[jQuery] Re: Change li class to current and remove all other current classes onclick
Hi Mat, Try this: $('#menu li').click(function() { $(this).addClass('current').siblings().removeClass('current'); }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 17, 2009, at 1:11 PM, Mat wrote: I have already read the similar post in this group, and have scoured the internet in search of an answer, but nothing is working for me! My website is all contained on one page. I have the jQuery lavalamp menu at the top of the page with the About Me tab set to class=current when the page loads. When you click the tabs it scrolls to the appropriate part of the page. Basically, when you click one of the li's, I want it's class to be changed to current and the previously selected tab to remove it's current class. This is my HTML: div id=menu ul class=menu li class=currenta href=#aboutAbout Me/a/li lia href=#portfolioMy Portfolio/a/li lia href=#contactContact Me/a/li /ul /div Thanks a lot, Mat.
[jQuery] Re: Setting a newly inserted option as the selected option
Thanks Raja. That worked! For reference, I also needed to put something in place to wait until the .trigger('refreshOpts'); call had completed. The use of animate() as a sort of sleep routine is a bit of a kludge, since it seems .trigger() doesn't implement a callback, so I wound up with this: $(#addRefForm).submit(function() { var author = $(#author).val() var detail = $(#detail).val() var refYear = $(#refYear).val() var refType = $(#refType option:selected).val() var newReference = 1 $.post('index.cfm?view=saveReferenceFromPopup', { author:author, detail:detail, refYear:refYear, refType:refType, newReference:newReference }, function(data,status) { // console.log(status) if(status == 'success'){ $(#refSelectBox).trigger('refreshOpts'); $(#refSelectBox).animate({opacity: 1.0}, 950, function(){ $(#refSelectBox option:selected).removeAttr(selected); $(#refSelectBox option[text^= + author + ]).attr (selected,selected); }); } } ); On Apr 17, 2:40 pm, Raja Koduru kscr...@gmail.com wrote: $(#refSelectBox option[text^= + author + ]).attr(selected,selected); I guess the above is doable. let me know. - raja koduru On Thu, Apr 16, 2009 at 11:16 PM,Nandod.na...@gmail.com wrote: I'd like set a newly inserted option in a select box as the selected option. I'm trying to use jQuery to select the option using the option text, which begins with the author name as defined in the function. In the examples I've found, $(#refSelectBox option[text^=author]) would presumably select any option that begins with the literal author, but I need it evaluated instead. Given the following ... $(#addRefForm).submit(function() { var author = $(#author).val() var detail = $(#detail).val() var refYear = $(#refYear).val() var refType = $(#refType option:selected).val() var newReference = 1 $.post('index.cfm?view=saveReferenceFromPopup', { author:author, detail:detail, refYear:refYear, refType:refType, newReference:newReference }, function(data,status) { if(status == 'success'){ $(#refSelectBox).trigger('refreshOpts'); $(#refSelectBox option[text^=author]).attr (selected,selected); } } ); $('#dialog').dialog('close'); return false; }); ... how to select the newly inserted option in #refSelectBox using the text attribute and set it to the selected option? Any alternate suggestions are most welcome! Thanks, Nando
[jQuery] Re: fadeOut Callback Trigger Count
This problem occurs when $(#menu li a).fadeOut(function() {}); being used. callback function is called 3 times 'cos there is 3 li elements. On Apr 17, 7:28 pm, blockedmind blockedm...@gmail.com wrote: Callback function of fadeOut effect is executed once for each element animated against. Is it possible to make it executed once after all elements faded?
[jQuery] Re: question about dealing with JSON callback
- the dataType is JSON, not json. (I pointed this out earlier in this thread) I noticed what sneaks did, I also noticed you had pointed it out, which is why my comment was in direct reply to sneaks post about the 'object side' and removing the quotes (check the quoted text in my post to see that it was for that post specifically) and was predicated on the assumption that he'd read and applied your suggestion. It was simply an FYI for him that that terminology ('object side') didn't make sense, and that the now-resolved object works perfectly fine with quotes on the name portion of the name-value pairs. I understand how jQuery handles the response, that's why I further indicated using the correct type in my follow up; I also understand that you can't eval an object. Neither of those have anything to do with my direct comment to sneaks. OK. I think this clarifies that |json| is not an object, but a string. No, it clarifies that an ajax responseText formatted as JSON is a string, but that was never in question, as I've indicated above. As far as we're clarifying however: JSON isn't a string, it's text. The responseText from an ajax call is a string, and it may be in JSON format or it may not. If you want to quibble about whether the resolved object should then be called JSON that's fine, but also totally beside the point. On Apr 17, 12:56 am, dhtml dhtmlkitc...@gmail.com wrote: On Apr 16, 5:14 pm, mkmanning michaell...@gmail.com wrote: As I said before: it's a string until it's eval'd, which happens with the 'json' response type within jQuery, or as I said you can eval the Notice carefully what 'sneaks' used for his dataType: jQuery.post( /wp/wp-admin/admin-ajax.php, { action: getProductInfo, 'cookie': encodeURIComponent(document.cookie), 'product_id': product_id },function(obj) { jQuery.each(obj, function(i, val) { jQuery('#' + i).attr('value',val); }); },JSON); } - the dataType is JSON, not json. (I pointed this out earlier in this thread) So, the conditional below is false and following statement does not execute:- | [...] | if ( type == json ) | data = window[eval](( + data + )); | return data; | }, What happens in this case is that jQuery.ajax does not handle a case for dataType == JSON and passes the xhr's responseText through to the callback function. Identifier json holds a string value. Sneaks resolved his issue by using eval directly, as: var obj=eval('('+json+')'); If |json| is an object, that would be interpreted as:- eval(([object Object])); - which would result in EvalError. OK. I think this clarifies that |json| is not an object, but a string. Garrett
[jQuery] Re: Internet Explorer - my jQuery is not working
There aren't really any major issues with jQuery and IE to be aware of. If there are, they are considered jQuery bugs because the point of jQuery is to make sure that whatever you're doing is cross-browser capable. If you are having issues, post your code and you may find your answer. On Apr 17, 1:40 am, hybris77 dist...@yahoo.com wrote: anyone aware of what is the problem with my jQuery code that makes it nor run in IE? are there particular issues to be aware of? /pär
[jQuery] jQuery Accordion IE8 issue
Hi all, I have the jQuery Accordion from the UI running here: http://distantelegy.net/clients/ebip It works fine in all the browsers I've tested except IE8. When I mouse over any of the moving pieces, I get an Invalid argument error. It references line 1061 in the development code, which is inside attr: function( elem, name, value ) at this line: elem[ name ] = value; I'm not sure if there's anything I can do about this. Does anyone know? Thanks, Danny
[jQuery] AJAX Problem
Hey folks, I noticed that when I was using $.ajax() on a $('a').click () to pull up an external page (eg stats.php within the same folkder) within a div called #main_content that any link that was pulled up in that would not have the same effects as outside of it. Is there a way to pass the inheritance over to the links in the in div that is holding the new page? I appreciate any advice before hand!
[jQuery] Re: form with multiple buttons and multiple submit handlers
OK, I solved it the following way without using the submit handler: [code] $('#step2form button.back').click(function() { if ($('#step2form').validate().form()) { $('#step2form').ajaxSubmit(); $('#step1form').slideDown(500); $('#step2form').slideUp(500); } return false; }); $('#step2form button.next').click(function() { if ($('#step2form').validate().form()) { $('#step2form').ajaxSubmit(); $('#step3form').slideDown(500); $('#step2form').slideUp(500); } return false; }); [/code] On Apr 17, 1:23 pm, BalusC bal...@gmail.com wrote: I thought I already have added the [validate] tag to the subject? Anyway, now it's done again. On Apr 17, 12:31 pm, BalusC bal...@gmail.com wrote: I've a paged form with back and next buttons on each form. Each button invokes an ajaxSubmit() using submitHandler. Next button should display next form using slideUp() and slideDown(). Back button should display previous form using slideUp() and slideDown (). Here's an example of 2nd form (step) with 2 buttons (back and next). HTML [code] form id=step2form button type=submit name=action value=back class=backlt; Back/button button type=submit name=action value=next class=nextNext gt;/button /form [/code] jQuery [code] $('#step2form button.back').click(function() { $('#step2form').validate({ submitHandler: function() { $('#step2form').ajaxSubmit(); $('#step1form').slideDown(500); $('#step2form').slideUp(500); } }); }); $('#step2form button.next').click(function() { $('#step2form').validate({ submitHandler: function() { $('#step2form').ajaxSubmit(); $('#step3form').slideDown(500); $('#step2form').slideUp(500); } }); }); [/code] The code looks the same for other forms. Bot buttons works fine on the very first submit of the form, regardless which button was clicked first. But on the subsequent submits of the same form, the initially used submitHandler seems to be used instead. I.e. when 'back' was first clicked and later when you click 'next' on the same form, then the submitHandler set by 'back' is been used instead (and vice versa). As far as my knowledge concerns, it look like that the submitHandler appends the new functions to the form's submit event instead of overriding/replacing them. This will cause that only the first functions will be used until it returns false. Should I see this as a bug or a feature? How can I solve/workaround this the best way?
[jQuery] I need some hints
Hi all! I'm developing an php and jQuery based grid (something like this: http://www.phpgrid.com/grid/) for my Thesises and I want to coloring the table row if the mouse over the row. You know, this is the minimal visual feature what is following the users eyes... I tried with css (tr class=css_class with :hover) and jQuery (every tr tag has id and .addClasses and .removeClasses) but I could'nt. I'm not an css and jquery magician. :$ So, I need some hints how can I do this with jquery. Or you can give some tutorial or examples. Appreciate yours help! András -- - - -- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando -- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell
[jQuery] Re: clueTip plugin - onClose option in the API?
Brilliant! Thanks Karl! Have a great weekend and thanks for writing such a sweet jquery plugin. On Apr 16, 6:38 pm, Karl Swedberg k...@englishrules.com wrote: Hi there, The plugin already has an onHide option. I just fixed it so that within onHide's anonymous function this will be the invoking element. so, your additional option would be : onHide: function() { $(this).parent().removeClass('selectedCell'); }) You can grab the updated plugin on GitHub: http://github.com/kswedberg/jquery-cluetip/tree/master --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Apr 16, 2009, at 1:51 PM, tatlar wrote: Hi there, I am using Karl's clueTip plugin in a table. When the user clicks a link in the table, the clueTip pops up, and the CSS of the table cell changes using the addClass method (adds a class called 'selectedCell'). This is all well and groovy, but what I want to do in addition, is that when the user closes the clueTip window, the CSS of the selected table cell reverts to its previous class. I was looking for an onClose in the clueTip API options list and could not find one. Does anyone know how I could achieve this desired behavior? What I have right now is that when the user clicks one cell all the current table cells are reset (have the class removed) and then a class is applied ('selectedCell'). When another a link is clicked in the table, all the current table cells with that class have it removed, and the newly clicked cell has the class applied: $(a.jTip).click( function() { $('table tbody tr td').removeClass('selectedCell'); $(this).parent().addClass('selectedCell'); } clueTip is called thus: $(a.jTip).cluetip({ cluetipClass: 'jtip', arrows: true, hoverIntent: false, mouseOutClose: true, sticky: true, activation: 'click', splitTitle: '|', closeText: 'X', closePosition: 'title', tracking: true, showTitle: true }) ; I want to add another option (in pseudo-code): onClose: function(e) { e.parent().removeClass('selectedCell') } Is this worth modifying the plugin for? Am I even going about this the right way? Thanks in advance.
[jQuery] Cascade plugin help
I am new to jquery and I need to make a form that allows a user to select a state and a city that they go to school in. I am using the cascade juqery plug-in (http://plugins.jquery.com/project/cascade. Which I think is a great plugin) The problem is there is a lot of data and it takes a long time for it all to load (some 28,000 records). What I want to do is split it up into different files and then load only the file that contains the data for that start/region. A sample of my code is blow: My html: div class=container-1 label for=rsvp_stateState/label select id=rsvp_state option value=Pick a State/option option value=OROregon/option option value=WAWashington/option option value=CACalifornia/option /select /div div class=container-2 label for=rsvp_cityPick a City/label select id=rsvp_city /select /div //below are the different loads that contain different data based on the state var OR = { ajax: {url: ‘orData.js' }, template: commonTemplate, match: commonMatch }; var WA = { ajax: {url: ‘waData.js' }, template: commonTemplate, match: commonMatch }; var opts = { ajax: {url: ‘otherData.js' }, template: commonTemplate, match: commonMatch }; $(document).ready(function() { var currentState; // #rsvp_state refers to a dropdown menu that contains all the states //what I want to do with this is determine what state is currently // selected and store that in a variable $('#rsvp_state').change(function(){currentState = $ ('#rsvp_state').val();}); jQuery(.container-2 select).each(function() { var child = jQuery(this); child.parents(.container-2:first).siblings(.container-1).find (select).each(function() { //below I want to compare the verable to the different options I have above if(currentState == 'OR'){ child.cascade(jQuery(this),OR); } if(currentState == 'WA'){ child.cascade(jQuery(this),WA); } else{ child.cascade(jQuery(this),opts); } }); }); //below is a sample line from orData.js {'When':'Portland','Value':'123','Text':'Benson Highschool'}] Any help is greatly appreciated. -Chris
[jQuery] Re: binding after .get()
On Apr 16, 2009, at 11:27 AM, hphoeksma wrote: Hi Donny, thanks for your reply. This will lead to lots of extra code I guess... Would there be another way? See the FAQ for more information: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: AJAX Problem
You have run into a fairly common issue: how to get events to work with elements that are added to the DOM, through either ajax or simple DOM mainpulation, after the document ready code has already fired. This FAQ topic should answer your question: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F If you still have problems after reading through it and trying one of the many solutions, let us know. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 17, 2009, at 2:28 PM, Rogue Lord wrote: Hey folks, I noticed that when I was using $.ajax() on a $('a').click () to pull up an external page (eg stats.php within the same folkder) within a div called #main_content that any link that was pulled up in that would not have the same effects as outside of it. Is there a way to pass the inheritance over to the links in the in div that is holding the new page? I appreciate any advice before hand!
[jQuery] unsubscribe please
I have been trying to unsubscribe but there is always a bounce-back. __ Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail. Click on Options in Mail and switch to New Mail today or register for free at http://mail.yahoo.ca
[jQuery] Re: Autocomplete problems with multiple fields
Tom Worster wrote: On 4/17/09 12:49 PM, Lance A. Brown la...@bearcircle.net wrote: I found the syntax for handling json data in it on another web page. standard warnings on using undocumented api features apply. It's undocumented in the autocomplete API but is a clearly documented option in the jQuery.ajax options. autocomplete simply passes it through. --[Lance] -- GPG Fingerprint: 409B A409 A38D 92BF 15D9 6EEE 9A82 F2AC 69AC 07B9 CACert.org Assurer
[jQuery] Re: binding after .get()
If you're using a current version of jQuery, then the liveQuery method is for you. http://docs.jquery.com/Events/live#typefn _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Karl Swedberg Sent: Friday, April 17, 2009 1:51 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: binding after .get() On Apr 16, 2009, at 11:27 AM, hphoeksma wrote: Hi Donny, thanks for your reply. This will lead to lots of extra code I guess... Would there be another way? See the FAQ for more information: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_work ing_after_an_AJAX_request.3F --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: unsubscribe please
Have you tried using the Google Groups interface? _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Johnny Lombardo Sent: Friday, April 17, 2009 2:01 PM To: jquery-en@googlegroups.com Subject: [jQuery] unsubscribe please I have been trying to unsubscribe but there is always a bounce-back. _ http://us.i1.yimg.com/us.yimg.com/i/ca/iotg_search.jpg http://ca.toolbar.yahoo.com/ Yahoo! Canada Toolbar : Search from anywhere on the web and bookmark your favourite sites. Download it now!
[jQuery] Re: Selector questions
On Apr 16, 2009, at 8:26 AM, Dragon-Fly999 wrote: Instead of using $(this).parent().parent().find(':checkbox'), is there a way to select using the following rule: Go up the hierarchy (regardless of how many parents there are) until the first a is found, then give me a list of all the checkboxes that are the descendants of the div right after the a. Unfortunately, given your markup, you can't do that, since a is not an ancestor of $(this). It's a previous sibling of one of the ancestor divs. Leonardo's suggestion to give the wrapper div a class name is what I'd also suggest. You could then use .closest('div.wrapper') as he recommends, or .parents('div.wrapper:first') --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Cascade plugin help
I forgot to say what my issue is. It dose load anything if I remove the if statments it works fine. On Apr 17, 11:50 am, Chrisw chris.p.wel...@gmail.com wrote: I am new to jquery and I need to make a form that allows a user to select a state and a city that they go to school in. I am using thecascadejuqery plug-in (http://plugins.jquery.com/project/cascade. Which I think is a greatplugin) The problem is there is a lot of data and it takes a long time for it all to load (some 28,000 records). What I want to do is split it up into different files and then load only the file that contains the data for that start/region. A sample of my code is blow: My html: div class=container-1 label for=rsvp_stateState/label select id=rsvp_state option value=Pick a State/option option value=OROregon/option option value=WAWashington/option option value=CACalifornia/option /select /div div class=container-2 label for=rsvp_cityPick a City/label select id=rsvp_city /select /div //below are the different loads that contain different data based on the state var OR = { ajax: {url: ‘orData.js' }, template: commonTemplate, match: commonMatch }; var WA = { ajax: {url: ‘waData.js' }, template: commonTemplate, match: commonMatch }; var opts = { ajax: {url: ‘otherData.js' }, template: commonTemplate, match: commonMatch }; $(document).ready(function() { var currentState; // #rsvp_state refers to a dropdown menu that contains all the states //what I want to do with this is determine what state is currently // selected and store that in a variable $('#rsvp_state').change(function(){currentState = $ ('#rsvp_state').val();}); jQuery(.container-2 select).each(function() { var child = jQuery(this); child.parents(.container-2:first).siblings(.container-1).find (select).each(function() { //below I want to compare the verable to the different options I have above if(currentState == 'OR'){ child.cascade(jQuery(this),OR); } if(currentState == 'WA'){ child.cascade(jQuery(this),WA); } else{ child.cascade(jQuery(this),opts); } }); }); //below is a sample line from orData.js {'When':'Portland','Value':'123','Text':'Benson Highschool'}] Any help is greatly appreciated. -Chris
[jQuery] Re: unsubscribe please
Hi, The following instructions are paraphrased from: http://groups.google.com/support/bin/answer.py?hl=enanswer=46608 You can unsubscribe from a group through the web interface or via email. To unsubscribe through the web interface, just click the Edit my membership link on the right-hand side of the group's homepage at http://groups.google.com/group/jquery-en/ . Then click the Unsubscribe button on the page that appears. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 17, 2009, at 3:00 PM, Johnny Lombardo wrote: I have been trying to unsubscribe but there is always a bounce-back. Yahoo! Canada Toolbar : Search from anywhere on the web and bookmark your favourite sites. Download it now!
[jQuery] Re: I need some hints
How about working the other way... You provide a small sample of your table HTML, and then someone could provide CSS or jQuery help, as there is no idea why CSS's :hover wouldn't work unless it's not leveraged properly like a super simple example :-) table id=T1 trtdRow 1/td/tr trtdRow 2/td/tr trtdRow 3/td/tr table .T1 tr:hover td { color: #ff; } On Apr 17, 2:41 pm, András Csányi sayusi.a...@gmail.com wrote: Hi all! I'm developing an php and jQuery based grid (something like this:http://www.phpgrid.com/grid/) for my Thesises and I want to coloring the table row if the mouse over the row. You know, this is the minimal visual feature what is following the users eyes... I tried with css (tr class=css_class with :hover) and jQuery (every tr tag has id and .addClasses and .removeClasses) but I could'nt. I'm not an css and jquery magician. :$ So, I need some hints how can I do this with jquery. Or you can give some tutorial or examples. Appreciate yours help! András -- - - -- Csanyi Andras --http://sayusi.hu-- Sayusi Ando -- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell