I would like to use longpolling, if the websocket isn’t avaiable. But how to make it, if the server, and the website isn’t located in the same domain?
Sorry for my bad english. If you have any idea, then share it with me.
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Danny,
Right now (until cross-domain messaging is better supported), you will need to utilize a dynamic script tag long polling method whereby you dynamically add a script tag to the dom instead of doing a traditional ajax request (ex: document.createElement(“script”)). You can determine if the page has loaded by using the onreadystatechange event that is fired when the script has successfully been loaded.