Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery TagCloud
    primarykey
    data
    text
    <p>Hi I am trying to write a tag cloud using jquery xml+MySql and php. I am trying to build a list of HREF's using jQuery and then populate a div with them. They are styled differently depending on the amount of times they are found in the db (COUNT(GenreName) as Count). The div isn't being populated with the list. I am wondering if it is a problem with the way I have created the list... or an I wayyyy off in my methodology.<br> What I have done so far is this</p> <pre><code>function GetGenres (){ var Count = array(); var GenreName=array(); var tagcloudLink $.post("tagcloud.php", function(data){ //create list for Genre tags $("&lt;ul&gt;").attr("id", "tagList").appendTo("#tagCloud"); //create list item var li = $("&lt;li&gt;"); $('row', data).each(function(i){ Genre[i] = $(this).find("GenreName").text(); Count[i] = $(this).find("Count").text(); tagCloudLink += "&lt;a href=\"javascript:void(0)\"onclick=\"Genre_Clicked('"+Genre[i]+"')\"&gt;'"+ Genre[i] + "'&lt;/a&gt;"; tagCloudLink.appendTo(li); //set tag size li.children().css("fontSize", (Count[i] / 10 &lt; 1) ? Count[i] / 10 + 1 + "em": (Count[i] / 10 &gt; 2) ? "2em" : val.freq / 10 + "em"); //add to list li.appendTo("#tagList"); }); }, 'xml'); } $(document).ready(function() { GetGenres(); }); </code></pre> <p>Also Here is a sample of the XML</p> <p><code>&lt;result&gt; − &lt;row&gt; &lt;Count&gt;5&lt;/Count&gt; &lt;GenreName&gt;Action&lt;/GenreName&gt; &lt;/row&gt;&lt;/result&gt;</code></p> <p>Any advice would be greatly appreciated. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload