Javascript doesnt update
Posted
by
Trikam
on Stack Overflow
See other posts from Stack Overflow
or by Trikam
Published on 2011-02-01T23:17:06Z
Indexed on
2011/02/01
23:25 UTC
Read the original article
Hit count: 342
Hi all,
I have a function that passes a parameter which is a function call and then i use setTimeout to call this passed function call. now i tried two methods with setTimout to raise the event and i used function.call(). When this passed parameter function call was raised none of the javascript was being updated, below is the javascript which im using to raise the event and the javascript which is supposed to be updated:
The function being passed is [context] - function() { ErrorMessageFileSelect('diverrortextchoosechannal','The file chosen is to big, you must choose a file less than 1MB'); }
function FileSizeOnLoad(contentLength,context) {
if (context != null) {
// context.call();
setTimeout(context,0);
// or context.call();
}
else
{
$('#inputHiddenFileSizeField').val(contentLength);
DisplayChoseFileInformation(contentLength);
}
}
//this is where the update should happen
function ErrorMessageFileSelect(className, errorMessage) {
$('div.' + className).text(errorMessage);
alert($('div.' + className).text());
}
Is there somthing im missing, can someone help me with this issue please.
Thanks
© Stack Overflow or respective owner