Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: calling ajax returning undefined value to called script (ddt is the variable)

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post calling ajax returning undefined value to called script (ddt is the variable)

     
     
    // calling script
     
    var ddt;
    			for(i=0;i<full_id_array.length;i++)
    			{
    				if(full_ck_array[i]=='yes')
    				{	
    					idname=full_id_array[i];					
    					ddt += primary_general(idname);  // called java script
    					alert(ddt);
    				}
    			}
    			alert('final...'+ddt);

     
    function primary_general(k)
    		{	
    			var idname=k, xyz = "#"+idname, xverified='0';	
    			var y = $(xyz).val();
     
    			$.ajax(
    			{					
    				type: "POST",
    				url: checkingfilename,
    				data: {async: false,						
    						pass_type_array: tparray,
    						pass_error_array: erarray,						
    						pass_element_array: idarray,
    						pass_element_maxlength: 0, 						
    						pass_element_id: k, 
    						pass_element_value: y,
    						pass_operation: 'ind',},
    				success: function(data)
    				{					
    					var cidnm = $.parseJSON(data);					
    					$(cidnm.error_id).html(cidnm.error_mess);
    					if(cidnm.error_mess != '')
    					{
    						xverified = '1';
    					}
    					return xverified;
    				},
    				error: function(data)
    				{
    					xverified = '1';
    					return xverified;
    				}
    			});
    		}

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: calling ajax returning undefined value to called script (ddt is the variable)

    Moved from java section. javascript != java
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [Beginner Java] Returning a variable from mothod problem
    By kinkita in forum Object Oriented Programming
    Replies: 2
    Last Post: May 8th, 2013, 02:57 PM
  2. Replies: 0
    Last Post: October 30th, 2012, 10:06 AM
  3. Help with returning variable from method
    By m7abraham in forum What's Wrong With My Code?
    Replies: 19
    Last Post: September 17th, 2012, 03:01 PM
  4. returning variable and saving to file
    By ravencrest in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: November 18th, 2011, 09:04 AM