Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Web server and persistent variables

Questions and comments specific to a particular plugin should go here.
Post Reply
davidmark
Experienced User
Posts: 85
Joined: Thu Jan 01, 2015 5:25 pm

Web server and persistent variables

Post by davidmark »

I have the enhanced Web server plugin disabled as I could never get it to include variables in responses (and not sure what it offers over the original). Have no trouble including EG globals in responses with the original. But could never figure out how to get the persisted variables in there. Would seem like a no-brainer as surely that's what they were created for.

Anybody have an example with either plugin? Currently resorting to mirroring persisted variables in globals.
davidmark
Experienced User
Posts: 85
Joined: Thu Jan 01, 2015 5:25 pm

Re: Web server and persistent variables

Post by davidmark »

Bumping this as somebody must have the answer (if it exists).

Started to read the long "Webserver" thread, but stopped as soon as jQuery was mentioned. As far as controlling EG through HTTP (and for pretty much anything else), jQuery was (post is from 7 years ago) and remains a bum steer. Details are beyond the scope of this forum, but learning jQuery in 2009 would have been unfortunate as the basic DOM interfaces made no sense at that time. They've since spent years since trying to make them make sense, usually at the cost of backward compatibility. Meanwhile the various browsers (IE was the biggest offender) converged on standards, rendering the whole thing moot.

Anyway, if you don't need a return value, you can simply do something like this:

new Image().src = 'http://192.168.1.3/?eventname&payload1& ... 2&payload3';

Obviously, change the IP address to point to your own EG PC.

An Ajax-based solution is not much longer or much more complicated, even if supporting ancient IE browsers. There are plenty of examples out there that do not require the bloating, bugs and misunderstandings found in jQuery.
Post Reply