0

I am using Tocify to make a TOC for some content on my site. Let's say my site is called www.example.com and I click an element in my TOC. The default option for Tocify is to change my url to www.example.com?elementclicked

But my site is www.mysite.com/index.php?page=folder/test/ShowSite&tabid=1&site_id=87. If I click an element, it changes the url to www.mysite.com?elementClicked. How can I make it change the link to www.mysite.com/index.php?page=folder/test/ShowSite&tabid=1&site_id=87?elementClicked?

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
Mathias
  • 55
  • 7

2 Answers2

1

I wrote Tocify and just updated Tocify to v1.1.0, which no longer uses History.js or the HTML5 push state API for history management. Instead, a hash is used (which should fix your issue). Please grab the latest Tocify code and let me know if you have any other issues. Thanks!

Greg Franko
  • 1,780
  • 15
  • 14
0

Appending current URL will automatically lead to page reloading. That can probably be tweaked by preventing page to auto-load but instead of adding ?elementClicked you could add #elementClicked ...

window.location.hash = 'elementClicked';
salih0vicX
  • 1,363
  • 1
  • 8
  • 9