Reputation: 89
I went through many discussions and I wasted over 1 hour trying to do something with this. But I didn't find the solution.. so.. I have this html piece of code and I need to trigger that javascript thing I've red lined.. I tried to trigger it through chrome, it went with no probs when I put it in the console and entered..
I need to know, how to trigger this in c# web browser. (I am kinda new to programming, I never studied the HTML or javascript, I just can do small things in c# - so I don't know much about those elements etc)
I need to trigger this thing - javascript:Skylab.sendTransport('normal');
Any idea how ?
Screen with the code in colors: https://i.sstatic.net/NLDjZ.png
<div id="transport_right">
<table>
<tr>
<td style="width:41px;"><img id="to_skylab" src="http://do-test.a.bpcdn.net/do_img/global/pilotSheet/skylab/to_skylab_0.png?__cv=1f08c141b032cd3f3800247fe3f58100" width="41" height="36"></td>
<td style="width:23px;"><img id="but_to_skylab" src="http://do-test.a.bpcdn.net/do_img/global/pilotSheet/skylab/but_right_0.png?__cv=ac1391c5509c09a46cc9bd5e36c51400" width="17" height="17"></td>
<td style="width:29px"><img id="to_ship" src="http://do-test.a.bpcdn.net/do_img/global/pilotSheet/skylab/to_ship_0.png?__cv=b76cfb40c24b488ac9f685627faad600" width="29" height="36"></td>
</tr>
<tr>
<td colspan="3" style="padding-top:20px;">
<div class="button_standard">
<a style="display:block" onfocus="this.blur()" href="javascript:Skylab.sendTransport('fast', 'Chceš tento transport skutečně zahájit?','OK','Storno');">ihned odeslat</a>
</div>
</td>
</tr>
<tr>
<td colspan="3" style="padding-top:5px;"><strong>1187 U.</strong></td>
</tr>
<tr>
<td colspan="3" style="padding-top:25px;">
<div class="button_standard">
<a style="display:block" onfocus="this.blur()" href="javascript:Skylab.sendTransport('normal');">odeslat</a>
</div></td>
</tr>
</table>
Upvotes: 0
Views: 211
Reputation: 2733
You should use the attribute OnClick instead of the href, and set the href to #:
<a style="display:block" onfocus="this.blur()" href="#" onclick="Skylab.sendTransport('normal');">odeslat</a>
Upvotes: 1