External HTML link in agent code

I’m trying to put a link to my Xively github feed into the agent web page.

I’m trying to insert this into the HTML section of the agent code.

<a href="http://xxxx.github.io/channel-viz/ " target="_blank">View data log</a>

I get ‘end of statement expected (; or Lf)’ error on the line.

Does anyone have any ideas? Is there a HTML reference for the agent?

There isn’t an HTML section of agent code. HTML can be stored as a string - but if you’re doing that, you need to be careful with quotes (as quotes terminate strings).

You need to either using single quotes (which are valid in html and js) or escape your quotes:

<a href=\"http://xxxx.github.io/channel-viz/ \" target=\"_blank\">View data log</a>

Thanks for the info

Again its probably me, but IDE didn’t like what you posted. Following your description, I modded to this which works fine.

<a href=""http://hyperone.github.io/channel-viz/"" target=""_blank"">View data log</a>

Everything after the // is interpreted as a comment in the IDE. But that doesnt matter to the page.

This should work, just copied out of my IDE. :wink:

function requestHandler(request, response) { local content = "<a href=\"http://google.com/\" target=\"_blank\">Google</a>"; response.send(200, content); return; } http.onrequest(requestHandler);