Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Using URL in tab gives jQuery error #106

Open
NiklasRosenstein opened this issue May 5, 2017 · 1 comment
Open

Using URL in tab gives jQuery error #106

NiklasRosenstein opened this issue May 5, 2017 · 1 comment

Comments

@NiklasRosenstein
Copy link

I'd like to have a tab that is just an absolute URL

<nav class="tabs" data-component="tabs">
  <ul>
    <li class="active"><a href="#package-description">Description</a></li>
    <li><a href="#package-manifest">Manifest</a></li>
    <li><a href="#package-files">Files</a></li>
    <li><a href="#package-versions">Versions</a></li>
    <li><a href="https://github.com/nodepy/ppym-registry">Repository</a></li>
  </ul>
</nav>

but doing so gives

Uncaught Error: Syntax error, unrecognized expression: https://github.com/nodepy/ppym-registry
    at Function.ga.error (jquery-3.2.1.min.js:2)
    at ga.tokenize (jquery-3.2.1.min.js:2)
    at ga.select (jquery-3.2.1.min.js:2)
    at Function.ga [as find] (jquery-3.2.1.min.js:2)
    at r.fn.init.find (jquery-3.2.1.min.js:2)
    at r.fn.init (jquery-3.2.1.min.js:2)
    at r (jquery-3.2.1.min.js:2)
    at t.Tabs.getItem (kube-6.5.2.min.js:1)
    at t.Tabs.loadItems (kube-6.5.2.min.js:1)
    at HTMLAnchorElement.e (jquery-3.2.1.min.js:2)

It would be nice if it wouldn't error and just ignore such links.

@NiklasRosenstein
Copy link
Author

I'm currently working around this issue with the following

$('.tabs a[data-absolute-url]').on('click', function () {
  document.location.replace($(this).attr('data-absolute-url'))
})
    <li><a href="#dummy" data-absolute-url="https://github.com/nodepy/ppym-registry">Repository</a></li>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant