WebToolbar: How to get rid of the displayed Javascript ";"

I’m having fun trying a couple of things with Xojo Web this weekend :wink:

So here is one more (minor) issue that I don’t quite like…

Run the WebToolbar example projects that come with Xojo.
When you move the mouse over an item in the WebToolbar, the Browser (Google Chrome) displays the message javascript:; on the bottom-left of the browser window. Safari displays it in a localized way, e.g. Execute Script ";".

While it works as expected, I just don’t like this message shown.
It sounds to me such as “Execute an empty script”, which doesn’t make sense to me.

In the page source there is something like this:
<a id="kTIMQo_menu_6" btntag="6" href="javascript:;" class="nav-link text-nowrap" style="outline: none;"><span>Toggle Button 3</span></a>

So my questions are:

  • is this really required to have a href="javascript:;"?
  • is there some way to get rid of that message shown?

If you go to Bootstrap docs page you can see that the ‘href’ they use is ‘#’.
At this point I don’t remember if @Greg_O designed the Navbar like that or @Ricardo_Cruz did some changes to it.
As I don’t know why it works like that (showing ‘javascript’) I hope either of them can answer your questions.
Maybe there is a reason ‘javascript’ is used instead of ‘#’.

Edit: Greg no longer works for Xojo, I’m not sure what he can share (or not) about this.

I guess an empty block of JS is being used instead of # to avoid conflicting with the HashtagChanged event. Maybe we can use <button> tags instead of anchors, but I’ll definitely have to double check if that’s possible and works fine with every browser.

The href attribute is required on anchors, yes, otherwise they may not fire their pressed event on some browsers.

I don’t think so, unless we turn those into buttons.

2 Likes

Thanks for the Feedback.
If you’d like to look into this, I’d appreciate it.

It’s not a high priority issue, since “it works”.
I just think it’s not the best “end user experience” seeing javascript:; on items in the Toolbar.

1 Like