0

I do not want to include WEINRE script in head section and I would like to load it on demand (on button click). I tried:

$.getScript('http://path-to-weinre-script.js#anonymous')

After loading WEINRE script client starts to make calls to /ws/target/t-9X periodically but there is no active targets in WEINRE console. How can I force WEINRE initialization without adding it to head section?

untitled
  • 1,037
  • 2
  • 12
  • 27

2 Answers2

0

Someone posted issue CB-8738 at Jira that sounds similar. Does this resolve your issue?

Patrick Mueller
  • 697
  • 1
  • 6
  • 13
0

I have found it myself. The right way to load WEINRE dynamically is:

(function(e){e.setAttribute("src","http://ip:port/target/target-script-min.js#anonymous");document.getElementsByTagName("body")[0].appendChild(e);})(document.createElement("script"));void(0);
untitled
  • 1,037
  • 2
  • 12
  • 27