in Education by
I am in a project where I need to connect to a client's server and retrieve data for some graphs. The client wants this to be something in real time (they have a script that is listening for connections and feeds data constantly). My big problem is that I don't think this can be done in IE as easy as it would be done in Firefox or Chrome. Firefox and Chrome both support web sockets so I think I could make something that would do exactly what the client wants. In IE the only way I could do this is by using a setTimeout with an ajax call. Is there any other alternative for IE?? For now we're using jquery .ajax() and setting a callback for the onReadystageChanged event that handles the server response when the readyState == 3. But this doesn't work as expected because the connection closes after the first response. Also, I am using IIS with Application Request Routing module as a proxy and a URL rewriting rule because we're using cross domain services. But this module uses a buffer with at least 1KB that corrupts the server response. The services were created by another company that won't implement CORS specification in their server. How can I work around this and receive the response without buffering? Thank you JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Instead of WebSockets you can use long polling and a server side promise. On the server you can suspend the http request so it works async. Example jQuery: poll(); function poll(){ $.ajax({ url : "http://my-own-domain.com/data/", success : function(data) { //do what you want with data poll(); }, error : function(data) { poll(); } }); } Server side example: WSRequest req = WS.url("http://the-other-domain.org/data/"); Promise respAsync = req.getAsync(); HttpResponse resp = await(respAsync); renderJSON(resp.getString()); For server side take a look at Play! Framework Async to get an idea how it can be done.

Related questions

0 votes
    I am trying to simulate the look and feel of a Firefox disabled text input: textarea and input text. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
0 votes
    I am trying to simulate the look and feel of a Firefox disabled text input: textarea and input text. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    _____________ will produce a sequential vector c( (1,2,3,4,5,6,7,8,9)). (a) Seq(9) (b) Seq ... Functions and Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    >>> list(range(0, -9,-1)) will print [-1, -2, -3, -4,-5, -6, -7, -8) [0,-1, -2, -3, -4,-5, -6, -7, -8 ... [0,-1, -2, -3, -4,-5, -6, -7] Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    The digits 1,2,3,4,5,6,7,8 and 9 are written in random order to form a nine digit number. The probability that this ... 2 9 2 D. 7 9 7 Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
0 votes
    A hash table can store a maximum of 10 records, currently there are records in location 1, 3,4,7, ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    If 9 = 63 8 = 48 7 = 35 Then 4 = ? A) 4 B) 8 C) 12 D) 16...
asked Feb 19, 2021 in Education by JackTerrance
0 votes
    Can you arrange 9 numerals - 1, 2, 3, 4, 5, 6, 7, 8 and 9 [using each numeral just once] above and below a division line, to create a fraction equaling to 1/3 [one third]?...
asked Feb 13, 2021 in Education by JackTerrance
0 votes
    Looking for guidance on how to use Angular Elements that will work across other browsers especially with Internet ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    I'm having this little problem with internet explorer and ajax. So first I used just php, and everything ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    5. Which of the following is not web browser ? * (a) Google Chrome O (b) Mozilla Firefox O (c) Internet Explorer O (d) Notepad Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    internet explorer has been replaced by _________web browser in window 10 Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    Where is the error icon shown in the Internet Explorer? (a) Taskbar (b) Status bar (c) Both ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 21, 2021 in Education by JackTerrance
0 votes
    We need an active internet connection to publish the post.(T/F) True False Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    _________ is software that is installed using an internet connection or they come by-default with operating systems. (a) ... questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
...