Time-Saving JavaScript Browser Bookmarks

Today I was sent the following JavaScript javascript:(function(){$(‘#UserName’).val(‘a_user’);$(‘#Password’).val(‘their_password’);$(‘form’).submit();})(); As it turns out, the JavaScript was actually intended to be a browser bookmark that, when clicked, auto-filled fields on the page and submitted it. Let’s look at it more carefully. If we assume that the page has a: Textbox with ID … Continue reading

document.getElementById() in jQuery

The enduring popularity of this question on Stackoverflow: How to do this using jQuery – document.getElementById(“selectlist”).value took me back to the very first issue I had with jQuery. Namely: Why on earth does $(“myid”) not give me the DOM object for “myid” like document.getElementById(“myid”)? In fact it gives you a collection of … Continue reading