JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://build-master.jaspersoft.com:6880/jrs-pro-feature-dashboard-hyperlinks-self-target/client/visualize.js"></script>
Anchor: <input type="text" id="anchor"/>
Page: <input type="text" id="page"/>
<button id="range">Show range of pages and navigate to specific anchor inside it</button>
<button id="showCurrentLocation">Show current location</button>
<br><br>
<div id="container"></div>

CSS

#container {
    height: 400px;
    overflow-y: scroll;
    width: 100%;
}

JavaScript

visualize({
    auth: {
        name: "jasperadmin",
        password: "jasperadmin",
        organization: "organization_1"
    }
}, function (v) {

    var report = v.report({
        resource: "/public/Samples/Reports/AllAccounts",
        container: "#container",
        pages: {
            anchor: "Newton"
        },
        events: {
            changePagesState: function(currentPage) {
                console.log("changeCurrentPage", currentPage);
            }
        },
        error: function(e) {
            alert(e);
        },
        success: function(e) {
            console.log(report);
            console.log(e);
        },
    });
    
    $("#showCurrentLocation").on("click", function() {
        alert(JSON.stringify(report.pages()));
    });
    
    $("#anchor").on("change", function() {
        report
            .pages({ anchor: $(this).val() })
            .run()
            .fail(function(e) { console.log(report.pages()); alert(e); });
    });
    
    $("#page").on("change", function() {
        report
            .pages({ pages: $(this).val() })
            .run()
            .fail(function(e) { console.log(report.pages()); alert(e); });
    });
    
    $("#range").on("click", function() {
        report.properties({
            pages: {
                pages: "29-31",
                anchor: "Newton"
            }
        }).run().fail(function(e) { console.log(report.pages());  alert(e); });
    });
});