Jump to content

How to add code to an au3 page on the fly..


Recommended Posts

I have built a Gui that downloads a page with a table in it and I want to add a radio box next to each item when it displays.

Is there an easy way to do this..

Is this the best way or can it be done on the fly.. right now I wait for it to load then rewrite it ... is there a simpler or easier way?

Once the GUI is loaded with the page...

Local $sHTML = _IEBodyReadHTML($oIE)

$sHTML = $sHTML & "<p><font color=red size=+5>Big RED text!</font>"

_IEBodyWriteHTML($oIE, $sHTML)

This adds to the end of it and I assume I could do a search and replace something in the table to get radio boxes at the end of each <td> maybe with something line

find </tr> replace with <td>radio box</td></tr>

any suggestions.. I am probably doing it the hard way.... Thanks...

Link to comment
Share on other sites

I have built a Gui that downloads a page with a table in it and I want to add a radio box next to each item when it displays.

Is there an easy way to do this..

Is this the best way or can it be done on the fly.. right now I wait for it to load then rewrite it ... is there a simpler or easier way?

Once the GUI is loaded with the page...

Local $sHTML = _IEBodyReadHTML($oIE)

$sHTML = $sHTML & "<p><font color=red size=+5>Big RED text!</font>"

_IEBodyWriteHTML($oIE, $sHTML)

This adds to the end of it and I assume I could do a search and replace something in the table to get radio boxes at the end of each <td> maybe with something line

find </tr> replace with <td>radio box</td></tr>

any suggestions.. I am probably doing it the hard way.... Thanks...

Please correct me if I am wring ... I believe what you are trying to do id modify a HTML table to add your own column with a radio button on each row.

If I am right - then I think finding each <TR> tag and adding <TR><TD>+code for radio button will do this.

You can get a collection of <TR> tags via the UDF. The innerHTML attribute will give you the table cells <TD> ... add your <TD> to this.

Edited by MouseSpotter
Link to comment
Share on other sites

<

Local $sHTML = _IEBodyReadHTML($oIE)

$sHTML = StringReplace($sHTML, '> <', '>Tom<')

_IEDocWriteHTML($oIE, $sHTML)

>

No have not tried the insertDoc yet.. maybe I will go try that now.

The above code works fine but I suppose it is grabbing the body only as it says and when it rewrites all the stuff in the header is gone.. so No css throws it all out of whack..

Maybe if I can figure out the body insert.. it will insert into the existing full page and not lose the header... but mine works half a...ssed...

Oh.. if anyone is confused withe the   and Tom is that the table in question is already there and blank with the code above so I just replaced it with Tom for testing.. will be simple to replace Tom with a radio code...

Is there a command the reads the entire html file and not just the body...

Also my Scite Tools does not list a selection for KODA... am I out of date or what.

Thanks for the help so far...

Edited by tommytx
Link to comment
Share on other sites

Is this just for your computer? If yes,

If you are using Firefox - you can use an add-on called GreaseMonkey. https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/

If you are using Chrome, use tampermonkey: http://tampermonkey.net/

You can use the same scripts for both. What they allow you to do is modify a existing webpage on the fly to suit your taste. I use it for my Salesforce stuff to give me extra functionality. There are thousands of scripts available and it is easy to use.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...