Table of Contents
1. Form implements Ajax submission form
2. Refresh the form and dynamically load css styles
3. js obtains the parameters submitted by get in the url
Home Web Front-end HTML Tutorial Some usage tips about html and js

Some usage tips about html and js

Apr 12, 2018 pm 03:32 PM
html javascript

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);
}
Copy after login

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 = '<li id="'+gaozhong[i].id+'" class="myli">'+gaozhong[i].title+'</li>';
                $("#high").append(v);
    }    
    //在使用'ul'标签时才使用,作用:刷新列表,重新加载所在标签的样式
    $("ul").listview("refresh");  
    $("ul").trigger("create");
Copy after login

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

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

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 of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

Nested Table in HTML

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Table Border in HTML

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

HTML margin-left

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

HTML Table Layout

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Moving Text in HTML

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

HTML Ordered List

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

How do you parse and process HTML/XML in PHP?

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

HTML onclick Button

See all articles