JSP grammar brief (transfer)

xiaoxiao2021-03-06  43

HTML Comment Displays a comment on the client. JSP syntax ] -> Example 1 in the client's HTML source code Generate and the same data: Example 2 -> Displayed in the client's HTML source code as: Describes this annotation and HTML very like, that is, it can "View Source Code" It is seen in it. The only thing is different, you can use expressions in this comment (shown in Example 2). This expression is not different, different from the page, you can use various expressions, as long as it is legal Opportunity. More, see the expression =========================================== ============== Hide Note Write in the JSP program, but not sent to customers. JSP syntax <% -%>: <% @ page language = "java"%> a comment test </ title> </ head> <body> <h2> A Test of Comments </ h2> <Comment Will NOT BE VISIBLE IN THE Page Source -%> </ body> </ html> Description The character with hidden comment tags is ignored when JSP compile. This comment is useful when you want to hide or annotate your JSP program.</p> <p>The JSP compiler does not compile the statement between <%-and -%>, which does not appear in the customer's browser, nor does it see in the source code in <% - %> You can write a comment statement, but you can't use "-%>", if you do not use "-%>". ============== ============================================================================================================================================================================================================= Declare the legal variable and method JSP syntax <%! Declaration; [declaration;] ...%> <%! Int 1, b, c;%> <%! INT i = 0;%> <%! INT A, B, C;% > <%! Circle a = new circle (2.0);%> Description Declare that the variables and methods you want to use in the JSP program. You must also do this, or you will make mistakes. You can declare multiple variables and methods in one time, as long as you end, you will be legal in Java. When you declare methods or variables, please pay attention to some of the following rules: The statement must be ";" end (Scriptlet has the same rules, but the expression is different). You can use it directly in <% @ Page%> Contains the already declared variables and methods, do not need to be re-declared. A statement is only valid in one page. If you want each page to use some statements, it is best to write them into a separate file, then use <% @ include%> or <jsp: include> element. ============================================================================================================================================================================================================= ================ Expression contains a JSP syntax expression JSP syntax <% = expression%> example <font color = "blue"> <% = map.size )%> </ font> <b> <% = number> </ b>. Description expression elements indicate a expression defined in a scripting language, which is automatically converted to String, then inserted into this expressed display in the JSP file.</p> <p>Because the value of this expression has been converted into a string, you can insert this expression in a line of text (the form and ASP is exactly the same). Please remember the following points when you use an expression in JSP: You can't Use a semicolon (";") as an end of the expression. But the same expression is used in a scripTlet! View Scriptlet This expression element can include any expression that is valid in Java Language Specification. Sometimes expressions can also be attribute values ​​for other JSP elements. One expression can become complicated, it may be made of one or more Expression composition, the order of these expressions is from left to right. ============================================================================================================================================================================================================= ================ Scriptlet contains a valid block. JSP syntax <% code fragment%> example <% string name = null; if (Request.GetParameter ("name") == NULL) {%> <% @ include file = "error.html"%> <%} else {foo.setname ("name"); if (foo.getname (). EqualsignoreCase. INTEGRA ")) Name =" acura "; if (" Acura ") {%> Description A scripTlet can include multiple JSP statements, methods, variables, expressions because of Scriptlet, we can do the following things : The declaration of the variables or methods that will be used (reference declarations). Write a JSP expression (reference expression). Use any implicit objects and any objects that use <JSP: usebean> to write JSP statements (if you are using Java language, these statements must follow Java Language Specification,). Any text, HTML tag, and JSP elements must be in the ScriptleTlet When JSP receives the customer's request, the scriptlet will be executed if the scriptlet has the content displayed, which The content is existing in the OUT object.</p> <p>============================================================================================================================================================================================================= ==================================================================================================================== "RelativeURL"%> example include.jsp: <html> <head> <title> an include test </ title> </ head> <body bgcolor = "white> <font color =" blue "> The current date and Time area <% @ include file = "DATE.JSP"%> </ font> </ body> </ html> Date.jsp: <% @ page import = "java.util. *"%> <% = New java.util.date ()) .tolocalestring ()%> Displays in the page: The Current Date and Time Are Aug 30, 1999 2:38:40 Description <% @ include%> Directance will compile in JSP Insert a file containing text or code, when you use <% @ include%> command, this included process is static. Static container means that this file containing files will be inserted into the JSP file. This containable file can be a JSP file, an HTML file, a text file. If included is a JSP file, the code in this file containing the JSP will be executed. If you just use INCLUDE to include a static file. The result of this containing files will be inserted into the JSP file where you are <% @ include%>.</p> <p>Once the included file is executed, the process of the primary JSP file will be recovered, continue to perform the next line. This is included in the HTML file, JSP file, text file, or just a Java code, but you have to pay attention to this included <HTML>, </ HTML>, <body>, </ body> tag can not be used in the file, as this will affect the same tag in the original JSP file, which sometimes causes errors. Some <% @ include% > The behavior of the command is based on special JSP compilation conditions, such as: This file must be open to all customers and must be valid, or it has secure restrictions if this containment is changed, including this file The JSP file will be recompiled: file = "relativeurl" This containing file name is generally referring to the relative path, does not need to port, protocol, and domain name, as follows: "Error.jsp" / templates / online. HTML "/ beans / calendar.jsp" If this path starts with "/", then this path is primarily referring to the up and down relationship path of the JSP application. If the path starts with a file name or directory name, then this path is being used. The current path of the JSP file. ============================================= ======================= Page instruction defines global properties in the JSP file. JSP syntax <% @ Page [language = "java"] [eXtends = "package .class "] [import =" {package.class / package. *}, ... "] [session =" true / false "] [buffer =" none / 8kb / sizekb "] [Autoflush =" true / false "] [isthreadsafe =" true / false "] [INFO =" text "] [errorpage =" relativeurl "] [contenttype =" mimetype [; charSet = characterset] "/" text / html; charSet = ISO-8859-1 "] [iSerrorPage =" true / false "]%> example <% @ page import =" java.util. *, java.lang . * "%> <% @ Page Buffer =" 5KB "Autoflush =" false "%> <% @</p> <p>Page ErrorPage = "Error.jsp"%> Description <% @ Page%> The instruction applies to the entire JSP page, and also includes static include files. But <% @ page%> The instruction does not act on dynamic containing files, such as <JSP: include> You can use multiple <% @ PAGE%> instructions in a page, but the properties can only be used once, but There is also an exception, that is the import property. Because the Import property and the Import statement in Java are almost (refer to Java Language), you can use this property a few times. Whether you put <% @ Page%> instructions in JSP files, its role range It is the entire JSP page. However, for the readability of the JSP program, and good program habits, it is best to put it on the top of the JSP file. Attribute language = "java" declares the type of scripting language, temporarily only "java" extends = " Package.class "Moves full names for Java Class when JSP compile, but cautiously use it, it limits the compiletability of JSP. Import =" {package.class / package. *}, ... " A list of imported Java packages, these packages act on blocks, expressions, and declarations. The following packages have been imported at JSP compile, so you don't need to specify again: java.lans. * Javax.servlet.jsp. * Javax.servlet.http. * Session = "true / false "Set whether the customer needs http session. (Soced with ASP, it should be unfamiliar with it) if it is true, then Session is useful. If it has false, then you can't use the Session object, and define the <JSP: UseBean> element of Scope = Session. Such use can cause errors. The default is true. Buffer = "none / 8kb / sizekb" The size of the buffer is used by the OUT object to handle the executionful JSP to the client browser. The default is 8KB autoflush = "true / false" setting If the buffer overflows, if it is necessary to force the output, if its value is defined as true (default), the output is normal, if it is set to false, if this buffer overflows, It will cause an unexpected error. If you set the buffer to none, you can't set autoflush to false. IsthReadsafe = "true / false" Set whether the JSP file can be used multithreaded. The default value is true, that is, JSP can handle a request for multiple users at the same time. If set to false, a JSP can only process a request info = "text" once in execution JSP will be joined JSP In, you can retrieve it using the servlet.getServletInfo method. ErrorPage = "RelativeURL" Sets the JSP file that handles exception events.</p> <p>iSerrorPage = "true / false" Set whether this page is an error page, if you are set to true, you can use the Exception object. ContentType = "MimeType [; charset = characterset]" / "text / html; charset = ISO-8859 -1 "Set the MIME type. The default MIME type is: text / html, the default character set is ISO-8859-1. =============================== ============================================= Taglib command defines a prefix of a label library and its custom label. JSP syntax <% @ Taglib URI = "uritotaglibrary" prefix = "tagprefix"%> example <% @ taglib uri = "http://www.jspcentral.com/tags" prefix = "public"%> <public: loop> </ public: loop> Description <% @ taglib%> The directive declares that this JSP file uses a custom label, and references the label library, also specifies the prefix of their label. The custom label here contains tags and elements. Because the JSP file can be converted to XML, it is important to understand the connection between the label and elements. The label is just a mark that is raised in a sense, which is part of the JSP element. The JSP element is part of the JSP syntax, and the start tag and end tag are the same as XML. Elements can also contain other texts, tags, and elements. For example, a JSP: plugin element has <JSP: Plugin> Start tag and </ jsp: plugin> end tags, etc., you can also have <JSP: params> and <JSP: Fallback> Elements. You must use the custom label before using custom labels Use <% @ taglib%> command, and you can use multiple times in a page, but the prefix can only use the attribute uri = "uriTotaglibrary" Uniform Resource Identifier (URI) unique to the custom label according to the prefix of the label Name, the URI can be the following: Uniform Resource Locator (URL), is defined by RFC 2396, view http://www.hut.fi/u/jkorpela/rfc/2396/full.html Uniform Resource Name (URN), Define a relative or absolute path from RFC 2396 prefix = "tagprefix" before the prefix before the custom label, such as public: PUBLIC in <public: loop>, if this is not written here, then this is not legal.</p> <p>Please do not use JSP, JSPX, Java, Javax, Servlet, Sun, and SUNW as your prefix ======================================================================================================================================================================================================================= ======================================================== 重 向 一 h 一 h Files, JSP files, or a block. JSP syntax <jsp: forward page = {"relativeURL" / "<% = expression%>"} /> or <jsp: forward page = {"relativeURL" / "<% = Expression%> "}> <jsp: param name =" parametername "value =" {parameterValue / <% = express%>} "/> </ jsp: Forward> example <jsp: forward page =" / servlet / Login "/> <jsp: forward page =" / servlet / login "> <jsp: param name =" username "value =" jsmith "/> </ jsp: forward> Description <JSP: Forward> Tag from a JSP file Passing another request to another request. The code below the <JSP: Forward> tab will not be executed. You can send parameters and values ​​to the target file, in this example we passed the parameters named username, value For Scott, if you use the <JSP: Param> tag, the target file must be a dynamic file to handle parameters. If you use non-buffered output, use <JSP: Forward> to be careful. If you use <JSP: Forward>, the JSP file already has data, then the file execution will be wrong. Attributes Page = "{relativeurl / <% = express%>}" is an expression or a string Used to illustrate the file or URL you will oriented. This file can be a JSP, block, or other file capable of handling the request object (such as ASP, CGI, PHP). <Jsp: param name = "parameters" value = "{ ParameterValue / <% = Expression%>} "/> Send one or more parameters to a dynamic file, this file must be a dynamic file. If you want to pass multiple parameters, you can use multiple" in a JSP file. JSP: param>.</p> <p>Name Specify parameter name, value specifies parameter value. ========================================= ========================================================================================================= < JSP: getProperty name = "beaninstancename" proty = "preordyname" /> example <jsp: usebean id = "calendar" scope = "page" class = "employee.calendar" /> <h2> Calendar of <jsp: getProperty Name = "Calendar" Property = "UserName" /> </ h2> Description This <JSP: getProperty> element will get the properties value of the bean, and can be used or displayed in the JSP page. Before you use <JSP: getProperty> You must create it with <JSP: Usebean>. <Jsp: getproperty> Elements There are some restrictions: You can't use <JSP: getProperty> to retrieve an indexable property you can use <JSP: getProperty with the JavaBeans component >, But cannot be used with Enterprise Bean. The name of the attribute name = "beaninstancename" bean, by <JSP: UseBean> Specifies the property name specified by Property = "PropertyName".</p> <p>Tip: In the JSP reference in Sun, if you use <JSP: getProperty> to retrieve the value is null, then NullPointersException will appear, and if you use a block or expression to retrieve its value, then in the browser The appearance is NULL (empty). =========================================== ============================= <jsp: include> contains a static or dynamic file. JSP syntax <jsp: include page = " {relativeurl / <% = expression%>} "flush =" true "/> or <jsp: include page =" {relativeurl / <% = expression%>} "Flush =" true "> <jsp: param name =" ParameterName "value =" {parameterValue / <% = expression%>} "/> </ jsp: include> Examples <JSP: include page =" scripts / login.jsp "/> <jsp: include page =" Copyright. HTML "/> <jsp: include page =" / index.html "/> <jsp: include page =" scripts / login.jsp "> <jsp: param name =" username "value =" jsmith "/> </ JSP: Include> Description <JSP: Include> Elements Allows you to include dynamic files and static, both of which contain files are different. If the file is just a static file, this includes adding the contents of the included file to the JSP file, and if this file is dynamically, then this containing file will be executed by the JSP compiler (this is similar to the ASP You can't judge a file from a file name to be dynamic or static, such as aspcn.asp may just contain some information, without the need. <jsp: include> can handle these two files at the same time, so you don't need to include this file is dynamic or static. If this included file is dynamic, then you can also use <JSP: param> Parameter names and parameter values ​​are also passed.</p> <p>Attributes Page = "{relativeurl / <% = expression%>}" parameter is a relative path, or represents a relative path expression. Flush = "true" Here you must use flush = "true", you can't use false value The default value is false <jsp: param name = "parameters" value = "{parameterValue / <% = expression%>}" /> <jsp: param> clause allow you to pass one or more parameters to dynamic Document You can use multiple <JSP: param> to deliver multiple parameters in a page. ============================== ============================================== <jsp: plugin> Perform an applet or bean, it is possible If you want to download a Java plugin for execution it. JSP syntax <jsp: plugin type = "bean / applet" code = "classfilename" codebase = "classfileDirectoryName" [name = "instanceename"] [Archive = "uritoarchive, .. "] [align =" bottom / top / middle / left / right "] [width =" displaypixels "] [hspace =" lefTrightpixels "] [vSpace =" topbottompixels "] [jreversion =" JreversionNumber / 1.1 "] [nspluginURL =" URLTOPLUGINURL = "URLTOPLUGINURL =" URLTOPLUGINURL = "URLTOPLUGIN"]> [<jsp: params> [<jsp: param name = "parameters" value = "{parameterValue / <% = express%>}" />] </ jsp: params>] [<JSP: Fallback> Text Message for User </ jsp: Fallback>] </ jsp: plugin> example <jsp: plug In type = applet code = "molecule.class" codebase = "/ html"> <jsp: params> <jsp: param name =</p> <p>"Molecule" value = "molecules / benzene.mol" /> </ jsp: params> <jsp: Fallback> <P> Unable to load applet </ p> </ jsp: Fallback> </ jsp: plugin> Description < JSP: PLUGIN> Elements are used to play or display an object in the browser (typical is applet and bean), and this display requires a Java plugin in the browser. When the JSP file is compiled, when sending to the browser, the <jsp: plugin> element will replace the "Object> or <Embed> element according to the version of the browser. Note, <Object> is used for HTML 4.0, <Embed> for HTML 3.2. In general, <JSP: plugin> element specifies the object is applet or bean, and also specifies the name of the Class, there is also location, Will specify where to download this Java plugin. Specifically: Property Type = "bean / applet". The type of plugin object to be executed, you must specify this bean or applet, because this property does not have a default. Code = "classfilename" will be executed by Java plugin The name of Java Class must end with .class.</p> <p>This file must exist in the directory specified by the CodeBase property. CodeBase = "classfileDirectoryName" will be executed Directory (or path) of the java class file, if you do not provide this property, use the JSP file of <JSP: plugin> The directory will be used. Name = "instancename" this bean or applet instance name, it will call other places in JSP. Archive = "uritoarchive, ..." Some path names separate from comma, these path names Used to pre-install some Class, which increases the performance of Applets. Align = "bottom / top / middle / left / right" graphics, objects, Applet location, have the following values: bottom Top Middle Left Right Height = " DisplayPixels "Width =" DisplayPixels "Applet or bean will display the long width value, this value is a number, the unit is pixel. Hspace =" Leftrightpixels "vSpace =" TopBottompixels "Applet or bean is displayed at the screen, up and down The space left, the unit is pixels. Jreversion = "jreversionNumber / 1.1" Applet or bean runs the required Java Runtime Environment (JRE) version. The default is 1.1. NspluginURL = "URLTOPLUGIN" Netscape Navigator users can use JRE download address, this value is a standard URL, such as http://www.aspcn.com/jsp iepluginurl = "URLTOPLUGIN" IE user download address, this value is a standard URL, such as http : //www.aspcn.com/jsp <jsp: params> [<jsp: param name = "parameters" value = "{parameterValue / <% = express%>}" />] </ jsp: params> you The parameters or parameter values ​​that need to be transmitted to the applet or bean.</p> <p><JSP: Fallback> Text Message for User </ jsp: Fallback> A text is displayed to the user when the Java plugin cannot start, if the plugin can start and the applet or bean cannot, the browser has an error message pop-up. = ============================================================================================================================================================================================================= ====================== <jsp: setProperty> Set the attribute value in the bean. JSP syntax <jsp: setProperty name = "beaninstancename" {property = "* "/ Property =" PropertyName "[param =" parametername "] / property =" PropertyName "value =" {string / <% = expression%>} "} /> example <jsp: setproperty name =" MyBean "Property =" * "/> <jsp: setProperty name =" mybean "property =" username "/> <jsp: setProperty name =" mybean "property =" username "value =" steve "/> description <JSP: setProperty> Element Using Bean A given setter method, set one or more attribute values ​​in the bean. You must use the <JSP: UseBean> to declare this bean before using this element. Because, <JSP: UseBean> and <JSP: setProperty> are associated, and the name of the Bean instance they use should also match. (That is, the value of Name in <jsp: setProperty> should be the same as the value of id in <jsp: usebean> you can use <JSP: setProperty> to set the property value: input by the user All values ​​(in the Request object in parameter storage) to match the properties in the bean to match the specified values ​​of the user to match the attributes specified in the BEAN to match the property of the bean attributes each setting. The method of the attribute value has its specific syntax. Here we will talk about the name of the reality and its usage name = "beaninstancename" indicates the name of the bean instance that is already created in <jsp: usebean>. Property = "*" Store users in JSP All values ​​input are used to match the properties in the bean.</p> <p>The name of the attribute in the bean is consistent with the parameter name in the Request object. The parameter value transmitted from the customer is generally the character type, which must be converted into other types in the bean. The type of bean property is listed in the table below and their conversion method. Transform strings into other types of methods. Property type method Boolean or boolean java.lang.Boolean.Valueof (string) Byte or byte java.lang. Byte.valueOf (String) char or Character java.lang.Character.valueOf (String) double or Double java.lang.Double.valueOf (String) integer or Integer java.lang.Integer.valueOf (String) float or float java. Lang.float.Valueof (String) long.valueof (String) If there is a nougant value in the parameter value of the Request object, the corresponding bean property will not set any values. Similarly, if there is an attribute in the bean without the corresponding request parameter value, then this attribute is also not set. Property = "PropertyName" [param = "parametername"] Use a parameter value in the request to specify bean A property value. In this syntax, Property specifies the bean's attribute name. PARAM specifies the parameter name in the request. If the bean property is different from the name of the request parameter, then you must specify Property and Param, if they are the same name, then you just need to specify Property will be. If the value is empty (or not initialized), the corresponding bean attribute is not set. Property = "PropertyName" value = "{string / <% = express%>}" uses the specified value to set Set the bean property. This value can be a string or an expression. If this string, it will be converted to the type of the bean property (see the above table). If it is an expression, then its type must be consistent with the type of attribute value to be set. If the parameter value is empty, the corresponding attribute value will not be set.</p> <p>Also, you can't use Param and Value tips in a <jsp: setProperty>. If you use Property = "*", then the properties of the bean are not necessary to sort in the order in the HTML form ========= ============================================================================================================================================================================================================= ============ <jsp: UseBean> Create a bean instance and specify its name and scope. JSP syntax <jsp: usebean id = "beanting" scope = "Page / Request / Session / Application "{class =" package.class "/ type =" package.class "/ class =" package.class "type =" package.class "/ beanname =" {package.class / <% = expression%>} " Type = "package.class"} {/> /> ● = "CART" scope = "session" class = "session.carts" /> <jsp: setProperty Name = "Cart" Property = "*" /> <jsp: usebean id = "checking" scope = "session" class = "bank.checking> <jsp: setProperty name =" checking "proty =" balance "value = "0.0" /> </ jsp: UseBean> Description <JSP: UseBean> Used to position or sample a JavaBeans component. <JSP: Usebean> You will try to locate a bean instance if this bean does not exist, then <JSP: UseBean> is an example from a Class or template. For positioning or examples of a bean, <JSP: UseBean> will perform the following steps, the order is as follows: Try to locate a bean by a given name and scope. Reference variables for this bean object are named at the name you specify. If this bean is found This will be stored in this variable. If you also specify the type, this bean is also set to the corresponding type. If this bean is not found, it will be sampled from the class you specify and this reference is stored in a new variable.</p> <p>If the name of this class represents a template, this bean is sampled by java.beans.beans.instantiate. If <JSP: Usebean> has been sample (not positioning) Bean, <JSP: Usebean> and </ jsp: Usebean> There is element, then the code will be executed. The body of <JSP: UseBean> element is usually included with the <JSP: SetProperty> element for setting the properties of the bean. As mentioned above, the principal of <JSP: usebean> is only executed when the <JSP: UseBean> sample bean is executed, if this bean already exists, <JSP: usebean> can locate it, then the main body The content will not work attributes and usage id = "beanStanceName" to confirm the bean variable in the range you define, you can use this variable name in the later program to distinguish this variable name to case sensitive It is necessary to meet the rules of the scripting language you are using, in Java Programming Language, this rule has been written in the Java Language specification. If this bean is already created in other <JSP: UseBean>, the value of this ID must be consistent with the original ID value. Scope = "Page / Request / Session / Application" bean exists and ID variable name is valid range. The default is Page, the following is a detailed description: Page - You can use Bean in the JSP file containing <JSP: UseBean> element and all static include files in this file until the page performs a response to the client or Go to another file. Request - You use bean in any JSP file that performs the same request until the page is executed to respond to another file or go to another file. You can use the Request object to access bean, such as Request.getaTRibute (BeanInstanceName) Session starting from creating a bean, you can use Bean in any JSP file using the same session. This bean exists within the entire Session survival period, any in sharing This session's JSP file can use the same bean. Note that you must specify the session = true application in the <% @ page%> instruction in the JSP file you created, you can start from creating a bean, you can use the same Application's JSP Use Bean in the file. This bean exists within the entire Application Licheng period, any JSP file in sharing this Application can use the same bean. Class = "package.class" uses the new keyword and the Class constructor from a Class This class cannot be abstract, there must be a public, no parameter constructor. This package name is different. TYPE = "package.class" If this bean already exists in the specified range, write this bean a new database type.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-72651.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="72651" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.046</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'NkfZdwHKZldjd7lmkyr0SNDWkQmeeIAmfoYHQPfD1TWv6d6ybtw9MJ0wIOlryitEjM_2BQuoI33TiaAbxb7u_2FpCw_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>