最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Detect when odoo interface is fully loaded - Stack Overflow

programmeradmin4浏览0评论

I need to run some javascript code to check when odoo has ended loading.

I know that querying jQuery.active == 0 does the trick in version 7 but that does not work in odoo because it always keep one connection open for the longpolling.

Does anybody know which web element can I use to check for sure when the interface is fully loaded ?

If I can query the URL of the active jQuery connections that would also do the trick.

I need to run some javascript code to check when odoo has ended loading.

I know that querying jQuery.active == 0 does the trick in version 7 but that does not work in odoo because it always keep one connection open for the longpolling.

Does anybody know which web element can I use to check for sure when the interface is fully loaded ?

If I can query the URL of the active jQuery connections that would also do the trick.

Share Improve this question edited May 27, 2015 at 2:28 Adrian Cid Almaguer 7,79113 gold badges43 silver badges65 bronze badges asked May 17, 2015 at 12:42 yuceryucer 5,0793 gold badges40 silver badges47 bronze badges 11
  • What about $(window).load() ? – Alex Commented May 18, 2015 at 8:18
  • well then you need to post some existing code. we can't assume what is happening at your end. yet i want to tell you that if there are some async calls then you can use $.when().then() to chain it to proceed in a chained manner. – Jai Commented May 18, 2015 at 8:20
  • I am trying to do this: agilesoftwaretesting./selenium-wait-for-ajax-the-right-way The code is there in step 5: selenium.browserbot.getCurrentWindow().jQuery.active == 0 – yucer Commented May 18, 2015 at 9:58
  • I need to check the condition at any time, in order to know if odoo is not expecting responses from the server (other than longpolling request, of course) – yucer Commented May 18, 2015 at 10:01
  • open the javascript console of the browser with CTRL+SHIFT+I when odoo is loaded and quiet. If you can put there a javascript expression that evaluates to true and would evaluate to false while loading something of the interface, the problem is solved. – yucer Commented May 18, 2015 at 10:11
 |  Show 6 more ments

1 Answer 1

Reset to default 7 +50

I don´t know odoo but I supose that you can wait for a variable in odoo and do this:

function checkodoo() {
   if ('undefined' !== typeof odooVariableThatYouWatch ) {
       clearInterval(intervalOdoo);
       lauchYourStaff();
   }
}

var intervalOdoo = setInterval("checkodoo()",100);

If on https://www.odoo. the variable is openerp

I look the variable here: https://www.odoo./documentation/8.0/howtos/web.html

发布评论

评论列表(0)

  1. 暂无评论