my page slows down every time I run my script, that's why I need to know how I can fix it

I have tried it on my local and public server and I have the same slow loading problem.

```html
<script type="text/javascript" src="catalog_rank3.js"></script>

<form action="javascript:;" onsubmit="setSceneProducts()">
    <input type="text" class="btn-transparent" id="hov" size="50" placeholder="Link Here"><br/><br/>
    <span class="btn-border btn-primary">
        <input type="submit" class="btn btn-primary btn-lg" value="Unhide">
    </span>
</form>

<div id="main">result here</div> 

```

I would like to know if I can add a loader so that the data is displayed when the entire load is complete.