我試圖讓一個腳本在遊戲我玩Evony的叫使帳戶時使用。無法獲取JS腳本重定向到不同的頁面
在頁面做一個帳戶,我發現的電子郵件地址和密碼文本框的元素ID,並試圖輸入文本放進去,但我的代碼是不能工作的某些原因。
到創建賬戶頁面的鏈接位於:http://user.evony.com/index.do?PageModule=ForgetPassword
這是我已經試過:
<?php
?>
<html>
<meta http-equiv="refresh" content="0; URL=http://user.evony.com/index.do?PageModule=ForgetPassword">//loads webpage
<script>
var email = email;
var password = password;
var accnumber = 0;
function createaccount(){
// Click the button to bring up create acc tab
document.getElementById("tab2").click()
// If the clicking above doesn't work,
// this should manually bring up the tab
// to create the acc
document.getElementById('tab_login_c').style.display='none';
// Part of above
document.getElementById('tab_reg_c').style.display='';
this.className='on'" class="on">
// This is to input the email into the email box
document.getElementById('username').value = email + accnumber + "@yahoo.com";
}
// Execute the code
window.onload = function() { createaccount() }
</script>
</html>
我的代碼沒有完全修好了,只要輸入密碼,我沒有一個循環來增加x
- 我試圖讓這部分首先工作。
要運行這個,我使用的XAMPP並進入Chrome和127.0.0.1:5555
。
它加載網頁,但不運行任何JavaScript代碼。任何幫助將是偉大的!
PSS:從頁面元素: 按鈕切換至寄存器ACC標籤: 要素電子郵件: – mrbad315
爲什麼在Javascript運行之前重定向用戶?如果你認爲它*加載頁面*,那麼你錯了。另外,你從哪裏得到變量'email'和'password'? –
在js可以運行之前,用戶是否必須在網站上?否則,js如何將電子郵件和密碼放在框中?你是什麼意思,它不加載頁面?我可以看到該頁面並與其交互並手動進行accs?還試圖註釋掉這條線,它仍然無法正常工作 - 謝謝你的建議。 – mrbad315