Cancel browser widget navigation?

hh hh at hyperhh.de
Fri Jan 5 10:45:17 EST 2018


> > hh wrote:
> > 2. Don't do the navigation in the widget but later on in browsers:
> > Not really from a widget property. But you could use an attribute that the
> > widget can't do: to open a new window. This works in "hhTextEditBasic".
> >
> > set the htmltext of widget 1 to
> > <a href="http://www.screensteps.com" target="_blank">Trevor's Site</a>
> >
> 
> TD wrote:
> The browser widget I’m working with is a Froala editor. The user will be
> inserting their own content into the browser widget.

Then you could add in "onChange" of the editor an insert of target="_blank".
So the links won't work in the widget but in browsers.
I use this in the free hhTextEdit-Full (to appear) that also does editing like
the paid Froala.
May be similar to this (here written with jQuery), preserving on-page-links:

onChange: function(contents, $editable) {
$('a').each(function () {
if ($(this).attr('href').charAt(0) != '#') $(this).attr('target','_blank');});
}





More information about the use-livecode mailing list