Reputation: 201
I have this iframe on my website that can test your internet speed.
It has a callback function after the test is finished. This function can show various object properties. It now looks like this:
<script type="text/javascript">
function nPerfTestCompletedObj(object) {
document.write(object.id);
}
</script>
Problem is that this way it shows the object id on a new blank page.
Anybody can help me out how to show the result below the iframe after the function is finished?
Upvotes: 0
Views: 181
Reputation: 632
you need to create an empty p tag with an id like results. And show the object id on the results div.
Please use the below code
<p id="results"></p>
and then update your function like this:
<script type="text/javascript">
function nPerfTestCompletedObj(object) {
document.getElementById('results').innerHTML = object.id;
}
</script>
You can create more p tags or div to show more properties.
Upvotes: 1