Problem calling ext js functionS?

I have these functions relating to both .html and .php pages and neither of them are calling the functions properly. It works fine when I pop the code into the page, but not when I nest it in the external files.

Is this an innerHTML issue?

CODE:

var text_work = “blady blady bla”;
function display_work(){
document.getElementById(“main_content”).innerHTML = text_work;
}

(then obviously a div named main_content on the page)!