jollyjoe wrote: ↑07 Jul 2023, 12:02Can I update an element without triggering it in the HTML?
Example:
I want this elementto turn into this: (automatically after the neutron page loads)Code: Select all
<div class="expiration" id="exp">INACTIVE</div>
using this:Code: Select all
<div class="expiration" id="exp">TEST</div>
This is what I've tried so far (to no avail)Code: Select all
neutron.doc.getElementById("exp").innerText := "test"
Any help would be greatly appreciated.Code: Select all
#Persistent #SingleInstance ignore ;some code to initially verify if my license is valid ;and store it into a var (license) mm := new NeutronWindow() mm.Load("html/home.html") mm.Gui("-Resize +LabelGui") mm.Show("w410 h483") settimer, Link, 1000 ;tried to make it update every 1s but nothing happens automatically return Link() { global neutron neutron.doc.getElementById("exp").innerText := license ;I want this to "happen" without the need for triggering it with html. }
I wanna add: I also dont want to trigger it via a hotkey. I just want it to run at the beggining of the script when the page first loads, Is this possible?
[Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)
Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)
Agreed. Is there a way to setValue?
Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)
You can use JavaScript
Just like this
Code: Select all
js := "
( ; js
function ChangeElementInnerText() {
let test = document.getElementById('exp');
test.innerText='TEST';
};
)"
Clicked(neutron, event) {
; event.target will contain the HTML Element that fired the event.
; Show a message box with its inner text.
MsgBox "You clicked: " event.target.innerText
;Using AHK to execute JavaScript functions
neutron.wnd.execScript("ChangeElementInnerText()")
}
-
- Posts: 639
- Joined: 03 Dec 2018, 20:02
Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)
@geekdude I have found a way that does not need writing the registry for getting out of IE7. Just initialise it with the compatibility meta tag.
Code: Select all
Gui Add, ActiveX, vWB w500 h600, about:<meta http-equiv="X-UA-Compatible" content="IE=edge">
Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)
I have reviewed all the comments and did not find any similar issues as mine. Is it normal for you to compile it into EXE?
I happily finished writing all the interfaces, but
after compiling, I found that none of them could
be used. What went wrong? Is it a problem with my
environment?
All interfaces displayed normal compatibility when
I opened them on IE11 web pages, but they cannot
be used after compilation. Or is there anything un
supported about this library? \Why is everything r
unning normally in AHK?
This is a very simple login page, I even commentedout my JS code, leaving only HTML and CSS.I happily finished writing all the interfaces, but
after compiling, I found that none of them could
be used. What went wrong? Is it a problem with my
environment?
All interfaces displayed normal compatibility when
I opened them on IE11 web pages, but they cannot
be used after compilation. Or is there anything un
supported about this library? \Why is everything r
unning normally in AHK?
Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)
Additionally, I did not find any issues when compi
ling the author's demo into EXE. Is it because thi
s library does not support most HTML and CSS?
ling the author's demo into EXE. Is it because thi
s library does not support most HTML and CSS?
Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids (now for v2!)
You should be able to compile without issue,
In my index.html it looks like this:
And the ahk looks like you might expect:
For more details you can see https://github.com/Chunjee/ppa-wordleboost
bootstrap 4.x requires jquery and such. so leaving out all the js may be part of the issue.
I compiled from scratch to make sure. Neutron.ahk is still working on this Windows 10 machine.
In my index.html it looks like this:
Code: Select all
<link href="bootstrap.min.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
Code: Select all
; fileInstall all gui dependencies
fileInstall, gui\index.html, gui\index.html
fileInstall, gui\bootstrap.min.css, gui\bootstrap.min.css
fileInstall, gui\bootstrap.min.js, gui\bootstrap.min.js
fileInstall, gui\jquery.min.js, gui\jquery.min.js
bootstrap 4.x requires jquery and such. so leaving out all the js may be part of the issue.
I compiled from scratch to make sure. Neutron.ahk is still working on this Windows 10 machine.
v1: biga.ahk | array.ahk | string-similarity | graphicsearch.ahk | midday.ahk | expect.ahk
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 120 guests