How would I best implement an LWC button that calls an Apex method return a String fragment which I would use to construct a URL (outside of Salesforce= to which I would send the user after the call? The URL should open in a new browser tab.

1 Answer 1


If its new browser tab, I think it would be simple to use

<a href={URL} target="_blank">Go to Site</a>

And if it has to go programmatically in callback:

var url = this.URL; // get from processing apex response
window.open(url, "_blank");

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .