26
In order to interact with the modules, the framework should contain lists, for example, the modules that offer a list like news, forums, downloads, videos, music, etc., should attach this piece of jquery code:
$('#list').live('pageshow', function (event, ui) {
var t = "";
var param = getParameterByName('type');
var jsurl = "/search.php?query=" + param;
$.ajax({
type: "GET",
url: jsurl,
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var data = eval(msg);
$.each(data, function (rec) {
t += "<li><a href='modules/downloads/product.php?id=" + this.Id + "'>";
t += "<img src='" + this.Cover + "'/>";
t += "<h3>" + this.Title + "</h3>";
t += "<p style='font-size:11px'>";
t += "<span>Price: €" + this.Price + "</span>";
t += "<span> €" + this.PriceForegone + "</span>";
t += "<span>" + this.Discount + "%</span>";
t += "</p>";
t += "</a></li>";
});
$("[data-role=listview]").html(t);
$("[data-role=listview]").listview('refresh');
},
error: function (msg) {
alert(msg.status + ' ' + msg.statusText);
}
});
});
Tell me what you think or if you have other ideas let me know...
http://mobile.txmodxoops.org