Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript integrate jQuery BBQ into this AJAX

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #157971
    Anonymous
    Inactive

    I’m trying to be able to navigate through my AJAX loaded content using clean URL without “#”. jQuery BBQ plug-in seems like a good choice but i cant get it to work with my AJAX. Anyone know how i can implement it or use a different/better method? Here is m AJAX

    $(document).ready(function() {
    
        //set your initial pages when website loads
        $("#content-container").load("content/corporate.php"); // set initial home page
        $("#sidebar-container #sidebar-content-container").load("content/sidebar-content/poll-faq.php"); // set initial sidebar page
    
    
        // content container load content based on nav tab clicked
        $("#nav-tabs-list li").click(function() {
            var page = $("a", this).attr("href"); // get the url of the tab clicked
            $("#content-container").load("content/" + page); // load content inside #content-container
            return false;
        });
    
    
        // sidebar container load content
        $("#sidebar-container #sidebar-tabs-container a").click(function() {
            var page = $(this).attr("href"); //get the url of the tab clicked
            $("#sidebar-container #sidebar-content-container").load("content/sidebar-content/" + page); //load content
            return false;
        });
    
    });
    
    #158036
    Anonymous
    Inactive

    At this point i still haven’t found a solution. So i’m willing to use “#” to send users to a specific AJAX loaded content on my page using url.

    #158054
    Anonymous
    Inactive

    No. although i’m not even sure if that AJAX is very efficient. My objective is to have the ability to send users to a specific page in the content-container where the AJAX loads the pages using url. I was thinking of trying out history API but its not compatible with many browsers. I want to try out jQuery BBQ but have no idea how to use it. And the documentation is hard for me to understand as i just started learning jQuery. I don’t know if this will help much but i created this pen to show what i’m currently working with http://codepen.io/Jarolin/pen/Lrtcp. When i click a nav link the external html page will load within the content-container div. it wont work there but its just to see if it will help.

    #158111
    Anonymous
    Inactive

    I would rather stick with using hash. I it to be compatible with IE 8 +. :P

    #158183
    CrocoDillon
    Participant

    It will be, graceful degradation :) Personally I would keep hashes for their intended use and go with history api. Future proof.

    #158208
    Anonymous
    Inactive

    I finally got the hash working exactly the way i want to and wouldn’t want to mess that up. Although i’m wondering if theres a way to use history API, but if the user is on an unsupported browser automatically switch to hash.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.