Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Default JS/HTML error

Featured Replies

Is there an error in here? Because I can't find it. When the web page comes to this point in the code, it says Unkown runtime error.

 

document.getElementById("gameboard").innerHTML = "<tr><td colspan='4'>Final Jeopardy!</td></tr><tr><td><input type='text' id='t1Bet'><input type='button' value='Submit wager'></td></tr>"

 

"gameboard" is just a table.

Hi

 

dont know much JS but many coding languages wont like

Jeopardy! The apostrophe may be the problem

 

Pat

 

You have to use it in a function at least anonymous function, something like

 

window.onload = function() 
{
document.getElementById('gameboard').innerHTML = "<tr><td colspan='4'>Final Jeopardy!</td></tr><tr><td><input type='text' id='t1Bet'><input type='button' value='Submit wager'></td></tr>";
}

 

standalone it wont work. Because your code try the implement before page fully loads and can't find the element.

Nice find, i never knew you could call a function to that.

 

My fix would have been the same, probs wouldn't have known the problem though.

 

I would have done

 

<body onload='functionCall()'>

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.