网站做好啦,都是用的jquery回调,
但出现1个问题!
先发布好网站。
在本地iis测试,
数据库连接方式是网络数据库,
数据显示,一切正常,
上传到ftp里,
有时候只能看到查询的1条数据显示出来,
但列表数据在网上不显示,甚至1条数据有时候也不显示,
虚拟主机是香港的空间!
求解!!!!
但出现1个问题!
先发布好网站。
在本地iis测试,
数据库连接方式是网络数据库,
数据显示,一切正常,
上传到ftp里,
有时候只能看到查询的1条数据显示出来,
但列表数据在网上不显示,甚至1条数据有时候也不显示,
虚拟主机是香港的空间!
求解!!!!
检查下数据库连接,或者JQUERY文件的路径之类
连接方式不存在问题,是不是虚拟主机不行,
虚拟主机是香港的,速度很慢,但也不影响数据显示啊!
是不是ajax回调问题,但本次测试正常,代码如下:
<!-- 行业标价 -->
<script language="javascript" type="text/javascript">
/*行业标价*/
var clicks = 0;
function block_6bind() {
//AJAX方法取得数据并显示到页面上
$.ajax({
type: "get", //使用get方法访问后台
dataType: "json", //返回json格式的数据
url: "Hybj.ashx", //要访问的后台地址
data: "clicks=" + clicks, //要发送的数据
success: function(msg) {//msg为返回的数据,在这里做数据绑定
var data = msg;
var html = '';
$.each(msg, function(comentIndex, coment) {
html += "<b><a href='#'><li id=\"" + coment['ip_id'] + "\" ; style='list-style:none; color:#FFFFFF; width:300px; height:20px;'>" + coment['ip_name'] + "</li></a></b>";
});
block_IndustryPrice_ul.innerHTML = html;
block_IndustryPrice_ul.style.lineHeight = 2;
block_IndustryPrice_ul.innerHTML += "<div id='block_6next'><b><a href='#' style='color:#FFFFFF;text-decoration:none'>下一页</a></b><div>";
block_6next.style.marginTop = 0;
block_6next.style.marginLeft = 150;
block_IndustryPrice_ul.innerHTML += "<div id='block_6befor'><b><a href='#' style='color:#FFFFFF;text-decoration:none'>上一页</a></b><div>";
block_6befor.style.marginTop = -23;
block_6befor.style.marginLeft = 90; $('#block_6next').bind('click', function() { if (i != 0) {
clicks += 1;
block_6bind();
} });
$('#block_6befor').bind('click', function() {
if (clicks != 0) {
clicks -= 1;
block_6bind();
}
});
IndustryPriceUlLiBind(); } });
}
function IndustryPriceUlLiBind() {
$('#block_IndustryPrice_ul li').bind('click', function() {
var IndustryPrice_url = ($(this).attr("id"));
detailed_IndustryPrice_show(IndustryPrice_url)
});
}
</script>------------------一般应用程序-------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using BLL;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json;namespace Web
{
/// <summary>
/// $codebehindclassname$ 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Hybj : IHttpHandler
{
int clicks = 0;
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
//不让浏览器缓存
context.Response.Buffer = true;
context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
context.Response.AddHeader("pragma", "no-cache");
context.Response.AddHeader("cache-control", "");
context.Response.CacheControl = "no-cache";
string result = ""; result = GetPageData(context.Request.Params["clicks"]); context.Response.Write(result); }
private string GetPageData(string p)
{
clicks = int.Parse(p);
DataTable dt = new DataTable();
dt = IndustryPriceManager.ResultIndustryfen(clicks);
return DataTableJson(dt); }
//Datatable转换为Json
private string DataTableJson(DataTable dt)
{
string result = "";
result = JsonConvert.SerializeObject(dt, new DataTableConverter());
return result; } public bool IsReusable
{
get
{
return false;
}
}
}
}
setTimeout('block_6_3bind()', 400);
setTimeout('block_6_4bind()', 600);
加啦,IIS可以,但FTP还是回调不成
我有碰到过是将回调回来的数据显示到列表里 但现实内容里含有特殊字符 显示的时候解释不出来
请求、返回是否正常,再看