I have this old "closed" system where it runs IE in its own container, meaning I have to code like a caveman in many cases because I can't use any browser developer tools/console to x-ray the objects being returned from the remote system.
Now, the specific function I'm looking at is a callback from a third party (it gets complicated) that returns what I am willing to bet is a standard JSON object.
function core_OnUeDeltaItemsUpdate(dataType, oData)
{
if (dataType == "Units")
{
// Bail if dispatch report xml hasn't been loaded yet.
if (oXml == null)
return;
..... does lots of stuff
// Reload the content in case any of our displayed units changed
processUeDelta.click();
}
}
... at the bottom of the page
<button style="display:none;" type="button" id="processUeDelta"/>
and the attached javascript file that I was hoping would use jQuery
$(function(){
$("#processUeDelta").click(function(){
var i = 0;
alert(this.ueDelta);
for(var propertyName in this.ueDelta)
{
i++;
alert("property " + i + ": " + oData[propertyName]);
}
});
});
Now, currently the last function that binds itself to the hidden button cannot parse oData. I'm stuck on two things here.
- I'm not sure how to pass the oData object to the attached eventhandler
- I'm not too keen on this design, perhaps there is another way were I can take out the intermediary button so I can then process the JSON data object oData.
Points of note:
- This is based on a data pump, so this callback is being called on an average of 5s.
- I am limited to using jQuery 1.7.1
- I cannot see the object, my browser cannot act as a test harness, there are too many moving parts for me to be able to test it from outside the application.
core_OnUeDeltaItemsUpdatefunction?core_OnUeDeltaItemsUpdatethen why trigger an event on the hidden button to pass the data? You can just create a function in your jQuery file and call it fromcore_OnUeDeltaItemsUpdatepassing inoDataas a parameter.