Self-developed javascript library JY, birthday gift

Source: Internet
Author: User

Today, the company sent a birthday cake. Although I was not born more than 20 years ago, I am also a little happy. After all, I have had only a few birthdays over the past 20 years, one affected time was ten years old. At that time, the family was quite good, and there were many parents and friends. After three or four days, even the money was lost. The other time was the day when I went to high school, A bowl of noodles under the mother; it is much more common than that.

On this day, let's talk about the latest achievements. In my spare time, I developed a javascript library named JY and the name of my son, it also refers to "simple JS", or "Ji You", which can be used in all kinds of statements, or soy sauce. It is called this one anyway! It is a coincidence that there are similarities.

Many people may say that if there are so many mature JS libraries on the market, can you write anything better than them?

Because there is no such product, you can only compare it. As a front-end, writing your own database is already a benchmark for measuring the front-end technical capabilities. You can see that the recruitment network has given priority to writing JS databases, to meet the needs of the masses, JY has also emerged. If someone asks you to encapsulate the JS library, you can say that JY is encapsulated by you. At the same time, I hope that you can make a contribution to improve this library. Anyone with such good deeds will add your name to the author bar of JY.
JY uses the Sizzle engine, so there is no need to worry about DOM query speed. This is the fastest engine currently, and jquery and dojo also use it. JY focuses on User Programming habits. At the same time, only common methods are retained to reduce the size of JY, which is used as follows:

<Script src = "https://raw.github.com/tianxiangbing/JY/master/JY.js" type = "text/javascript"> </script>

<Script>
JY. ready (function (){
// Alert ("welcome to the JY world! ");
});
</Script>
You should be familiar with this method, and then find the DOM as follows:

JY. query ("ul"). find ("li"). filter (": not (. li)"). hide ()
Ajax is written as follows:

JY. ajax ({url: "ajax. asp ",
Data: {a: 11, B: 22 },
Type: "POST ",
Async: false,
DataType: "json ",
Success: function (r ){
Console.info (r );
}
});
The simplest method is:

JY. post ("ajax. asp", {"a": 2}, function (r ){

Console. log (r)
}, "Json ");
JY. get ("ajax. asp? ", {" Id ": 2}, function (r ){
Console. log (r)
}, "Html ");
More use method please pay attention to the future of the official website: http://www.lovewebgames.com, in the future will be a series of demo, including some small plug-ins.

Now, let's get here today. Happy birthday to me! If you are interested, you can join the QQ Group 5678537 or 70210212.

This has no relationship with jquery, so don't join us !!!
 

Related Article

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.