javascript - Ext.data.JsonP.request always going to failed function? -


i doing application in extjs, calling ext.data.jsonp.request. in below code url path come dynamically generate appending name base url of pdf. here hard coded. passing url , testing jsonp request. if url returns success can write code success logic else failure, here going failure method. have tried ajax.request no use. time pdf path pdf not in server time need showcase alert message pdf not found. can tell me how can achieve one? possible calling jsonp request or other method? thank you

here code:

ext.data.jsonp.request({             url: 'http://jmlr.csail.mit.edu/papers/volume10/mannor09a/mannor09a.pdf',             method: 'get',             params: {                 //fileid: feed_id, //this.form.getcomponent('file').value,             },             failure: function () {                 alert('failed  !');             },             success: function () {                 alert('success!');             }         }); 



sure, need ajax pdf file? if want display file user, can put direct link file (without ajax or other tricks) , browser show it.
hard understand, want in success function.

my recommendation use plain link (you still can generate dynamically user)
<a href="http://jmlr.csail.mit.edu/papers/volume10/mannor09a/mannor09a.pdf">link</a> against using jsonp in situation :)


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -