| Page 1 of 1 | [ 3 posts ] |
|
I have wriiten a very small snippet using DataSource Utility to fetch data from URL . The problem is everytime i try executing the script , i get failure alerts. On debugging thru chrome console , i see the data source request is not even made to the url .
The following is the code Code: var myDataSource = new YAHOO.util.DataSource("http://hostname.com:8590/status?"); myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT; var mySuccessHandler = function() { alert(myDataSource); }; var myFailureHandler = function() { alert("failure"); alert(myDataSource); }; var callbackObj = { success : mySuccessHandler, failure : myFailureHandler }; myDataSource.sendRequest("job=1f179700-770f-11e1-9d97-458a3dcf55be", callbackObj); If the repose type is json and if i use type_text . Will the datasource throw an error ? Is there any other way to fetch text from a particular url ? |
|
Since you are using a full URL in the DataSource constructor, I assume your source of data lies in a different server than your pages. The browser will not allow cross-domain requests using the standard communication layer.
The response type would be relevant if you had any response, which you don't. |
|
so how do i do cross browser request then ? Isnt there any work around for this ? or any other utilitiy apart from Data source which will allow me to do so ?
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group