thomasnowac
New member
Is it possible to set a global variable in HE and to retrieve it in JavaScript in real time?
The situation I have is that JavaScript htmlexe.GetGlobalVariable is asynchronous, which it did not used to be in Html Executable 4.x. window.external.GetGlobalVariable('HE','she') worked. Now you need a callback function, as I understand it.
Provided the value of henew is 'www', there is an alert to that effect when you go to the page containing the JS. This is asynchronous. The page loads first, then the alert.
What I would like to do is to detect if henew = 'www1' or henew = 'www2' in two publications. In publication A the value is www1 and publication B www2. When the publications go to a page that is online they should behave in different ways. Publication A is allowed to open a link and B cannot open the same link. The online server needs to detect which is which. Asynchronous detection does not work here, because the page with the link loads beforehand.
So my question is, I guess, whether there is some way to retrieve a string or a variable stored in a publication before the page loads. Please do note that the publications are mostly self-contained. Visiting the online page is the exception.
The online page can detect Html Executable, but not which publication.
The situation I have is that JavaScript htmlexe.GetGlobalVariable is asynchronous, which it did not used to be in Html Executable 4.x. window.external.GetGlobalVariable('HE','she') worked. Now you need a callback function, as I understand it.
function heservr(content) {alert(content)} // callback
htmlexe.GetGlobalVariable('henew', '', heservr);
Provided the value of henew is 'www', there is an alert to that effect when you go to the page containing the JS. This is asynchronous. The page loads first, then the alert.
What I would like to do is to detect if henew = 'www1' or henew = 'www2' in two publications. In publication A the value is www1 and publication B www2. When the publications go to a page that is online they should behave in different ways. Publication A is allowed to open a link and B cannot open the same link. The online server needs to detect which is which. Asynchronous detection does not work here, because the page with the link loads beforehand.
So my question is, I guess, whether there is some way to retrieve a string or a variable stored in a publication before the page loads. Please do note that the publications are mostly self-contained. Visiting the online page is the exception.
The online page can detect Html Executable, but not which publication.
Last edited: