Home  >  Article  >  Web Front-end  >  Some usage tips about html and js

Some usage tips about html and js

零到壹度
零到壹度Original
2018-04-12 15:32:101539browse

The content of this article is to share with you some usage tips about html and js. It has certain reference value. Friends in need can refer to it

1. Form implements Ajax submission form

function xxx() {
    var opts = {
        url : '/xxx.do',
        type : 'post',
        dataType : 'json',
        success : function(data) {
        }
    }
    $("#jvForm").ajaxSubmit(opts);
}

2. Refresh the form and dynamically load css styles

If you dynamically splice p in js, the style may not be loaded. Question

for (i = 0; i < gaozhong.length; i++) { 
   var v = &#39;<li id="&#39;+gaozhong[i].id+&#39;" class="myli">&#39;+gaozhong[i].title+&#39;</li>&#39;;
                $("#high").append(v);
    }    
    //在使用&#39;ul&#39;标签时才使用,作用:刷新列表,重新加载所在标签的样式
    $("ul").listview("refresh");  
    $("ul").trigger("create");

3. js obtains the parameters submitted by get in the url

function getRequest() {
    var url = location.search; // 获取url中"?"符后的字串
    return url;
}

Related recommendations:

A casual summary of the use of Html and JS in the project

Basic usage of Html-JS

The above is the detailed content of Some usage tips about html and js. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn