why my jquery ajax code doesnt work?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
mekha
Forum Contributor
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

why my jquery ajax code doesnt work?

Post by mekha »

Code: Select all

$(document).ready(function(){//START JQUERY
	
	
	////////////////////////////////////////////////////////////////
	/**/	$('.type_questions555').change(function() {
	/**/	var id= $(this).val();
	/**/	$.ajax({  
    /**/            type: "POST",
    /**/           url:'<?=$site_url?>/showtheifresult.php', 
    /**/           data: "aid="+id,   
    /**/           success: function(data) {
    /**/            if(data){
						$(".theimg1").show("fast");  
						jQuery(".theimg1").html('<img id="img1" src="<?=$site_url?>/images/question_sample'+id'.jpg"  align="left"/>') ;
	/**/				
		
    /**/                $(".the1div").show("fast");             
    /**/                jQuery(".the1div").html(data) ;
						
	/**/					   
	/**/
    /**/                    }
	/**/								   } ,
	/**/		
	/**/
    /**/        }); 





														});
														
	
	})//END JQUERY
hi...this is my code...

the problems in these lines:

Code: Select all

	$(".theimg1").show("fast");  
						jQuery(".theimg1").html('<img id="img1" src="<?=$site_url?>/images/question_sample'+id'.jpg"  align="left"/>') ;
if i remove these lines,there are no problem..but if i add them...the code dont work..how can i make more than 1 action if success?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: why my jquery ajax code doesnt work?

Post by requinix »

It doesn't work because there's a syntax error. It's missing a +.
Post Reply