Jump to content

IE Replace Text in JS-script possible?


Recommended Posts

I have a NDIS based Internet sharing device. I got info about my balance inquiry by clicking a button, it's sending ussd *101# to my provider. This was ok in past but no i have changed provider, all other functions are ok, but new provider uses *100# as valid ussd for geting balance inquiry. So i used 

#include <IE.au3>

$oIE=_IECreate('http://192.168.8.1/html/ussd.html')

$sHTML=_IEDocReadHTML($oIE)
$sHTML=StringReplace($sHTML,'101#','100#')
_IEDocWriteHTML($oIE,$sHTML)

to get it. But with this script i can't get the info. It replaces correct in 

<div id="fun_balanceInquiry" style="display: block;">
                                <div class="ussd_extend_border"><p><label id="balance_inquiry_description0">Auf Guthaben drücken, um Informationen über Ihr Guthaben zu erhalten.</label></p> <table width="500" border="0" cellspacing="0" cellpadding="0">  <tbody><tr><td height="40" class="cls_ussd_label_BalanceInquiry_action"> <label id="balance_inquiry_result0"></label></td> <td class="align_right" id="balance_inquiry_action0"><span class="button_wrapper" id="#BalanceInquiry0" onclick="javascript:ussd_sendCommand('BalanceInquiry0','*101#','CodeType', 'undefined');return false;"><span class="button_left"><span class="button_right"><span class="button_center">Guthaben</span></span></span></span></td>  </tr></tbody></table></div></div>
                                
                                <div id="fun_charge" style="display: none;">
                                </div>

but it seems this included script:

<script src="../js/ussd.js" type="text/javascript"></script>

is called. In DOM Explorer i see:

function onclick(event)
{
javascript:ussd_sendCommand('BalanceInquiry0','*101#','CodeType', 'undefined');return false;
}

but i can't write a changed ussd.js back to my internet stick.

So my question is how can i change htmlcode in a way calling function onclick with new ussd command?  

Link to comment
Share on other sites

Sorry it posted before i was done, eval this

 

var myvar = uss_sendcommand(...); document.getElementById(x).value = myvar;

x is some input field  you can get by autoits ie's ieformgetvalue

this is the only way i know how to get values from js.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...