1. picture file format, pros and cons, and adaptation scenarios
(1) JPEG2000 format: JPEG2000 is an upgraded version of JPEG with a compression ratio of about 30% higher than JPEG. Unlike JPEG, JPEG2000 supports both lossy and lossless compression, while JPEG only supports lossy compression. Support progressive transfer, support "area of interest" for partial priority decompression. JPEG2000 can be used in the traditional JPEG market, such as scanners, digital cameras, etc., also in the emerging areas, such as network transmission, wireless communications and so on.
(2) TIFF format: TIFF (TAG Image File format) is widely used in Mac image format, image format complex, storage information, high quality image, very conducive to the copy of the manuscript. There are two forms of compression and non-compression, wherein compression can be stored using LZW lossless compression scheme. is one of the most widely used image file formats on microcomputers.
(3) PSD format: Photoshop's dedicated format Photoshop Document (PSD). Contains a variety of layers, channels, masks and other design of the sample. In the various image formats supported by Photoshop, PSD accesses much faster than other formats and is powerful.
(4) PNG format:(Portable Network Graphics format) suitable for any type, any color depth of the picture. You can also use PNG to save a picture with a palette. Lossless compression, support transparent, display speed, not support animation application effect, file slightly larger, is the default format of fireworks software.
(5) SWF format: can use relatively small volume to express rich multimedia forms. High definition, can download side view, suitable for network transmission. Vector image magnification is not affected.
(6) SVG format: Scalable vector graphics Scalable vectors. It is an open standard vector graphics language based on XML (extensible Markup Language), high resolution, the user can directly use the code to depict the image, you can use any word processing tool to open the SVG image, by changing part of the code to make the image interactive function, and can be inserted into the HTML at any time through the browser to watch. You can enlarge the graphic display arbitrarily, but never at the expense of image quality; The word retains an editable and searchable state in the SVG image; On average, SVG files are much smaller than files in JPEG and GIF formats, so downloads are fast.
(7) BMP Format: BMP (Window standard bitmap) is the most common one of the bitmap format, the window system is the standard format, is displayed under the window bitmap in a lossless form of the file saved, the advantage is not to reduce the quality of the picture, but the file size is larger.
(8) Jpg/jpeg format: (combined graphics Expert Group picture format) best for photos and pictures that use true color or smooth transitions. The format uses lossy compression to reduce the size of the picture, so users will see that as the file decreases, the quality of the picture is reduced, and the transparent area in the picture is converted to a solid color when the picture is converted to a. jpg file. (9) PNG format: (Portable Network Graphics format) suitable for any type, any color depth of the picture. You can also use PNG to save a picture with a palette. This format uses lossless compression to reduce the size of the picture while preserving the transparent area of the image, so the file is slightly larger. Although the format applies to all pictures, some Web browsers do not support it.
(9) GIF format: GIF (Graphics Interchange Format) is best for clip art with line charts (such as Up to 256 colors) and for pictures with large chunks of solid color. The format uses lossless compression to reduce the size of the picture when the user wants to save the picture as. GIF, you can decide whether to save transparent areas or convert them to solid colors. In addition, the GIF format can be used to save animation files through the conversion of multiple images. Note, however, that GIF can only support up to 256 colors
2. Cross-domain communication
1, dynamic script tag, the returned data format must be text/javascript (not necessarily JSON, can be any data type), that is, JSONP
2, Iframe+document.domain
3, Iframe->window.name
3. The following code outputs the result
Console.log (1+ + "1" + "1"); // Console.log (1+-"1" + "1"); // Console.log (+ "1" + "1"-1); // TenConsole.log ("A"-"B" + "1"); // NaN1console.log ("A"-"B" + 1); // NaN
Web front-End Pen Questions (3)--Wolf Factory