{"id":1580,"date":"2008-01-06T12:54:14","date_gmt":"2008-01-06T10:54:14","guid":{"rendered":"http:\/\/mummila.net\/nuudelisoppa\/?p=1580"},"modified":"2008-01-06T12:54:14","modified_gmt":"2008-01-06T10:54:14","slug":"browsing-images-back-and-forth-with-javascript-bookmarks-firefox","status":"publish","type":"post","link":"https:\/\/mummila.net\/nuudelisoppa\/2008\/01\/06\/browsing-images-back-and-forth-with-javascript-bookmarks-firefox\/","title":{"rendered":"Browsing images back and forth with JavaScript bookmarks (Firefox)"},"content":{"rendered":"<p><a href=\"http:\/\/reddit.com\/info\/64nad\/comments\/c02tq0v\">Jumping to the next picture<\/a>, when the current URL points directly to an image file ending in a digit (<a href=\"http:\/\/www.gamesarefun.com\/games\/gamecube\/batenkaitos2\/01.jpg\">an example<\/a>), can be achieved by &lt;a href=&quot;javascript:(function(){ var e,s; IB=1; function isDigit(c) { return (%220%22 &lt;= c &amp;&amp; c =0; &#8211;e) if (isDigit(L.charAt(e))) { for(s=e-1; s&gt;=0; &#8211;s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e&lt;0) return; oldNum = L.substring(s,e+1); newNum = %22%22 + (parseInt(oldNum,10) + IB); while (newNum.length bookmarking this<\/a> piece of code I picked up at reddit:<\/p>\n<blockquote><p><code>javascript:(function(){ var e,s; IB=1; function isDigit(c) { return (%220%22 &lt;= c &amp;&amp; c =0; --e) if (isDigit(L.charAt(e))) { for(s=e-1; s&gt;=0; --s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e&lt;0) return; oldNum = L.substring(s,e+1); newNum = %22%22 + (parseInt(oldNum,10) + IB); while (newNum.length &lt; oldNum.length) newNum = %220%22 + newNum; location.href = L.substring(0,s) + newNum + L.slice(e+1); })();<\/code><\/p><\/blockquote>\n<p>Another &lt;a href=&quot;javascript:(function(){ var e,s; IB=-1; function isDigit(c) { return (%220%22 &lt;= c &amp;&amp; c =0; &#8211;e) if (isDigit(L.charAt(e))) { for(s=e-1; s&gt;=0; &#8211;s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e&lt;0) return; oldNum = L.substring(s,e+1); newNum = %22%22 + (parseInt(oldNum,10) + IB); while (newNum.length bookmark<\/a> for jumping to the previous picture is a simple modification of the above with the variable <code>IB<\/code> assigned the value -1:<\/p>\n<blockquote><p><code>javascript:(function(){ var e,s; IB=-1; function isDigit(c) { return (%220%22 &lt;= c &amp;&amp; c =0; --e) if (isDigit(L.charAt(e))) { for(s=e-1; s&gt;=0; --s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e&lt;0) return; oldNum = L.substring(s,e+1); newNum = %22%22 + (parseInt(oldNum,10) + IB); while (newNum.length &lt; oldNum.length) newNum = %220%22 + newNum; location.href = L.substring(0,s) + newNum + L.slice(e+1); })();<\/code><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Jumping to the next picture, when the current URL points directly to an image file ending in a digit (an example), can be achieved by &lt;a href=&quot;javascript:(function(){ var e,s; IB=1; function isDigit(c) { return (%220%22 &lt;= c &amp;&amp; c =0; &#8211;e) if (isDigit(L.charAt(e))) { for(s=e-1; s&gt;=0; &#8211;s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e&lt;0) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[29,28],"class_list":["post-1580","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-hacks-tweaks","tag-mozilla"],"_links":{"self":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/1580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/comments?post=1580"}],"version-history":[{"count":0,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/1580\/revisions"}],"wp:attachment":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/media?parent=1580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/categories?post=1580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/tags?post=1580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}