Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are .innerHTML problems not an issue when using JQuery().html()?

I worked out any single instance of document.getElementById("MyID").innerHTML = "A value" in this Javascript World Clock guide causes Wordpress Admin not to load completely and breaks various areas of the Wordpress admin interface.

I solved it by replacing each instance with jQuery("#MyID").html("A value")) which appears to work fine. What is causing .innerHTML to fail miserably but not JQuery().html()?

like image 241
edwinbradford Avatar asked Sep 10 '26 07:09

edwinbradford


1 Answers

At a guess I would suspect either browser-specific stuff or document.getElementById("MyID") returns null, causing an exception.

like image 187
cobbal Avatar answered Sep 11 '26 19:09

cobbal