Access velo code from 'non velo' javascript

Hi All,
I have a text box where I dynamically set the html property to contain a number of hyperlinks.

eg.
textbox.html = “<a href=‘#’ [onClick=‘wixLocation.to(](onClick=‘wixLocation.to(some) dynamicPage1); return false;’>page 1 : <a href=’#’ [onClick='wixLocation.to(](onClick=‘wixLocation.to(some) dynamicPage1); return false;’>page 2”

note: the dynamicPage links are to dynamic pages on the site - not to other sites. The dynamicPage link is not known up front - it needs to be composed in the $w.onReady event.

this is an attempt to create a simple breadcrumb navigation line at the top of the page. It would look like:

page 1 : page 2 : page 3 : … etc

I’m doing it this way to get around the limitation of not being able to resize textboxes horizontally to be wide enough for the text (so I can’t use separate textboxes for the page1, page2, page3 links as I don’t know in advance how long the text may be)

The question is: is there a way I can call the wixLocation.to function from the hyperlink onClick event? I can use window.location() or window.open() in the onClick instead to open the absolute page url but this causes a complete page refresh which is a bit ugly. The wixLocation.to function only refreshes the elements on the page that need to change.

I tried importing the function below from a public js code file but this function is not available to the onClick event either.

export function RedirectToInternal(path)
{
wixLocation.to(wixLocation.baseUrl + “\” + path);
}

thanks
David

It looks like an HtmlComponent and passing messages back and forth between the main page will do the trick.