我有這個問題。我有兩個文件一個(soap.html
)和其他的(soap.js
)我想我的html文件沒有看到另一個腳本文件
在HTML文件中,我使用的一個功能,是edarah_Authenticate
,而這個功能是在soap.js
存在,但這是錯誤:
"Uncaught ReferenceError: edarah_Authenticate is not defined "
我怎樣才能使HTML文件看到soap.js
文件
這裏的功能是HTML:
<script type="text/javascript" src="soap.js"> </script>
<input type="text" name="username"
id="username" value="username" click="this.value=''" class="user-name">
<input type="password" id="password"
name="password" value="password" onclick="this.value=''" class="user-name">
<div class="login">
<input type="button" id="signin" class="sign-button" onclick="
var username=document.getElementById('username').value;
var password= document.getElementById('password').value;
edarah_Authenticate (username,password, function(jsonResponse) {
var auth = JSON.parse(jsonResponse);
for (i=0;i<auth.length;i++){
if ((msg[i]['id'])!==null)
{
Redirect();
}
else { alert('Username or Password is incorrect');}
} });">
</div>
這裏是soap.js
文件:
function edarah_Authenticate(username, password, theCallBack)
{
method = "Authenticate";
parameters = "<username xsi:type='xsd:string'>" + username + "</username>
<password xsi:type='xsd:string'>" + password + "</password>";
edarah_getDataFromWebService(method, parameters, theCallBack);
}
並沒有持續下去,但我認爲這是不夠的。
您可以通過使用調試工具(如Firebug)來確保正在加載JS文件。 – melancia
問題是我有另一個名爲ser.html的文件,並且有許多來自soap.js的功能並且運行良好。我donno –
你有任何鏈接到我們可以檢查您的網站? – melancia