This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = document.createElement('input'); | |
input.type; // -> "text" | |
input.type = 'button'; // OK | |
document.body.appendChild(input); | |
input.type = 'text'; // Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ebi.createElement('#target') | |
.clear() | |
.style('border', 'solid 1px black') | |
.append('text1') | |
.start('span') | |
.append('red') | |
.style({ | |
color: 'red', | |
fontWeight: 'bold' | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new XMLHttpRequest(); | |
request.onreadystatechange = function() { | |
if (request.readyState == 4) { | |
if (request.status == 200) { | |
console.log(request.responseText); | |
} else { | |
console.log('error!! status code:' + request.status); | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpPost post = new HttpPost("https://www.googleapis.com/urlshortener/v1/url?key={your API Key}"); | |
post.setHeader("Content-Type", "application/json"); | |
post.setEntity(new StringEntity("{'longUrl': 'http://www.google.com/'}", "UTF-8")); | |
HttpResponse response = new DefaultHttpClient().execute(post); | |
String responseText = EntityUtils.toString(response.getEntity()); | |
System.out.print(responseText); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set api key | |
// https://developers.google.com/url-shortener/v1/getting_started#auth | |
var api = 'https://www.googleapis.com/urlshortener/v1/url?key={your API Key}'; | |
var paramater = JSON.stringify({'longUrl': _link}); | |
var request = new Packages.org.apache.http.client.methods.HttpPost(api); | |
request.setHeader('Content-Type', 'application/json'); | |
request.setEntity( | |
new Packages.org.apache.http.entity.StringEntity(paramater, 'UTF-8')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function show(target) { | |
var div = document.createElement('div'); | |
div.appendChild(document.createTextNode('xxxx')); | |
div.style.border = 'solid 1px black'; | |
div.style.zindex = 100; | |
// 対象と同じ親に追加 | |
target.parentElement.appendChild(div); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DeliciousParser.parse = function(xml) { | |
var posts = xml.getElementsByTagName('post'); | |
var list = []; | |
for (var i = 0, len = posts.length; i < len; i++) { | |
var bookmark = {}; | |
var post = posts[i]; | |
bookmark.id = i; | |
bookmark.url = post.getAttribute('href'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mainKeyset = aWindow.document.getElementById("mainKeyset"); | |
var keyElement = aWindow.document.createElement("key"); | |
keyElement.setAttribute("id", SHORTCUT_KEY_ELEMENT_ID); | |
keyElement.setAttribute("key", key); | |
keyElement.setAttribute("modifiers", modifiers); | |
keyElement.setAttribute("oncommand", "void(0);"); | |
keyElement.addEventListener("command", function() { | |
openIncSearch(aWindow); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keyElement = aWindow.document.createElement("key"); | |
keyElement.setAttribute("key", key); | |
keyElement.setAttribute("modifiers", modifiers); | |
keyElement.setAttribute("oncommand", "void(0);"); | |
keyElement.addEventListener("command", function() { | |
alert('do command'); | |
}, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keyElement = aWindow.document.createElement("key"); | |
keyElement.setAttribute("key", key); | |
keyElement.setAttribute("modifiers", modifiers); | |
keyElement.setAttribute("oncommand", "void(0);"); | |
keyElement.addEventListener("command", function() { | |
alert('do command'); | |
}, false); |
OlderNewer