foo | bar | baz |
---|---|---|
aaaa | bbbb | cccc |
aaaa | bbbb | cccc |
aaaa | bbbb | cccc |
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
echo hoge |
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
kintone.events.on('app.record.edit.show', function(evt) { | |
var elem = $('#record-gaia').find('.target-element'); | |
elem.focus(); | |
}); |
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 escapeHtml(str) { | |
str = str.replace(/&/g, '&'); | |
str = str.replace(/</g, '<'); | |
str = str.replace(/>/g, '>'); | |
str = str.replace(/"/g, '"'); | |
str = str.replace(/'/g, '''); | |
return str; | |
} |
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
// 悪い例 | |
element.innerHTML = '<span class="foo">' + value + '</span>'; | |
// 良い例 | |
element.innerHTML = '<span class="foo">' + escapeHtml(value) + '</span>'; |
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
// 悪い例 | |
location.href = '/k/1234/show?param=' + param; | |
// 良い例 | |
location.href = '/k/1234/show?param=' + encodeURIComponent(param); |
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
// 要素の生成 | |
document.write("...") | |
element.innerHTML = "..." | |
// 属性の設定 | |
element.setAttribute(name, value) | |
element.someAttribute = "..." // someAttributeはhref,onclick,style,srcなど | |
// URL操作 | |
location.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
// 悪い例 | |
$(el).html($('<span class="foo">' + value + '</span>'); | |
// 良い例 | |
$(el).html($('<span class="foo">').text(value)); |
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
// Gruntfile.jsの一部 | |
karma: { | |
options: { | |
files: [ | |
grunt.option('specfile') || '<%= path.js %>/**/*_spec.js' | |
] | |
} | |
} |
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
kintone.events.on('app.record.index.show', function() { | |
kintone.app.getHeaderMenuSpaceElement().innerHTML = | |
'<input type="text" id="keyword" placeholder="キーワード" > <button id="search">検索</button>' | |
document.getElementById('search').onclick = function() { | |
var keyword = document.getElementById('keyword').value; | |
var url = location.href; | |
url += '?query=' + '文字列__1行_ like "' + keyword + '"'; | |
location.href = url; | |
} | |
}); |
OlderNewer