Page 1 of 1

Webserver plugin question

Posted: Sun Aug 21, 2011 8:59 am
by brainlessbart
Hi there,

I have a question. I've been playing with te webserver plugin but get some strange behavior. When I refreh the page the last event (from a clicked link) is generated again in eg. Is this normal?

For instance: When ik click the first link a event is triggerd ("BuitenlampSchuurSwitch") when I then refresh te page the event is triggered again.

Thanks in advance.

Bart

Code: Select all

<html>
    <head></head>
    <body>
        <p>
	<a href="?BuitenlampSchuurSwitch">Buitenlamp schuur is {{"aan" if BuitenlampSchuur else "uit"}}</a>
            
        </p>
<p>
        <a href="?LampPlafondEettafelSwitch">Lamp plafond eettafel is {{"aan" if LampPlafondEettafel else "uit"}}</a>
        </p>

    </body>
</html>

Re: Webserver plugin question

Posted: Sun Sep 25, 2011 3:25 am
by eatmeimadanish
Yes, if you notice in the URL you will have not only your page, but a question mark and some data. This gets parsed by Eventghost as the event and payload. This is how the web server works, it gets sent a command via a URL address and translates that. When you send an event, you are just going to that url, thus a refresh will trigger the event again. If you want to hide the event via the webserver, use some javascript and use an AJAX call.