简体   繁体   中英

Load content in div using javascript

Currently I am facing a problem with Jquery ajax call. The Ajax call in my jsp takes more time to load data where as javascript form submit takes less time.

Using javascript form submit i am unable to load the content form result in another tab. Could any one help me on this

Javascript Function

         function getCircuitMaintenanceDetails(event,refno)
          {   
              var eve = event;
              var ref_no = refno;
              var url = "circuitMaintenanceDetails.do?EVENT_KEY="+eve+"&REF_NO="+ref_no; 
              document.getElementById('sessReferenceId').value=refno;
             $.ajax({
                  type:'post',
                  cache:false,
                  url:url,
                  beforeSend: function ( xhr ) {
                      $('#content02').html('<div class="loading"><center><img src="../images/ajax-loader.gif" alt="Loading..." /><center></div>');
                    },
                   success:function(data){
                       window.scrollTo(0,0); 
                       $('#content02').html(data);                              
                   }
              }); 


          }

Above javascript function loads data in another tab using ajax call. It takes more time

The jsp code has been placed in http://jsfiddle.net/mJ8m3/

I am using IE8 and Jquery 1.7.1 in my jsp file. Any one guide me how to improve the performance of Ajax call or could guide me how to load data in second tab ie (content02) tab using javascript function.

If I use document.forms[0].submit is loading the content in the same tab instead of tab2.

After Submitting the form in javascript I am unable to load the content in another tab defined using div tag

Any one can help me in this problem. Really need a solution for this. Help me to increase the speed

您可以使用jquery的load()方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM