Logic Machine Forum
Opening a web page in a new tab via Javascript button - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Opening a web page in a new tab via Javascript button (/showthread.php?tid=4321)



Opening a web page in a new tab via Javascript button - savaskorkmaz - 25.10.2022

Hi,

I would like to open a web page in a new tab in browser when i click a button in LM visualization via Javascript.

Can you help me ?

Regards


RE: Opening a web page in a new tab via Javascript button - admin - 25.10.2022

Set additional class to customlink, add this code to Custom JavaScript and modify the URL as needed:
Code:
$(function(){
  $('.customlink').off('vclick').on('vclick', function() {
    window.open('https://openrb.com');
  });
});
If you need several links like this then you will need to use different class names for each one and make a copy of the JS code.