Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119538

jobhesk on "[Plugin: JSON API] give me an example"

$
0
0

this is what i got so far..

jQuery.fn.hkmtype_event_indexpage = function() {
	this.html("");
	var Dis = this;
	var url = wsm_base_obj.domainbasejson + "get_recent_posts&post_type=hkmtype_event&order_by=date&order=desc&count=4";
	jQuery.ajax(url).done(function(jsonlocal) {
		//eval("var o=" + jsonlocal + ";");
		if (jsonlocal.status != "ok") {
			alert("request error... line 75");
			return false;
		}
		var data = jsonlocal.posts;
		//alert(data.length);
		for (var i = 0; i < data.length; i++) {
			h = "<div class=\"item even_poster line\">" + data[i]["title_plain"] + "</div>";
			//alert(data[i]["title_plain"]);
			Dis.append(h).click(function() {
					//alert("this is go");
			//loop it all
			});
		}
	});

Viewing all articles
Browse latest Browse all 119538

Trending Articles