This article mainly introduces how to obtain url parameters through js analysis url? In the previous section, # And later sections, you can check the code. The main idea is to parse url parameters into js objects, it is convenient to add, delete,
This two days to encounter the operation of the URL js, online Search A lot of methods, are direct operation, use is very inconvenient, there are many duplicate code.
So set hundred home strict, summed up the various methods, it compressed into a
As a front-end, daily dealing with URLs is essential. But maybe every day is just a simple use, it is just smattering, with the work, I found in the daily grab package debugging, interface calls, browser compatibility and many other aspects, do not
As a front-end, daily dealing with URLs is essential. But maybe every day is just a simple use, it is just smattering, with the work, I found in the daily grab package debugging, interface calls, browser compatibility and many other aspects, do not
1: use object-oriented Javascript
Believe it or not, you can use the object-oriented method to write JavaScript. In this way, you can get better reusable code, organize objects, and dynamically load objects. The following is the shopping cart of the
Summed up a number of methods to compress it into a function object, only dozens of lines of code, the use of the method is simple and straightforward
Save As Ojburl.js
Copy Code code as follows:
/*
Description: This code can be freely
To send a message to an enterprise number member, you must post the JSON data to the specified URL that contains access_token according to the message interface message data format of the Enterprise Developer documentation.
What I want to achieve is
According to the message data format of the sending message interface in the enterprise number developer documentation, to send messages to enterprise number members, JSON data must be sent to the specified URL containing ACCESS_TOKEN in POST mode.
Chinaz uses ajax to read comments. The following is a reference to the chinaz code. The characters obtained by ajax are similar to the following content:
The Code is as follows:
{:"
Supported: [0] Objection: [0] Chinese webmaster site netizen:
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.