Deeplinking json loaded data

I have json data that is populating the dom and the json objects being added have IDs that are used for the window.hash

       $j.getJSON('js/looks.json', function(data){

            $j.each(data.looks, function(i, looks){
                var look = "<li class='style "+data.looks[i].type+"'>";
                look+= "<div class='overlay'></div>";
                look+= "<a href='#"+data.looks[i].person+"'><img src='../images/looks/landinglooks_"+data.looks[i].person+".jpg'/></a>";
                look+="</li>";
             });

      });

and the div this is linked to is output in json aswell:

<div id='"+data.looks[i].person+"' class='block steps'>

Outputs:

<li class="style fine"><div class="overlay"></div><a href="#gabrielle"><img src="../images/looks/landinglooks_gabrielle.jpg"></a></li>

Clicking this brings you to http:.../#/gabrielle which is a div that is also

<div id="gabrielle" class="block steps"></div>

This works fine, but it seems like on page load (if I try to load to .../#/gabrielle) nothing happens. jQuery Address doesn't read the hash on pageload for the json loaded into the dom.

Is there a workaround or another deeplinking plugin that supports this?

Answers


I decided to use http://benalman.com/projects/jquery-hashchange-plugin/ worked like a charm! I can call the hashchange trigger after the json is loaded.


Need Your Help

How do I fill the “Transaction Details” key/value table inside the Transaction screen of Magento Admin?

php magento checkout

I've created a custom payment gateway but now I need to handle post payment notifications (just like IPN) to append additional information for a given transaction.

how to add user latitude and longitude values in arcgis.?

java arcgis

I am using the ArcGIS Runtime SDK for Java in my project. I need to add latitude/longitude values for GPS tracking. I can't find a solution to perform this. There are sample codes to perform this, ...