0

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.