Hello, I am using javascript library:
http://dhtmlx.github.io/message/ for website wide prompting etc...

I am embedding their confirm function into a basic hyperlink as such:

<a href="test.html" onclick='dhtmlx.confirm({title:"Redirecting", text:"You are now leaving the site."});'>test link</a>

When the hyperlink is pressed the user does not get a chance to click OK/Cancel, the site automatically loads.

How can I implement if a user clicks Ok, they get redirected to the site?

I have tried using <a href="test.html" onclick='dhtmlx.confirm({title:"Redirecting", text:"You are now leaving the site."});if (! confirm('Continue?')) return false;'>test link</a>

but that did not work.