【发布时间】:2011-12-30 16:28:29
【问题描述】:
我刚刚遇到this sample code,它有一个脚本标签,其中包含外部源和正文。我认为这是将一些信息传递给包含的脚本的一种聪明方法。 它是如何工作的?
<html>
<head>
<script src="http://unhosted.org/remoteStorage.js">{
onChange: function(key, oldValue, newValue) {
if(key=='text') {
document.getElementById('textfield').value= newValue;
}
},
category: 'documents'
}</script>
</head>
【问题讨论】:
-
我不认为它是如何工作的问题,而不是它是否会对代码的执行产生影响。
标签: javascript html