JavaScript delete confirm box
<p>My function is something like this:</p>

<pre><code>function delete(type, id){
    if(id){
        window.location.href = '/site/'+type+'/delete/'+id;
    }
}
</code></pre>

<p>I'm calling it like this:</p>

<pre><code>onclick="delete('position', &lt;?php echo $key;?&gt;)
</code></pre>

<p>Where in the function should I put the Confirm option?</p>
