function infscr_retrieve(pageNum) {

            var instance = this,
				opts = instance.options,
				path = opts.path,
				box, frag, desturl, method, condition,
	    		pageNum = pageNum || null,
	    		getPage = (!!pageNum) ? pageNum : opts.currPage;

            if (opts.isDestroyed) {
                this._debug('Instance already destroyed');
                return false;
            };

            // we dont want to fire the ajax multiple times
            opts.isDuringAjax = true;

            // this is where the loadingStart function goes!!!
            //($.isFunction(opts.loadingStart)) ? opts.loadingStart() : /* default*/ '';

            opts.loadingMsg.appendTo(opts.loadMsgSelector).show(opts.loadingMsgRevealSpeed, function () {

                $(opts.navSelector).hide();

                // increment the URL bit. e.g. /page/3/
                opts.currPage++;

                instance._debug('heading into ajax', path);

                // if we're dealing with a table we can't use DIVs
                box = $(opts.contentSelector).is('table') ? $('<tbody/>') : $('<div/>');


                // INSERT DEBUG ERROR FOR invalid desturl
                desturl = ($.isFunction(opts.pathParse)) ? opts.pathParse(path.join('2'), opts.currPage) : path.join(opts.currPage);
                // desturl = path.join(opts.currPage);

                // create switch parameter for append / callback
                // MAKE SURE CALLBACK EXISTS???
                method = (opts.dataType == 'html' || opts.dataType == 'json') ? opts.dataType : 'html+callback';
                if (opts.appendCallback && opts.dataType == 'html') method += '+callback'

                switch (method) {

                    case 'html+callback':

                        instance._debug('Using HTML via .load() method');
                        box.load(desturl + ' ' + opts.itemSelector, null, function infscr_ajax_callback(jqXHR, textStatus) {
                            instance._loadcallback(box, jqXHR.responseText);
                        });

                        break;

                    case 'html':
                    case 'json':

                        instance._debug('Using ' + (method.toUpperCase()) + ' via $.ajax() method');
                        $.ajax({
                            // params
                            url: desturl,
                            dataType: opts.dataType,
                            complete: function infscr_ajax_callback(jqXHR, textStatus) {
                                condition = (typeof (jqXHR.isResolved) !== 'undefined') ? (jqXHR.isResolved()) : (textStatus === "success" || textStatus === "notmodified");
                                (condition) ? instance._loadcallback(box, jqXHR.responseText) : instance._error('end');
                            }
                        });

                        break;

                }

            });

        }
// Retrieve next set of content items
Retrieve next set of content items
Retrieve next set of content items
function infscr_retrieve(pageNum) {
            var instance = this,
				opts = instance.options,
				path = opts.path,
				box, frag, desturl, method, condition,
	    		pageNum = pageNum || null,
	    		getPage = (!!pageNum) ? pageNum : opts.currPage;
            if (opts.isDestroyed) {
                this._debug('Instance already destroyed');
                return false;
            };
            opts.isDuringAjax = true;
            opts.loadingMsg.appendTo(opts.loadMsgSelector).show(opts.loadingMsgRevealSpeed, function () {
                $(opts.navSelector).hide();
                opts.currPage++;
                instance._debug('heading into ajax', path);
                box = $(opts.contentSelector).is('table') ? $('<tbody/>') : $('<div/>');
                desturl = ($.isFunction(opts.pathParse)) ? opts.pathParse(path.join('2'), opts.currPage) : path.join(opts.currPage);
                method = (opts.dataType == 'html' || opts.dataType == 'json') ? opts.dataType : 'html+callback';
                if (opts.appendCallback && opts.dataType == 'html') method += '+callback'
                switch (method) {
                    case 'html+callback':
                        instance._debug('Using HTML via .load() method');
                        box.load(desturl + ' ' + opts.itemSelector, null, function infscr_ajax_callback(jqXHR, textStatus) {
                            instance._loadcallback(box, jqXHR.responseText);
                        });
                        break;
                    case 'html':
                    case 'json':
                        instance._debug('Using ' + (method.toUpperCase()) + ' via $.ajax() method');
                        $.ajax({
                            url: desturl,
                            dataType: opts.dataType,
                            complete: function infscr_ajax_callback(jqXHR, textStatus) {
                                condition = (typeof (jqXHR.isResolved) !== 'undefined') ? (jqXHR.isResolved()) : (textStatus === "success" || textStatus === "notmodified");
                                (condition) ? instance._loadcallback(box, jqXHR.responseText) : instance._error('end');
                            }
                        });
                        break;
                }
            });
        }
function infscr_retrieve ( pageNum ) { var instance = this , opts = instance . options , path = opts . path , box , frag , desturl , method , condition , pageNum = pageNum || null , getPage = ( ! ! pageNum ) ? pageNum : opts . currPage ; if ( opts . isDestroyed ) { this . _debug ( 'Instance already destroyed' ) ; return false ; } ; opts . isDuringAjax = true ; opts . loadingMsg . appendTo ( opts . loadMsgSelector ) . show ( opts . loadingMsgRevealSpeed , function ( ) { $ ( opts . navSelector ) . hide ( ) ; opts . currPage ++ ; instance . _debug ( 'heading into ajax' , path ) ; box = $ ( opts . contentSelector ) . is ( 'table' ) ? $ ( '<tbody/>' ) : $ ( '<div/>' ) ; desturl = ( $ . isFunction ( opts . pathParse ) ) ? opts . pathParse ( path . join ( '2' ) , opts . currPage ) : path . join ( opts . currPage ) ; method = ( opts . dataType == 'html' || opts . dataType == 'json' ) ? opts . dataType : 'html+callback' ; if ( opts . appendCallback && opts . dataType == 'html' ) method += '+callback' switch ( method ) { case 'html+callback' : instance . _debug ( 'Using HTML via .load() method' ) ; box . load ( desturl + ' ' + opts . itemSelector , null , function infscr_ajax_callback ( jqXHR , textStatus ) { instance . _loadcallback ( box , jqXHR . responseText ) ; } ) ; break ; case 'html' : case 'json' : instance . _debug ( 'Using ' + ( method . toUpperCase ( ) ) + ' via $.ajax() method' ) ; $ . ajax ( { url : desturl , dataType : opts . dataType , complete : function infscr_ajax_callback ( jqXHR , textStatus ) { condition = ( typeof ( jqXHR . isResolved ) !== 'undefined' ) ? ( jqXHR . isResolved ( ) ) : ( textStatus === "success" || textStatus === "notmodified" ) ; ( condition ) ? instance . _loadcallback ( box , jqXHR . responseText ) : instance . _error ( 'end' ) ; } } ) ; break ; } } ) ; }
Retrieve next set of content items
Retrieve next set of content items
// we dont want to fire the ajax multiple times // this is where the loadingStart function goes!!! //($.isFunction(opts.loadingStart)) ? opts.loadingStart() : /* default*/ ''; // increment the URL bit. e.g. /page/3/ // if we're dealing with a table we can't use DIVs // INSERT DEBUG ERROR FOR invalid desturl // desturl = path.join(opts.currPage); // create switch parameter for append / callback // MAKE SURE CALLBACK EXISTS??? // params