The short answer is that you cannot access msg.payload directly from inside your browser's <script>...</script> elements -- please read through the answers given on this recent discussion thread.
The short answer is that you cannot access msg.payload directly from inside your browser's <script>...</script> elements -- please read through the answers given on this recent discussion thread.