Page is a not externally linkable
astupidname - 7:49 am on Dec 29, 2011 (gmt 0)
My constraint is I do not have a class/id hook to the element I want to write to.
I will assume for the sake of less argument that this is beyond your control and you do not have the ability to add an id? I will ignore the iframe bit for this response, and go back to the beginning here.
The good news is that as the page is being loaded document.getElementsByTagName('div').length changes with each div read in to the page. So if your "myscript.js" linked script absolutely must be placed in the appropriate div where the 'data' is to appear, then the code within it can just read getElementsByTagName('div') and the last one is the one "myscript.js" is in (at the time of the read). So I believe this scheme should work:
var divs = document.getElementsByTagName('div');
var DATA_RECEIVER_DIV = divs[divs.length - 1]; //the current div this script is within at time of page load
function request_callback(data){
console.log('data received');
DATA_RECEIVER_DIV.innerHTML = data;
}
request_jsonp();