8 Replies Latest reply: Jun 12, 2014 11:09 AM by ion RSS

    execute js function on clicking tab?

    ion Community Member

      i have a js function that works fine when attached to the onClick event of a button, but i want it to execute when user clicks the tab

       

      is there a way to do that?

       

      function clearURL() {

      var testURL = document.URL;

      var urlQry = testURL.split("?")[1];

      if (urlQry != "")

          {

          var activeTab = ColdFusion.Layout.getTabLayout('myLayout').getActiveTab().title;

          if (activeTab == 'myTabTitle')

              {

              var newURL = testURL.split("?")[0];

              window.location = newURL;

              }

          }

      }

       

      thanks