Using jQuery. How can I call JSON when I hover over a link, we can say that I have the main DIV:
<div class="mainnav"> <UL> <li id="mainnav1">Movie</li> <li id="mainnav2">Drama</li> <li id="mainnav3">trailer</li> </UL> </div>
on the mouse over Movie wanted to display subnav
<div class="subnav"> <Ul> <h3><a href="/comady.html">Comady</a></h3> <li><a href="/movies/KungFuDunk">KungFu Dunk</a></li> <li><a href="/movies/IntimateAffairs">Intimate Affairs</a></li> <li><a href="/movies//movies/HighHopes">High Hopes</a></li> </UL> <UL> <h3><a href="/classics.html">Classics</a></h3> <li><a href="/movies/TheWomanWhoCameBack">The Woman Who Came Back</a></li> <li><a href="/movies/TheNorthStar">The North Star</a></li> </UL>
I can do this with static content, but what I wanted to do is that there in the DIV the subnav will be dynamic, so I wrote JSON, something like this
[ { "catogoryName" : "Movie", "productGroupInformationList" : [ { "groupName" : "comady", "link" : "/comady.html", "productsInformationList" : [ { "productLink" : "/movies/KungFuDunk", "productTitle" : "Kung Fu Dunk" }, { "productLink" : "/movies/IntimateAffairs", "productTitle" : "Intimate Affairs" }, { "productLink" : "/movies/HighHopes", "productTitle" : "High Hopes" } ] }, { "groupName" : "Classics", "link" : "/classics.html", "productsInformationList" : [ { "productLink" : "/movies/TheWomanWhoCameBack", "productTitle" : "The Woman Who Came Back" }, { "productLink" : "/movies/TheNorthStar", "productTitle" : "The North Star" } ] } ] } ]
source share