FrontPage Programing

ʤΥڡϡ2008ǯ˽񤤤ơȤɤƤޤ

4603616502_b30c4ea9d2_z.jpg

Photo by Gayatri Krishnamoorthy via Flickr

Bookmarklet(֥åޡå)ϡWeb֥饦ɲäǤ뾮ʥץǤ

֥åޡ()֤ȤơƤӽФʥץʤΤǡ̾ˤʤäƤޤ

ȤСWikipedia¼Ĵ٤ꡢƤWebڡäȲùꡢʤƤȤǤޤ

Web֥饦ȤäƤȡʬѤǤäȤʵǽߤʤ뤳Ȥޤ͡

褹ˡϿ뤱ɡȤꤢBookmarklet(֥åޡå)ñʤ󤸤ʤ

ȤȤǡĴ٤Ƥߤޤ


ʤߤˡɥå򤷤ʸ򸡺Τϡ֥åޡåȤȤʤƤ⡢åOK


>>Javscript



Bookmarkletˤ

ǤϡñʡHello Worldפơ򤷤ƥȤYahoo!ǸȤäϥġޤǺƤޤ

ޤ֥Ѥhtmlɤ륵ץ륳ɤѰդƤޤ

ʬѤFirefox3ǻȤۤäƤ뤿ᡢIEOperaǤư뤫Ǥ

BookmarkletˤϡФHTMLJavascriptμɬפˤʤޤ

ǶWebӥǤϡӥˤBookmarkletۤƤ뤳Ȥ⤢ޤ

Bookmarklet(֥åޡå)ǸȡĤޤ

֥åޡġСɽ

֥åޡåȤȤˤϡˡ֥åޡġСɽƤޤ礦

ˤϡ٤ι⤤֥åޡϿǤޤɽ-֥ġС-֥֥åޡġСפɽޤ

֥åޡġСˤϡɥåɥåפǥ󥯤ɲäǤΤǡ˻ȤBookmarkletܥȤϿƤǤ

֥åޡåȤȤʤƤǤ뤳ȡ

Web֥饦ɸǡGoogleǸ׵ǽäƤޤ

  1. ƥȤɥå
  2. å->GoogleǸ

ˡʵǽ⤢ޤ

  • Сθ󥸥ڤؤȡYahoo!Ǹפڤؤä
  • WikipediaǸ⤢ä
  • ƥ󥷥ˤϡgoo񸡺פä

ǤޤʬǺȤϽס

FirefoxȡJavascriptȤäơäȤĥǽ롣ɡʤꤽ񤷤ΤǡʤȤ顣

BookmarkletƤߤ褦

ơºݤBookmarkletȤäƤߤޤ礦Bookmarkletϡ֥åޡѤǽʤΤǡ󥯤λȤߤѤޤ

ޤΡBookmarklet Testץ󥯤򥯥åƤߤƤYahoo JapanذưޤˤϡYahooؤΥ󥯤ŽäƤޤ

FirefoxǡΥ󥯤֥åޡСޤǥɥåȡˡBookmarklet TestפȤ󥯥ܥ󤬤ǤޤΥܥ򥯥åСɤWebڡɽƤƤ⡢Yahoo!˰ưǤޤ

󥯥ܥBookmarkletˤˤ

ǤϡΡBookmarklet TestפΥ󥯥ܥľơBookmarkletäƤߤޤ礦

BookmarkletǤϡΥ󥯥ܥΥ(URL)ˡJavascriptˤץꤷޤBookmarkletϡ1Ԥǽ񤫤줿JavascriptΥץǤ󥯥ܥΥȤơΤ褦˽񤯤ȡåȤˤΥץब¹ԤǤޤ

javascript:(ºݤν);

󥯥ܥBookmarkletϿˤϡå-֥ץѥƥפ򤷤ơURLϤޤ

BookmarkletۥȤʤɤǤϡBookmarkletѤߤΥ󥯤ɽƤΤǡľܥ֥åޡġС˥ɥåɥåפƤפǤǤϡŪͳǤ줬ǤޤǤ(PukiwikiľBookmarkletۤˡ뤫ʡ򤤤ʤȥᤫ)

Hello Worldɽ

Hello Worldܥåɽޤ嵭μǡ֥åޡġСΡBookmarklet TestפURL˼Υץ򥳥ԥڤƤ

javascript:alert("hello%20world");

ʤߤˡ%20פϥڡɽƤޤ

ܸɽǤޤ

javascript:alert("γ󡢥˥");

Hello World̥ɥɽ

javascript:var%20d=window.open().document;
d.writeln('<textarea%20rows=1%20cols=40>'+'γ󡢥˥'+'</textarea>');

ԤƤ饳ԥڤƤ

äȤ䤳ΤǡʣԤŸƤߤޤ(%20ϥڡִ)

javascript:
   var d=window.open().document;
   d.writeln('<textarea rows=1 cols=40>'+'γ󡢥˥'+'</textarea>');

򤷤ƥȤɽ

ɽ

javascript:var%20d=document;
var%20tx=d.selection?d.selection.createRange().text:d.getSelection();
alert(tx);

?׵ϡʸ1Ԥǽ񤯡Ȥƥ˥åǤޤϰϤΥƥȤˤϡgetselectionȤäƤޤ

̥ɥɽ

javascript:var%20d=document;
var%20tx=d.selection?d.selection.createRange().text:d.getSelection();
var%20subw=window.open().document;
subw.writeln('<textarea%20rows=1%20cols=40>'+tx+'</textarea>');

ԤƤ饳ԥڤƤ

򤷤ƥȤYahoo!Ǹ

̤̥ɥɽޤ

javascript:var%20d=document;
var%20tx=d.selection?d.selection.createRange().text:d.getSelection();
var%20subw=window.open('http://search.yahoo.co.jp/search?p='+tx).document;

ԤƤ饳ԥڤƤ

ϥġ

ޤǤСȤϤΥХꥨ󡣤ĤʬѤ˺äۤ򤪤Ƥޤ

WikipediaǸ

javascript:var%20d=document;
var%20tx=d.selection?d.selection.createRange().text:d.getSelection();
var%20subw=window.open('http://ja.wikipedia.org/wiki/'+tx).document;

ѼϺǸ

javascript:var%20d=document;
var%20tx=d.selection?d.selection.createRange().text:d.getSelection();
var%20subw=window.open('http://eow.alc.co.jp/'+tx+'/UTF-8/?ref=sa').document;

­¤ϸϵǽFirefoxǤɸǡǤΤǤ

θ塢ȤäƤWeb֥饦(Firefox)Ǥϡɸൡǽǡ򤷤򸡺뤳ȤǤ뤳ȤȽƤޤϡʲΤȤꡣ

  1. θǸ
  2. Ĵ٤ɥå
  3. å->֡Ǹ "()"

ϡFirefoxǸǤ褦ϿƤʤ顢ɤǤѤǤޤȤ鸡ǽɲä륢ɥвäƤΤǡȤǤ͡

Υƥå

ϡWebٱ礹bookmarkletˤĤĴ٤ƤߤޤǡJavascriptΥ㡽Ȥƥ˥åФƤޤץ륳ɤ򲡤ƤפǤ礦

  • ޤǤbookmarkletΤȤ
    • ĤĤСѤ
    • ֥ġϸƤΤǡùǤɤ
  • 񤷤Ȥ
    • ХѿˤʤäƤޤ餷ĤޤꡢƱѿȤBookmarkletʣȡưʤ롣

򤹤Ȥ餷

򸫤

bookmarkletϡƤWebڡΥȥƥȥꥢɽޤ

javascript:(function(){function%20o(s){var%20d=window.open().document;
d.writeln('<textarea%20rows=15%20cols=80>'+s+'</textarea>');
d.close()}var%20contents=document.title;o(contents);})();

1ԤʬˤΤǡʣԤŸƤߤޤ

javascript:(
	function(){
	    function o(s){
	        var d=window.open().document;
	        d.writeln('<textarea rows=15 cols=80>'+s+'</textarea>');
	        d.close()
	    }
	    var contents=document.title;
	    o(contents);
	}
)();

ؿ(function)ǡؿo(s)ƤޤǡoؿˡWebڡΥȥ(document.title)Ϥơ̥ڡ˥ƥȥꥢΰȤƽ񤭹Ǥޤ

ʤ줬ưΤܤϥ㡽ɤǤ餦ȤơȤꤢ¤ƤФ󤸤ʤʡ

ˤĤ

Web

ɽƤڡ顢֥WikiŽդ

ɽƤڡΥȥURLɽ

javascript:(function(){function%20o(s){var%20d=window.open().document;
d.writeln('<textarea%20rows=15%20cols=80>'+s+'</textarea>');
d.close()}
o(document.title+"\n"+location.href);})();

ɽƤڡؤΥhtml

javascript:(function(){function%20o(s){var%20d=window.open().document;
d.writeln('<textarea%20rows=15%20cols=80>'+s+'</textarea>');d.close()}var%20prefix='';
var%20suffix='';var%20contents=document.title;var%20target='_blank';
o(prefix+'<a%20href=\''+location.href+'\'%20target=\''+target+' \'>'+contents+'</a>'+suffix);})();

ɽƤڡؤMarkdown󥯤

javascript:(function(){function%20o(s){var%20d=window.open().document;
d.writeln('<textarea%20rows=15%20cols=80>'+s+'</textarea>');
d.close()};
o('-['+document.title+']('+location.href+')');})();

ɽƤFlickrڡ̿Žդhtml

javascript:(function()%20{var%20url=location.href;
%20if%20(url.match(/http:\/\/(www.)?flickr.com\//))%20{
%20window.location%20='http://seanmcg.com/flickrtools/html.php?url='+url;%20}
%20else%20{%20alert('You\'re%20not%20on%20Flickr!');%20}%20})()

ɽƤFlickrڡ̿Žդhtml

FlickrΥѤäƤơޤưޤ(2009/04)

javascript:document.body.innerHTML.match(/property=\%22dc:title\%22>(.*?)<\/h1>
[\s\S|.]*?<img%20src=\%22(.*?)\.jpg\?v[\s\S|.]*by%20<a%20href=%22\/photos\/(.*?)\/%22/);
document.body.innerHTML=%22<textarea%20cols='100'%20rows='10'>
<div%20style=\%22float:right;margin:5px%200px%2010px%2010px;border:dotted%201px%20#aaaaaa;padding:5px\%22>\n
<a%20href=\%22%22+document.URL+%22\%22%20target=\%22_blank\%22>
<img%20src=\%22%22+RegExp.$2+%22_m.jpg\%22%20style=\%22border:none\%22></a>\n
<a%20href=\%22%22+document.URL+%22\%22%20target=\%22_blank\%22>%22+RegExp.$1+%22</a>
<br%20/>\nPhoto%20by%20<a%20href=\%22http://www.flickr.com/photos/%22+RegExp.$3+%22/\%22%20target=\%22_blank\%22>%22+RegExp.$3+%22</a>\n
</div>\n\n<br%20clear=\%22all\%22/></textarea>%22

ɽƤڡؤPukiwiki

javascript:(function(){function%20o(s){var%20d=window.open().document;
d.writeln('<textarea%20rows=15%20cols=80>'+s+'</textarea>');d.close()}
var%20prefix='';var%20suffix='';var%20contents=document.title;var%20target='_blank';
o(prefix+'-[['+contents+':'+location.href+']]'+suffix);})();

ɽƤڡΥ᡼

href="javascript:location.href='mailto:?SUBJECT='+encodeURIComponent(document.title)+'&BODY='+escape(location.href)

Gmail

߸ƤڡGmail

javascript:(function(){x=document;y=window;if(x.selection)%20{Q=x.selection.createRange().text;}%20else%20if%20(y.getSelection)%20{Q=y.getSelection();}%20else%20if%20(x.getSelection)%20{Q=x.getSelection();};m='https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=&su=[FYI]%20'+encodeURIComponent(x.title)+'&body='+encodeURIComponent(x.title)+encodeURIComponent(Q)+encodeURIComponent('\n\n'+x.location);y.open(m,'addwindow','status=no,toolbar=no,width=575,height=510,resizable=yes');})();

Twitter

javascript:window.open("https://twitter.com/intent/tweet?
status="+encodeURIComponent(document.title)+" "+encodeURIComponent(location.href))

ޡȥեǥ֥åޡå

ޥۤȤȤäѤ֥åޡåȤߤȤ櫓ǡϢ󥯡

Androidɸ֥饦Ǥϡ󥯤javascriptϿǤޤ

AndroidFirefoxOpera MobileѤȤǤ礦

ͻ


Ȥ櫓ǡˤۤꤿʤ顢Javascriptĩ路ʤȥ͡

>>Javscript


  ȥå   ʬ Хåå   ñ측 ǽ   إ   ǽRSS
Last-modified: 2019-02-20 () 09:04:42 (96d)