locked
Uncaught SyntaxError: Unexpected token % in jquery code RRS feed

  • Question


  •  $(document).ready(function(){
    'use strict';
    var requestData=$('#txtjson').val();
    var jsonResult=$('#jsonDetail');
    var pdfdetails=$('#pdfdtail');
    $('#btnjson').click(function(){
    debugger;
    var mydata="";
    $.ajax({
    url:'url',
    method: 'GET',
    data: { clmnbr:requestData },
    crossDomain: true,
         dataType: 'jsonp',
    success: function(data){
    mydata = JSON.stringify(data);
      if(mydata.message!=null)
       {
    jsonResult.html(mydata.message);  
       }
       else
       {
       alert('data is comming');
    jsonResult.html('StatusId  :  ' +mydata.StatusId+'<br>'+'Message  :  ' 
    +mydata.Message+'<br>'+'OCRResult  :  ' +mydata.OCRResult+
    +'<br>'+'LOCATION  :  ' +mydata.LOCATION); 
       }  
    }
    }); 
    });

    $('#btnjson').click(function(){
    debugger;
      $.ajax({
    url:'url',
    method: 'GET',
    data: { clmnbr:requestData },
    dataType: 'jsonp',
    success: function(data){
    var mypdata = JSON.stringify(data);
      if(mypdata.message!=null)
       {
    jsonResult.html(mypdata.message);  
       }
       else
       {
       alert('data is comming');
        window.open("data:application/pdf," + escape(mypdata));
    pdfdetails.html('StatusId  :  ' +mypdata.StatusId+'<br>'+'Message  :  ' 
    +mypdata.Message+'<br>'+'OCRResult  :  ' +mypdata.OCRResult+
    +'<br>'+'LOCATION  :  ' +mypdata.LOCATION);   
     
      
       }  
    }
    }); 
    });
     });
    Wednesday, June 12, 2019 6:27 AM