How do I ensure saved click coordinates can be reload to the same place, even if the page layout changed?

Yeah, there are many, many ways a page’s layout can alter between loads. Different window sizes, different font sizes, different font availability, different browser/settings (even a small change in layout or font preference can throw out the wrapping). Storing page-relative co-ordinates is unlikely to be that useful unless your page is almost entirely fixed-size images. … Read more

Angular JS does not allow preventDefault or return false to work on form submission

I know I am pretty late to the party, but in case you did not figure it out yet, you can keep the action and make sure the form is not actually submitted by passing $event to the ng-submit function. Then you can use event.preventDefault(); in your controller after you do all your processing. So … Read more

How to remove the white space at the start of the string

This is what you want: function ltrim(str) { if(!str) return str; return str.replace(/^\s+/g, ”); } Also for ordinary trim in IE8+: function trimStr(str) { if(!str) return str; return str.replace(/^\s+|\s+$/g, ”); } And for trimming the right side: function rtrim(str) { if(!str) return str; return str.replace(/\s+$/g, ”); } Or as polyfill: // for IE8 if (!String.prototype.trim) … Read more

error code: 521