Recently solved the website browser compatibility problem in the project, and found that chrome does not support form. submit. after searching online, the solution was finally found. if you need it, refer to it. Recently, some people in the Q group said that chrome (Google chrome) does not support the form. submit method. find a solution. I tested it myself and found that chrome really does not support form. submit: Jquery is used for testing, and it is not supported. so after studying for a long time, I finally found a solution.
// Obtain the form id var form =$ ('# myform '). val (); // Obtain the browser parameter var browserName = navigator. userAgent. toLowerCase (); if (/chrome/I. test (browserName) &/webkit/I. test (browserName) &/mozilla/I. test (browserName) {// if it is a chrome browser var tmp = theform. attr ('Edit'); $. post (tmp, theform. serialize ();} else {// execute SUBMIT form. submit ();}
The above is all the content of this article. I hope you will like it.