Change Div contents.

by Yuriy Bablyukh

HTML

<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
<script src="http://code.jquery.com/jquery-3.1.1.js"></script>
<script type='text/javascript' src="http://localhost:8080/jasperserver-pro/client/visualize.js?_opt=true"></script>

<body>
				<a href="#" id="refresh">Refresh</a><br />
  <div id="container" style="height:200; padding-bottom:0px"></div>
</body>

JavaScript

var report;

$(function(){
		visualize({
		auth: {
			name: "superuser",
			password: "superuser"
		}
		}, function(v) {
			report = v.report({
			resource: "/public/Samples/Reports/9g.CustomerDetailReport",
			params: { 
			"customerId":["2724"]},
			container: "#container",
			error: function(err) {
				alert(err.message);
					}
				});
			});
			$( "#refresh" ).click(function() {
		//	debugger;
			if(report)
			{
				report.params({"customerId":[2724]}).refresh();
			}
		});
	
    
		});