Javascript jsp page Dynamic Display System Time Test available Multi-browser pass test (2), javascriptjsp

Source: Internet
Author: User

Javascript jsp page Dynamic Display System Time Test available Multi-browser pass test (2), javascriptjsp

<% @ Page language = "java" import = "java. util. * "pageEncoding =" UTF-8 "%> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %> <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN"> 


JSP page dynamic display time

The getTime () function defined in script code is not called. Of course it will not be displayed.

If you want to keep Dynamic Display during page loading, you can add
Window. onload = function () {// window is a browser window object and does not need to be created using new
// Onload is an event automatically executed during page loading.
// Here an anonymous function is called without a function name.
Window. setInterval ("getTime ()", 1000); // execute your getTime () function every MS
// SetInterval is a common method of window, indicating the interval at which a function is executed
}

JSP is different from javascript in different browsers. How can we test it?

There is no accuracy. Nowadays, browsers of various vendors are quite different. When writing code, we should always consider these things. Some things are different, and no company can unify the world, therefore, it is hard for our developers. If users require different browsers, our test cases will grow exponentially.
First, I determined the browser I needed, and found their differences around these browsers (this is from the experience accumulated by my predecessors, Google), and gradually summed up my experience, there is no way to handle different statement blocks separately.
If you really want to block this difference, well, use the framework, the latest version of the framework, such as jquery, extjs, dwr, and learn to use these frameworks, you should be able to meet your requirements.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.