Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
I'm having a problem with HTML in Google Sites

Because I don't understand Google Scripts, I use Google Sites, and when ever I try put this code in, nothing happens, so I used another piece of code that would tell me if it wasn't working, and it said "User canceled request", when you click the button, a drop down of updates, and upcoming updates should appear, but nothing happens.

<button onclick="myFunction()">Press for Announcements</button>
<script>
function myFunction(){
  alert("New:\n- New Code\n- Update Button\n- About the Creator Section\n- Contact the Creator\n\nComing Soon:\n- Quote Code YouTube Channel\n- More Codes\n- Accounts\n- Commenting\n- Pre-made Code\n- C/C++\n- Code Sandbox");
}
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your issue is that you are unable to use alert dialogs in Google Sites. Google Scripts can be confusing. It's usually good to open up the web console as these errors should give you some idea of what is going on.

This change will add your text into a new DIV within the site. I imagine you want it to do much more, but hopefully this helps you understand what was going wrong.

<button onclick="createHTMLalert()">Press for Announcements</button>
<script>

    function createHTMLalert(){
        if(!document.getElementById('announcements_alert')){
            let announcements_alert = document.createElement('div');
            announcements_alert.id = 'announcements_alert';
            document.body.appendChild(announcements_alert);
            announcements_alert.innerText = "New:\n- New Code\n- Update Button\n- About the Creator Section\n- Contact the Creator\n\nComing Soon:\n- Quote Code YouTube Channel\n- More Codes\n- Accounts\n- Commenting\n- Pre-made Code\n- C++ and C for Game Making\n- Quote Code Twitter Page\n- Code Park";
        }
    }
</script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!