Hi,
Now I'll give up trying myself and I'm gonna ask your help :)
So I have web browser in my project and I'm trying to run javascript from the wep page. The script it below:
This script can be run also by clicking image in the Html tablet in the same page:
There nothing has id so that causes problems for me...
I can get those objects (2,45151,5,fi) easily - thats not a problem. I have tried to do this way:
Do you have any idea what is wrong with that "invokeScript"? Or do you know how I could click html item in tha table that has no id?
Now I'll give up trying myself and I'm gonna ask your help :)
So I have web browser in my project and I'm trying to run javascript from the wep page. The script it below:
Code:
function startProvinciarumFight(aType, userId, serverId,country)
{
arenaType = aType;
provinciarumDefenderId = userId;
provinciarumServer = serverId;
provinciarumCountry = country;
sendRequest('get', 'ajax.php', 'mod=arena&submod=doCombat&aType='+arenaType+'&opponentId='+userId+'&serverId='+serverId+'&country='+country, 'attack_player_'+serverId + userId, 'arena_spinner', 'arena_spinner-img', 'arena_spinner-content');
}
Code:
<tr>
<td>
<a target="_blank" href="Link">
[string] </a>
</td>
<td>[integer]</td>
<td>
[integer] </td>
<td>
<span onclick="startProvinciarumFight(2, 45151, 5, 'fi');">
<img style="cursor:pointer" src="7726/img/fordern.gif">
</span>
<span id="attack_player_545151" style="height: 20px; width: 20px;"></span>
</td>
</tr>
I can get those objects (2,45151,5,fi) easily - thats not a problem. I have tried to do this way:
Code:
'teksti() is the correct object (2, 15151, 5, 'fi')'
Dim ObjArr(3) As Object
ObjArr(0) = CObj(New String(teksti(0)))
ObjArr(1) = CObj(New String(teksti(1)))
ObjArr(2) = CObj(New String(teksti(2)))
ObjArr(3) = CObj(New String(teksti(3)))
WaitForPageLoad()
Webbrowser.Document.InvokeScript("startProvinciarumFight", ObjArr)
'or simple this way:'
Webbrowser.Document.InvokeScript("startProvinciarumFight", _
New Object() {teksti(0), teksti(1), teksti(2), teksti(3)})