Quantcast
Channel: Serif Software Forums (Closed) - WebPlus
Viewing all articles
Browse latest Browse all 4745

WebPlus X6: Javascript problem in 'Attach HTML....'

$
0
0
Hi All

Not sure if this is me or is a bug in WebPlusX6.

I have attached an example wpp file.

It has just one page and on the page is a button. If you look at the 'Attach HTML....' code, you will see I have placed this javascript function (totally non-sensical, just a demo of the problem) in the header area:

Code:

<script language="javascript">

function democlick()
{
  var firstvalue = 1;
  var secondvalue = 2;

  alert(firstvalue);
  alert(secondvalue);

  if (firstvalue+1) < (secondvalue+1)
    {
      alert('triggered');
    }

}
</script>

To me it looks like WebPlus is interrupting this incorrectly. If you look at the conditional line with the < sign, the text after is being coloured blue. It is like WebPlus is treating this as a tag opener and then getting the rest of the code confused.

But this doesn't work when I upload it either, nothing triggers. If I take out the conditional part, the event fires perfectly (on buitton click).

Is this me? Something I am doing?

This is quite critical to the next part of the site, so need to get this working asap.

But I have looked at it and rewritten it and looked at it again and again and the solution is not coming to me! Perhaps looked at it too long now and a fresh pair of eyes might spot something (probably obvious!).

Thanks,

Trevor

Attached Files
File Type: wpp problem.wpp (16.6 KB)

Viewing all articles
Browse latest Browse all 4745

Trending Articles