A newbie question,
I am trying to use Freebase Suggest as a tagging resource for my Django project. I want to extract item name, type and id. For example, as you can see in the screenshot, I want to extract the name ‘Pearl Jam’ ,its id ‘/en/pearl_jam’, and the type ‘band’.
How can I post this data to my view?
Using the function below I can only create links to the tags.
$(function(){
$("#myinput").suggest().bind("fb-select", function(e, data) {
$('#myinput').val(''); // clear the input
$('#returnValueOfFreebase').append('<a href="http://freebase.com/view'+ data.id +'">'+ data.name +'</a> ')})
});
You already have the name and the ID from
data.nameanddata.id. You can also access the notable type from your callback function by usingdata['n:type'].namelike this:If you want to capture this data and post it back to your web app, you can create some hidden inputs and set their value from the Freebase suggest callback. Like this: