Let me start by expressing my gratitude for taking time trying to help me!
I did not get it to work yet, however I think it is the fault of Android or the Android Browser respectively.
Here is what I tried:
I took your script and deleted the line breaks, comments and unnecessary spaces and added two 'alert' functions, to see if the script is executed at all:
Then I tried it with the following browsers (on the phone):
- Android Browser
- Firefox Beta v5.0
- Dolphin Browser HD Beta v5.0.2
- Miren Browser v1.2
Only Firefox executes the script (prints the 'end' message twice btw.), but it has no effect on the webpage. The other three browser choke already on the following lines (without the 'var...' line they can execute the script though):