Js is a quick solution to an empty or non object problem

  • 2020-03-30 00:49:55
  • OfStack

1. Add a parameter < Script language = "javascript" defer = "defer" >

2. 'null' is empty or not an object:

< The script type = "text/javascript" > Try adding the defer=true property inside,

I.e., < The script type = "text/javascript" defer = true>

3. Document. GetElementById to null

Reason: var titab= document.getelementbyid ("titletab"); No object was retrieved

Solutions:

1. Add alert(titab) below the error statement; Debug the statement to see if a message box pops up

2. If it doesn't pop up, check the HTML code for "id=titletab" < Table> Labels (be careful, not a single letter is wrong)

3. If the label exists, consider < Script> Remember to include getElement code < Script> The code snippet must appear after the Element in the HTML which means that you put the < Script> Code snippets in < Html> After the tag then try


Related articles: