Home › Forums › JavaScript › integrate jQuery BBQ into this AJAX
- This topic is empty.
-
AuthorPosts
-
December 8, 2013 at 7:54 pm #157971
Anonymous
InactiveI’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; }); });
December 9, 2013 at 5:59 pm #158036Anonymous
InactiveAt 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.
December 10, 2013 at 6:45 am #158054Anonymous
InactiveNo. 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.
December 10, 2013 at 3:56 pm #158111Anonymous
InactiveI would rather stick with using hash. I it to be compatible with IE 8 +. :P
December 11, 2013 at 10:26 am #158183CrocoDillon
ParticipantIt will be, graceful degradation :) Personally I would keep hashes for their intended use and go with history api. Future proof.
December 11, 2013 at 5:55 pm #158208Anonymous
InactiveI 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.
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.