[jQuery] Re: Var from Ajax success not defined?
var how_many_checked= ''; $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ //alert(msg); how_many_checked = msg; } }); alert(how_many_checked); if(how_many_checked !=undefined) { do some.. } On Wed, Feb 25, 2009 at 5:31 PM, heohni heidi.anselstet...@consultingteam.de wrote: Hi, $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ //alert(msg); var how_many_checked = msg; } }); alert(how_many_checked); if(how_many_checked 0) ... the FF returns how_many_checked ist not defined. Why? How can I define a var and use it for a later coming if / else part? Thanks a bunch!
[jQuery] Re: Var from Ajax success not defined?
you try alert(check_how_many_products_checked()); //var x = ; On Wed, Feb 25, 2009 at 6:11 PM, heohni heidi.anselstet...@consultingteam.de wrote: Sorry, another question... I just playing arround with different possibilities: $(document).ready(function(){ // on default, disable the submit button $(.requestbutton).attr(disabled, disabled); function check_how_many_products_checked(){ $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ return msg; } }); } var x = ; x = check_how_many_products_checked(); alert(x); The alert is always undefined... Why? I must return the figure 2, what it does, if I alert the msg directly. Sorry for these questions, I am just about to learn the syntax. Thanks! On 25 Feb., 10:57, heohni heidi.anselstet...@consultingteam.de wrote: Ok, thanks a lot!! On 25 Feb., 10:38, system div divsys...@gmail.com wrote: var how_many_checked= ''; $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ //alert(msg); how_many_checked = msg; } }); alert(how_many_checked); if(how_many_checked !=undefined) { do some.. } On Wed, Feb 25, 2009 at 5:31 PM, heohni heidi.anselstet...@consultingteam.de wrote: Hi, $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ //alert(msg); var how_many_checked = msg; } }); alert(how_many_checked); if(how_many_checked 0) ... the FF returns how_many_checked ist not defined. Why? How can I define a var and use it for a later coming if / else part? Thanks a bunch!
[jQuery] Re: Var from Ajax success not defined?
alert(typeof(how_many)); is string alert(how_many==undefined); is false On Wed, Feb 25, 2009 at 7:26 PM, heohni heidi.anselstet...@consultingteam.de wrote: Currently my code looks like: var how_many = ; $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ //alert(msg); how_many = msg; } }); if($(input[name^='paradigm']:checked).length == 0) { //alert('None are checked on page'); $(.requestbutton).attr(disabled, disabled); }else{ //alert('At least one is checked'); $(.requestbutton).removeAttr(disabled); $(.requestbutton).click(function(){ $(#list).submit(); }); } But I still can't access the var how_many. I would like to do this: ($(input[name^='paradigm']:checked).length == 0 || how_many == 0) { But the how_many is not set... it's empty on alert. Not undefined, it's empty.. *i am lost...* On 25 Feb., 11:15, system div divsys...@gmail.com wrote: you try alert(check_how_many_products_checked()); //var x = ; On Wed, Feb 25, 2009 at 6:11 PM, heohni heidi.anselstet...@consultingteam.de wrote: Sorry, another question... I just playing arround with different possibilities: $(document).ready(function(){ // on default, disable the submit button $(.requestbutton).attr(disabled, disabled); function check_how_many_products_checked(){ $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ return msg; } }); } var x = ; x = check_how_many_products_checked(); alert(x); The alert is always undefined... Why? I must return the figure 2, what it does, if I alert the msg directly. Sorry for these questions, I am just about to learn the syntax. Thanks! On 25 Feb., 10:57, heohni heidi.anselstet...@consultingteam.de wrote: Ok, thanks a lot!! On 25 Feb., 10:38, system div divsys...@gmail.com wrote: var how_many_checked= ''; $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ //alert(msg); how_many_checked = msg; } }); alert(how_many_checked); if(how_many_checked !=undefined) { do some.. } On Wed, Feb 25, 2009 at 5:31 PM, heohni heidi.anselstet...@consultingteam.de wrote: Hi, $.ajax({ type: POST, url: /ajax_add_selected_product_to_session.php, success: function(msg){ /* add here what to do on success */ //alert(msg); var how_many_checked = msg; } }); alert(how_many_checked); if(how_many_checked 0) ... the FF returns how_many_checked ist not defined. Why? How can I define a var and use it for a later coming if / else part? Thanks a bunch!
[jQuery] Re: Datepicker Plugin Quesiton
dateFormat: 'y-mm-dd', 09-02-16 dateFormat: 'yy-mm-dd', 2009-02-16 On Sat, Feb 14, 2009 at 10:21 PM, Hellofrom hellof...@gmail.com wrote: Hello every one Can some one help me setting the datepicker plugin with the following options min date =today date format =-mm-dd thanks
[jQuery] Happy 牛 Year !
Today is Chinese New Year . Happy 牛 Year !
[jQuery] Re: sd
what? 2009/1/24 David Meiser dmei...@gmail.com e^pi? On Fri, Jan 23, 2009 at 8:31 PM, jquertil til...@gmail.com wrote: sqrt
[jQuery] system div wants to chat
--- system div wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-cc2d1cd851-2e8029a520-4143a4170ddaaae3 You'll need to click this link to be able to chat with system div. To get Gmail - a free email account from Google with over 2,800 megabytes of storage - and chat with system div, visit: http://mail.google.com/mail/a-cc2d1cd851-2e8029a520-c0b5557925 Gmail offers: - Instant messaging right inside Gmail - Powerful spam protection - Built-in search for finding your messages and a helpful way of organizing emails into conversations - No pop-up ads or untargeted banners - just text ads and related information that are relevant to the content of your messages All this, and its yours for free. But wait, there's more! By opening a Gmail account, you also get access to Google Talk, Google's instant messaging service: http://www.google.com/talk/ Google Talk offers: - Web-based chat that you can use anywhere, without a download - A contact list that's synchronized with your Gmail account - Free, high quality PC-to-PC voice calls when you download the Google Talk client Gmail and Google Talk are still in beta. We're working hard to add new features and make improvements, so we might also ask for your comments and suggestions periodically. We appreciate your help in making our products even better! Thanks, The Google Team To learn more about Gmail and Google Talk, visit: http://mail.google.com/mail/help/about.html http://www.google.com/talk/about.html (If clicking the URLs in this message does not work, copy and paste them into the address bar of your browser).
[jQuery] Re: $date1 = $('div /')W hat does it mean ?
Ricardo Tomasi thanks 2009/1/20 Ricardo Tomasi ricardob...@gmail.com It's a shortcut for element creation. Like you can do $('body').append('div /') $('div /') gives you a div which is not in the DOM yet You can see that both jQuery objects with the divs ($date1 and $date2) end up appended to #multimonth. On Jan 20, 8:36 am, divsystem divsys...@gmail.com wrote: $date1 = $('div /') http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePicker... $date1 = $('div /') .datePicker({inline:true}) .bind( 'dpMonthChanged', function(event, displayedMonth, displayedYear) { $date2.dpSetDisplayedMonth(displayedMonth+1, displayedYear); } ) .bind( 'dateSelected', function(event, date, $td, status) { $date2.dpSetSelected(date.asString(), status, false); } ); // remove the forward navigation from the first date picker $('.dp-nav-next', $date1).html(''); // create the right hand datePicker and add the relevant event listeners to sync it to the left hand one... $date2 = $('div /') .datePicker({inline:true}) .bind( 'dpMonthChanged', function(event, displayedMonth, displayedYear) { $date1.dpSetDisplayedMonth(displayedMonth-1, displayedYear); } ) .bind( 'dateSelected', function(event, date, $td, status) { $date1.dpSetSelected(date.asString(), status, false); } ); // remove the backward navigation from the first date picker $('.dp-nav-prev', $date2).html(''); // initialise the date pickers to consecutive months ($date1 defaults to this month so set $date2 to next month) var now = new Date(); $date2.dpSetDisplayedMonth(now.getMonth()+1, now.getFullYear()); // add the generated combined plugin to the document $('#multimonth').html('').append($date1, $date2);