This example illustrates use of the igv.js API to dynamically add tracks from a dropdown menu. Selecting 'CopyNumber' in the menu above results in the following call.

                igv.browser.loadTrack({
                    url: 'https://s3.amazonaws.com/igv.org.demo/GBM-TP.seg.gz',
                    name: 'GBM Copy # (TCGA Broad GDAC)'})
                

See the developer wiki for more details.