How to create a HTML Cancel button that redirects to a URL

cancel is not a valid value for a type attribute, so the button is probably defaulting to submit and continuing to submit the form. You probably mean type=”button”. (The javascript: should be removed though, while it doesn’t do any harm, it is an entirely useless label) You don’t have any button-like functionality though, so would be better off with: … possibly with … Read more

jQuery Scroll to Div

Check this link: http://css-tricks.com/snippets/jquery/smooth-scrolling/ for a demo, I’ve used it before and it works quite nicely.

difference between iframe, embed and object elements

<iframe> The iframe element represents a nested browsing context. HTML 5 standard – “The <iframe> element” Primarily used to include resources from other domains or subdomains but can be used to include content from the same domain as well. The <iframe>‘s strength is that the embedded code is ‘live’ and can communicate with the parent document. <embed> Standardised in … Read more

How to pass parameters using ui-sref in ui-router to controller

I’ve created an example to show how to. Updated state definition would be: And this would be the controller: What we can see is that the state home now has url defined as: which means, that the params in url are expected as These two links will correctly pass arguments into the controller: Also, the controller does consume $stateParams instead of $stateParam. … Read more

Is there a command for formatting HTML in the Atom editor?

Atom does not have a built-in command for formatting html. However, you can install the atom-beautify package to get this behavior. Press CTRL + SHFT + P to bring up the command palette (CMD + SHFT + P on a Mac). Type Install Packages to bring up the package manager. Type beautify into the search box. Choose atom-beautify or one of the other packages and click Install. Now you can use the default keybinding for … Read more