Jack Torris
Jack Torris

Reputation: 804

jQuery ajax find data not working in IE8

i am using jquery submit to post the form data. jquery returns the Data.

in alert gets the data through ajax.

now issue is i want to display DIV Gallery HTMl. for that

  <form action="" method="post" name="view_all" id="view_all">
  <input type="hidden" name="viewmoreimages" value="viewmore" />
  <input type="submit" value="Load more" name="viewall" id="submit"  class="b1"/>
   </form>
  <div id="gallery_cnt"></div>


 jQuery(function(){
   jQuery( "#view_all" ).submit(function( event ) {

    <?php $site_url = site_url();?>
   var viel = jQuery('#submit').val();
  jQuery.ajax({ 
     data: jQuery("form#view_all").serialize(),
     type: 'post',
     success: function(data) {

    var j = jQuery(data).find("#gallery_cnt").html(); 

    alert(j);
   jQuery('#gallery_cnt').html(j);



    }
     });
     event.preventDefault();


      });});

for IE8 Value of var j is returning undefined while it works fine in other browsers.

need help to display it for ie8.

any help would be greatly appreciated.

Upvotes: 1

Views: 593

Answers (1)

Websolutionexpert24
Websolutionexpert24

Reputation: 56

I think your are getting something wrong. but try this one..

 <form action="" method="post" name="view_all" id="view_all">
  <input type="hidden" name="viewmoreimages" value="viewmore" />
  <input type="submit" value="Load more" name="viewall" id="submit"  class="b1"/>
   </form>
  <div id="gallery_cnt"></div>


jQuery(function(){
jQuery( "#view_all" ).submit(function( event ) 
{
    <?php $site_url = site_url();?>
    var viel = jQuery('#submit').val();
    jQuery.ajax({ 
        data: jQuery("form#view_all").serialize(),
        type: 'post',
        success: function(data) 
        {
            var j = jQuery(data).find("#gallery_cnt").html(data); 
            alert(j);
            jQuery('#gallery_cnt').html(j);
        }
    });
    event.preventDefault();
});
});

Upvotes: 1

Related Questions