异步调用URL [英] Asynchronous calls to an URL
本文介绍了异步调用URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
chrome.tabs.create()
在我的Google Chrome扩展程序中打开一个新标签页。为了进行调试,我需要在此次调用之前调用另一个URL来记录使用情况。
- 这个URL只是一个调用URL,映射到一个为我记录数据的PL / SQL过程,即我不需要等待响应
- 另外,我需要调用它,以便任何错误这个调用完全被忽略,不会影响我的插件的功能。
我该怎么做?
解决方案
使用异步请求(Ajax),例如:
var xhr = new XMLHttpRequest();
xhr.open(GET,yourURL,true);
xhr.send();
以下是更多资讯: http://code.google.com/chrome/extensions/xhr.html
I am using
chrome.tabs.create()
to open a new tab in my Google Chrome extension. For debugging purposes, I need to call another URL just before this call that will log the usage.
- this URL is a call only URL and maps to a PL/SQL procedure that logs the data for me, i.e I do not need to wait for the response
- Also, I need to call it in such a way that any errors in this call whatsoever are completely ignored and do not affect the functionality of my addon
How can I do this?
解决方案
Use asynchronous request (Ajax), for instance:
var xhr = new XMLHttpRequest();
xhr.open("GET", yourURL, true);
xhr.send();
Here's more info: http://code.google.com/chrome/extensions/xhr.html
这篇关于异步调用URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文