Browse Subversion Repository
Diff of /js/common.js
Parent Directory
| Revision Log
| Patch
| 636 |
String.prototype.htmlspecialchars = function() { |
String.prototype.htmlspecialchars = function() { |
| 637 |
ch = this + ""; |
ch = this + ""; |
| 638 |
ch = ch.replace(/&/g,"&") ; |
ch = ch.replace(/&/g,"&") ; |
| 639 |
ch = ch.replace(/"/g,""") ; |
ch = ch.replace(/"/g,""") ; // " |
| 640 |
ch = ch.replace(/'/g,"'") ; |
ch = ch.replace(/'/g,"'") ; // ' |
| 641 |
ch = ch.replace(/</g,"<") ; |
ch = ch.replace(/</g,"<") ; |
| 642 |
ch = ch.replace(/>/g,">") ; |
ch = ch.replace(/>/g,">") ; |
| 643 |
return ch ; |
return ch ; |
| 658 |
return ""; |
return ""; |
| 659 |
} |
} |
| 660 |
} |
} |
| 661 |
|
|
| 662 |
|
// innerHTMLで設定したスクリプトの内容がFirefox以外のブラウザでも実行されるようにする為に。 |
| 663 |
|
// 要:戻り値のNodeを他のNodeに追加 |
| 664 |
|
function createNodeWithScript(html) { |
| 665 |
|
var div = document.createElement("div"); |
| 666 |
|
div.innerHTML = html; |
| 667 |
|
if (Prototype.Browser.IE || Prototype.Browser.WebKit || Prototype.Browser.Opera) { |
| 668 |
|
var texts = new Array(); |
| 669 |
|
var scripts = div.getElementsByTagName("script"); |
| 670 |
|
for (var i=0; i<scripts.length; ++i) { |
| 671 |
|
var script = scripts[i]; |
| 672 |
|
texts.push(script.text); |
| 673 |
|
} |
| 674 |
|
var script = document.createElement("script"); |
| 675 |
|
script.text = texts.join("\r"); |
| 676 |
|
div.appendChild(script); |
| 677 |
|
} |
| 678 |
|
return div; |
| 679 |
|
} |
| 680 |
|
|
|
|
Legend:
| Removed from v.29 |
|
| changed lines |
| |
Added in v.31 |
|
|
| |