0

I wanted to ask a general question and share my experience using Google Sites and Javascript. Hopefully it will save others the time and grief.

Javascript from https://stackoverflow.com/a/14781022/6088382 was used and inserted into an HTML Box on my Google Sites test page https://sites.google.com/site/woogietest/.

<script>
  function calcul(){
    var x = parseFloat(document.getElementById("value1").value);
    var y = parseFloat(document.getElementById("value2").value);
    document.getElementById("answer").innerHTML=x+y;
  }
</script>

<form action="" id="nothing">
  <input type="text" id="value1">
  <input type="text" id="value2">
  <input type="button" value="Calculate" id="but" onclick="calcul()" />
</form>

<p id="answer"></p>

Using Chrome 50.0.2661.37 beta-m (64-bit) (conditions tested: browsing normally, disabling extensions, and in incognito mode) when I enter two numbers and press Calculate nothing happens.

Using Firefox 45.0.1 when I enter two numbers and press Calculate the code is executed properly.

The code works using IE11 too!

What am I doing wrong on Google Sites in Chrome? Should I avoid Chrome for Google Sites/Javascript development?

Community
  • 1
  • 1
  • 1
    1. You use a Beta version of Chrome. There can be problems. 2. You don't need a `
    ` for the example above. 3. Open the console (F12) and see if any message is shown.
    – ROMANIA_engineer Mar 20 '16 at 03:55
  • Thank you. There is 1 warning and 2 errors. The warning is: (index):321 Mixed Content: The page at 'https://sites.google.com/site/woogietest/' was loaded over a secure connection, but contains a form which targets an insecure endpoint 'http://sites.google.com/site/woogietest'. This endpoint should be made available over a secure connection. ... The errors appear regardless of whether I have code or just text in the HTML box and they're "Uncaught TypeError: Proxy.create is not a function." – woogiebaby Mar 20 '16 at 04:06
  • The warning went away when I removed the
    but the other errors are still there. I'll try a non-beta version of Chrome and report back tomorrow.
    – woogiebaby Mar 20 '16 at 04:12
  • Couldn't wait... same 2 errors using Chrome 49.0.2623.87 m and omitting the `
    `. I learned that I need to be more mindful of my browsers. Thanks @engineer!
    – woogiebaby Mar 20 '16 at 04:31

0 Answers0