Hi!
It's a weird doubt, but it goes....
I have a button in a page, that makes a Ajax request, and when i have the answer, I write it to the page and then it's called a function to adjust Page Elements. When i click the button the first time, this function isn't called, but in the next request it is.
But...if I place a alert in the scope of the function, when i make the same first ajax request and wait for the answer to call the function, it displays the content of the alert and adjust my page elements.
Well...i don't see any logic in that, but if this ring's a bell to anyone, I apreciate the help.
EDIT:
function HandleResponseCellVehicleReport()
{
if (XmlHttp.readyState == 4) {
if (XmlHttp.status == 200) {
WriteCellVehicleReport(XmlHttp.responseText);
}
else {
alert("Problema: " + XmlHttp.statusText);
}
}
}
function WriteReport(myJSONtext) {
(....)
EndLoad(document);
EnableButtons(document);
adjustPageElements(pageId,document);
}
function adjustPageElements(client, __document) {
var viewportwidth;
var viewportheight;
if (!__document) {__document = document;}
(....)
}
I place the alert in the beginning of adjustPageElements function.
Thanks