Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÈçºÎÔÚJava ´úÂëÖÐÖ´ÐÐ JavaScript

 ÔÚʵ¼ÊÓ¦ÓÃÖУ¬¿ÉÄÜ»áÅöµ½ÕâÑùµÄÇé¿ö£¬ÐèÒªÔÚJava´úÂëÖÐÖ´ÐÐJavaScript¡£
 ÀýÈç:
  import java.io.IOException;
import java.io.PrintWriter;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class JsService {
/**
* function : ÔÚjavaÀàÖУ¬Ö´ÐÐjavascript´úÂë
* @param request
* @param response
*/
public static void postJavascriptOnHTML(HttpServletRequest request, HttpServletResponse response,String javascript){
StringBuffer buffer = new StringBuffer();
buffer.append("<mce:script type="text/javascript"><!--
\n").append(javascript).append("\n
// --></mce:script>\n");
outputResponse(request,response,buffer);
}
public static void alertMessageOnHTML(HttpServletRequest request, HttpServletResponse response,String message){
StringBuffer buffer = new StringBuffer();
buffer.append("<mce:script type="text/javascript"><!--
\n")
.append(" alert('" + message + "');\n")
.append("
// --></mce:script>");
outputResponse(request,response,buffer);
}
public static void putResultInResponse(HttpServletResponse response,String result){
StringBuffer buffer = new StringBuffer();
buffer.append(result);
outputResponse(null, response, buffer);
}
private static void outputResponse(HttpServletRequest request,HttpServletResponse response,StringBuffer buffer){
try {
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter writer;
writer = response.getWriter();
writer.write(buffer.toString());
writer.flush();
writer.close();
FacesContext context = FacesContext.getCurrentInstance();
if(context != null)
context.responseComplete();
} catch (IOException e) {
e.printStackTrace();
}
}
}


Ïà¹ØÎĵµ£º

ʹÓÃjavascript ²éѯÌض¨µÄtableÖеÄÄÚÈÝ

 Ò³ÃæÖÐÓÐÒ»¸ötable°üº¬Á½ÁУ¬Êý¾ÝÓɺǫ́Éú³É£¬ÐÐÊý²»¶¨£º£¨Èçͼ£©
ԭʼÊý¾Ý£º
ÏÖÔÚͨ¹ýjavascript½øÐвéѯ£¬Ð§¹ûÈçÏÂÈýͼ£º
¿ªÊ¼²éѯ
²éѯÖÐ......
²éѯµÃµ½µÄ×Ôºó½á¹û
JAVASCRIPT´úÂ룺
 
JS´úÂë
<script language="javascript" tpe="text/javascript">
function searchMateria ......

Ïê½âFirefox 3.5µÄÐÂJavaScriptÒýÇæ

 ±¾ÎÄ×÷ÕßΪDavid
Mandelin£¬©¤©¤Mozilla JavaScriptÍŶӹ¤×÷ÈËÔ±¡£
Firefox 3.5ÓµÓÐÒ»¸öȫеÄJavaScriptÒýÇ棬½Ð×öTraceMonkey£¬ÔÚ¸ÃÒýÇæÉÏÅÜJSÓ¦ÓÃÒª±ÈFirefox
3¿ìµ½3-4±¶£¬´Ó¶øΪÏÖÓеÄÍøÂçÓ¦ÓüÓËÙ¡£ÕâƪÎÄÕ´óÖµÄÃèÊöÒ»ÏÂÔÚTraceMonkeyÖаüÀ¨µÄÖØÒª²¿¼þ£¬ÒÔ¼°ËûÃÇÊÇÈçºÎ¼ÓËÙJavaScriptµÄ¡£Í¬Ñù£¬ÔÚÁ˽âÕâÐ ......

·þÎñÆ÷¶Ëjavascriptµ¯³ö¶Ô»°¿òºÍÎļþ¡¢Ä¿Â¼²Ù×÷

//·þÎñÆ÷µ¯³ö¶Ô»°¿ò
 if (lcSID == "1" && (txtNsp.Text.Trim() != lcNewspaper || Convert.ToDateTime(txtNspdate.Text.Trim()) != Convert.ToDateTime(lcNspdate)))
        {
            string lcJs = "v ......

javascript Îı¾¿òˢеÄʱºò±£´æÎı¾Öµ

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ......

URI¡¢URL¡¢URNµÄÔ­Àí¡¢Çø±ð¼°JAVAµÄʵÏÖ

 
ʲôÊÇURI
WebÉÏ¿ÉÓõÄÿÖÖ×ÊÔ´ - HTMLÎĵµ¡¢Í¼Ïñ¡¢ÊÓƵƬ¶Î¡¢³ÌÐòµÈ - ÓÉÒ»¸öͨ¹ýͨ
ÓÃ×ÊÔ´±êÖ¾·û£¨Universal Resource Identifier, ¼ò³Æ"URI"£©½øÐж¨Î»¡£
URIÒ»°ãÓÉÈý²¿·Ö×é³É£º
·ÃÎÊ×ÊÔ´µÄÃüÃû»úÖÆ¡£
´æ·Å×ÊÔ´µÄÖ÷»úÃû¡£
×ÊÔ´×ÔÉíµÄÃû³Æ£¬ÓÉ·¾¶±íʾ¡£
¿¼ÂÇÏÂÃæµÄURI£¬Ëü±íʾÁ˵±Ç°µÄHTML ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ