Switch to desktop version  
Create a dynamic link in Javascript to a LAN device through M2Web - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: Custom Web Pages/viewON/Talk2M Visualization (https://techforum.ewon.biz/forum-55.html)
+--- Thread: Create a dynamic link in Javascript to a LAN device through M2Web (/thread-1746.html)



Create a dynamic link in Javascript to a LAN device through M2Web - simon - 07-06-2021

Hello,

Since we changed the M2Web proxy mechanisms, the URL used are different.

If your viewON project uses a javascript to open new Tab towards some LAN devices web interface through M2Web, here is the script to use :


Code:
var s=window.location.href;
if(s.indexOf('m2web.talk2m.com')==-1){
    win = window.open('http://'+IP);
    win.focus();
}
else{
    win = window.open("https://" + window.location.host.split("-")[1] + "/hashid/" + window.location.host.split(".")[0] + '/proxy/' + IPLAN);
    win.focus();
}

where IPLAN is the IP of the LAN device.

Simon