Advanced Search

Results 1 to 3 of 3

Thread: Get get complete url of a page, including the active tab

  1. #1
    Join Date
    Nov 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile Get get complete url of a page, including the active tab

    1) Script Title: Demo #2- Different Tab Style, expanding of arbitrary DIVs on the page enabled

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex17/tabcontent.htm

    3) Describe problem:

    As you can see in demo#2, when a tab is selected the url in the browser dont change.
    Let'us assume that we want to add a feature that allow a user to save in a browser favorite or in a database the url of the page that he likes. In this case it seems necessary to get a complete url, including the active tab.

    1 - Is it possible to do this using javascript? If yes, How?

    2 - Is there other way to do this? If yes, which one?

    Thanks in advances.

    Celestino
    Last edited by ddadmin; 11-14-2011 at 02:43 PM.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,863
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    The script does support selecting a tab by using a URL parameter (ie: currentpage.htm?flowertabs=1). See the section "Dynamically selecting a tab using a remote link (v2.2 or above)" on the script page for details on this.

    With that in mind then, if you want the currently selected tab to also be bookmarkable, one approach would be to use HTML'5 pushstate API to dynamically append to the page's URL a parameter string without reloading the page. The parameter string would consist of the string "?tabid=selectedtabindex", so bookmarking the page and returning to it will load the corresponding tab as well. HTML5 pushstate is supported in FF4+, Chrome/Safari 5+, and Opera 11.5+. No IE support yet. Try the below modified .js file, which adds this feature to the script.
    DD Admin

  3. #3
    Join Date
    Nov 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks very much for support. After testing a post reply.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •