You probably have collated the code you used from some online sources.
It's old.
Since apex 4.2 we've had the apex.server.process function (apex 5.0 doc link) which will execute AJAX calls. htmldb_Get has been undocumented since ever and even if it would be, it'd be deprecated by now. And unless you use the async call on it, it's snchronuous. That's not what the first "A" in "AJAX" stands for. There is a reason browsers are alerting you in the console about how a synchronuous request is deprecated, just like there is a reason why apex 5.1 will no longer have some built-in sync calls such as in dynamic actions.
Prepare yourself for the future (which is now) and perform your calls as they should be. Don't teach yourself old junk.
apex.server.process("getLightRequirements"
,{pageItems:"#P1_PLANTS"}
,{dataType:"text"})
.done(function(pReturn){
alert("result is: " + pReturn);
})
Take note, apex.server.process by default expects JSON back. Either comply (shouldn't be hard) or tell it to expect text back.
Now, don't put javascript code in the "HTML page header" in script tags. Again, since 4.2 you can put javascript code in therefor-designed boxes on the page level.
Similarly, stop using these "onxxx" attributes. What point is there? Dynamic actions can easily help here and will visualize where you have JS going on. These "onxxx" attributes start ending up all over the place: in SQL, in attributes, in code,... It's a pest and it's detrimental to maintenance.
Create a dynamic action which acts on change of the required item. You can then execute javascript code, such as the code above, or call a function you've specified, or even execute PLSQL code from there. It's possible that in your case here it'd be possible to put everything in a dynamic action - unless you're doing this as a simple introductory exercise for example.
If you're still struggling, you may want to consider going to apex.oracle.com . Create a new workspace, then add a new account for which you can share the credentials. Create your application and page(s) as an example, and get back to us (or anyone) and share the workspace name + developer credentials. People can then go to your application and look around, copy things, change things,...