[solved]have something wrong of my code?(about ajax and pull to refresh) ;)

refresh:function(){
	        	var $ptrContent = app.ptr.get('.xl-t2a.ptr-content');
	    		console.log($ptrContent);
				// Add 'refresh' listener on it
				console.log(1);
				$ptrContent.on('refresh',function (e) {console.log(2);
				  // Emulate 2s loading
				  setTimeout(function () {console.log(3);
				    app.request({  **//it's not accessible**
			        	url: 'http://118.31.41.112:9099/api/live/list/dowm?livetype=3&stid=0&top=1',
			        	method: "GET",
			        	datatype:"json",
			        	crossDomain: true,
			        	success: function(data) {
			        		console.log(data);
			        		var blog = JSON.parse(data);
			        		var objx = JSON.parse(blog);
		        			var itemHtml = '';	
		        			if (objx.Comment =='' ) {
							    return;
							}
				            for (var i = 0; i < objx.Comment.length; i++) {
				            	var ltxt ='';
				            	if (obj.Comment[i].LiveStatus == 0) {
				            		ltxt = '已结束';
				            	} else {
				            		ltxt = '未开始';
				            	}
				              	itemHtml += '<li>'+
						   				    '<a href="/product/'+objx.Comment[i].Id+'/" class="jumpother" style="display: flex;">'+
					   					    '<div class="item-media"><img src="'+objx.Comment[i].LiveImageUrl+'" style="width: 70px;height: 70px;border-radius: 50%;margin-left: 15px;"></div>'+
							                '<div class="item-inner" style="line-height: 41px;">'+
							                '<div class="item-title-row">'+
							                '<div class="item-title">'+objx.Comment[i].LiveChannelName+'</div>'+
							                '</div>'+
							                '<div class="item-subtitle" style="color: #0093FF;">'+ltxt+'</div>'+
							                '<span style="position: absolute;top: 50%;right: 10px;margin-top: -10px;"><i class="f7-icons" style="color: red;">play</i></span>'+
						            		'</div>'+
						   					'</a>'+
							   				'</li>';
				            }
				            $ptrContent.find('ul').prepend(itemHTML);
							console.log(4);
			        	}
			        });
				    // When loading done, we need to reset it
				    app.ptr.done(); // or e.detail();
				  }, 800);
				});
	        }

for help,please!!! thanks!!!:持之以恒:

Change “dowm” in to “down” in the url.

The following url seems to work:
http://118.31.41.112:9099/api/live/list/down?livetype=3&stid=0&top=1

1 Like

thank for your reply so much,i am ashamed,i wasted your precious time…i need more careful…:失望: