| 
 <script language="javascript" src="include/prototype.js"></script> <script> 
function searchpro(){ var p_cid=$F("p_type"); var url="http://localhost:8080/Createwebsite/web/showpic.asp" var pars="p_classParentID="+p_cid; 
var myAjax=new Ajax.Request(url,{method:'get',parameters:pars,onComplete:showResponse}); 
} function showResponse(originalRequest){ $("showpic").innerHTML=originalRequest.responseText; } 
var myGlobalHandlers = { onCreate: function(){ Element.show('systemWorking'); }, onComplete: function() { if(Ajax.activeRequestCount == 0){ Element.hide('systemWorking'); } } }; 
 Ajax.Responders.register(myGlobalHandlers); 
 function getHTML() { var p_cid=$F("p_type"); var url="http://localhost:8080/Createwebsite/web/showpic.asp"; var pars="p_classParentID="+p_cid; 
var myAjax = new Ajax.Updater( 'placeholder', url, { method: 'get', parameters: pars }); 
} 
</script> 
</head> 
 <body> <select name="p_type" onchange="searchpro();"> <option value="39">全部</option> <option selected value="14">___---</option>  </select>YY为什么会?? <input type=button value=GetHtml onclick="getHTML()"> <div id="placeholder"></div> <div id="systemWorking" style="display:none;"><img src="image/group101.gif"></div> <div id="showpic">新产品</div> 
  
  
按照书上的例子写了段代码. 
但结果出现了乱码. 
在网上收了些解决方案. 
1.将prototype.js包存为utf-8编码.但没有效果. 
2.将上页也改为utf-8却没有内容. 
3.在http://localhost:8080/Createwebsite/web/showpic.asp中加上 
<% Response.CodePage=65001%> <% Response.Charset="UTF-8" %> 
问题解决.  |