Skip to main content

Bug Tracker

Side navigation

Ticket #3291: error.js
File error.js, 0.9 KB (added by Dr4g0nF1y, August 27, 2008 06:47AM UTC)

Short Version of the js-file. It's directly included and does not have external scripting on the HTML-file

$(function() {
	var getcontent = function(handler, section, id, sort) {
		var json = null;
		
		var id_arr = (id.constructor.toString().indexOf("Array")>-1);
		var id_str = "";
		if(id_arr) {
			for(var idi = 0; idi < id.length; idi++) {
				id_str += "&id[]=" + id[idi];
			}
		} else {
			id_str += "&id=" + id;
		}
		
		var uri = 'json.php?s=' + section + id_str + '&sort=' + sort;
		
		/** Here is the error thrown **/
		json = $.ajax({
			url: uri,
			async: false
			}).responseText;
		eval(handler + '(' + json + ');');
	}
	window.getcontent = getcontent;
	
	$(document).ready(function() {
		try {
			window.getcontent('handleFotoBoek','fotoboek',-1,'id');
		} catch (e) { alert(e.message.toString()); }
	});
});
function handleFotoBoek(data) {
	if(checkdata(data)) {
		// Cleaning up the carousel
		/** Never Arrives here **/
	}
};

Download in other formats:

Original Format