There is common problem when display image in web page, the width of the image size may too big to fit into the page. Suppose there are two columns float in a div, the left float will display an image, the right float will show text.
Consider this problem, you find a list of links on a web page, and you want get its URL and link address and save them to a file. If there are only several links, you can get them by right clicking the mouse on the link and copy link address or select the link text to copy the link .
I was looking at code like this
And suddenly I feel confusing about the function defined in obj var literal definition. Its accessing the obj var's properties inside the function which is also a part of the objection definition(at least it looks like so).
This is a task that looks easy at first sight, but when you start to actually do it, things becomes a little bit complex.
The naive way is a simple for in loop.
Since the ubiquitous of jQuery's usage, many of you may not know there are some built in CSS selector APIs in javascipt core.
The are querySelector and querySelectorAll. When you don't have jQuery support, you can use them .