<p>In Google Reader, you can use a bookmarklet to "note" a page you're visiting. When you press the bookmarklet, a little Google form is displayed on top of the current page. In the form you can enter a description, etc. When you press Submit, the form submits itself without leaving the page, and then the form disappears. All in all, a very smooth experience.</p>

<p>I obviously tried to take a look at how it's done, but the most interesting parts are minified and unreadable. So...</p>

<p>Any ideas on how to implement something like this (on the browser side)? What issues are there? Existing blog posts describing this?</p>

[{'answer_id': 67897, 'author': 'Sam Hasler', 'author_id': 2541, 'author_profile': 'https://Stackoverflow.com/users/2541', 'pm_score': 0, 'selected': False, 'text': "<p>At it's very basic level it will be using <code>createElement</code> to create the elements to insert into the page and <code>appendChild</code> or <code>insertBefore</code> to insert them into the page.</p>\n"}, {'answer_id': 67925, 'author': 'Aupajo', 'author_id': 10407, 'author_profile': 'https://Stackoverflow.com/users/10407', 'pm_score': 0, 'selected': False, 'text': "<p>You can use a simple bookmarklet to add a &lt;script&gt; tag which loads an external JavaScript file that can push the necessary elements to the DOM and present a modal window to the user. The form is submitted via an AJAX request, it's processed server-side, and returns with success or a list of errors the user needs to correct.</p>\n\n<p>So the bookmarklet would look like:</p>\n\n<p><em>javascript:code-to-add-script-tag-and-init-the-script;</em></p>\n\n<p>The external script would include:</p>\n\n<ul>\n<li>The ability to add an element to the DOM</li>\n<li>The ability to update innerHTML of that element to be the markup you want to display for the user</li>\n<li>Handling for the AJAX form processing</li>\n</ul>\n\n<p>The window effect can be achieved with CSS positioning.</p>\n\n<p>As for one complete resource for this specific task, you'd be pretty lucky to find anything. But have a look at the smaller, individual parts and you'll find plenty of resources. Have a look around for information on modal windows, adding elements to the DOM, and AJAX processing.</p>\n"}, {'answer_id': 68110, 'author': 'Anutron', 'author_id': 10071, 'author_profile': 'https://Stackoverflow.com/users/10071', 'pm_score': 3, 'selected': True, 'text': '<p>Aupajo has it right. I will, however, point you towards a bookmarklet framework I worked up for our site (<a href="http://www.iminta.com" rel="nofollow noreferrer">www.iminta.com</a>).</p>\n<p>The bookmarklet itself reads as follows:</p>\n<pre><code>javascript:void((function(){\n    var e=document.createElement(\'script\');\n    e.setAttribute(\'type\',\'text/javascript\');\n    e.setAttribute(\'src\',\'http://www.iminta.com/javascripts/new_bookmarklet.js?noCache=\'+new%20Date().getTime());\n    document.body.appendChild(e)\n})())\n</code></pre>\n<p>This just injects a new script into the document that includes this file:</p>\n<p><a href="http://www.iminta.com/javascripts/new_bookmarklet.js" rel="nofollow noreferrer">http://www.iminta.com/javascripts/new_bookmarklet.js</a></p>\n<p>It\'s important to note that the bookmarklet creates an iframe, positions it, and adds events to the document to allow the user to do things like hit escape (to close the window) or to scroll (so it stays visible). It also hides elements that don\'t play well with z-positioning (flash, for example). Finally, it facilitates communicating across to the javascript that is running within the iframe. In this way, you can have a close button in the iframe that tells the parent document to remove the iframe. This kind of cross-domain stuff is a bit hacky, but it\'s the only way (I\'ve seen) to do it.</p>\n<p>Not for the feint of heart; if you\'re not good at JavaScript, prepare to struggle.</p>\n'}]
['https://Stackoverflow.com/questions/67713', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10155/']