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).
Need a template engine? You will need it at some point. So what is the fastest way to get a template engine work. I will suggest Hogan.js works with nodejs.
Lets have a quick tour about Hogan.js.
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 .
In many applications especially HTML form, users need to add items dynamically. For example, user want to submit URLs and their description to share it. User may have variable number of links to submit, the fixed number of input fields will be inconvenient.
This post shows how to implement add and remove input fields dynamically with jQuery. Our example also support multiple items that need to be added dynamically by provide customized field type.This post shows how to implement add and remove input fields dynamically with jQuery. Our example also .