<script language="javascript">
function uploaderStatusChanged( uploader ) {
upload_status = uploader.getStatus()
if(upload_status==1){
traceEvent( "The files are being uploaded!" );
testFinish();
}else{
traceEvent( "The files have successfully uploaded!" );
}
}
</script>
I'd like to call the testFinish() function in here but I have this in a jQuery code:
Code:
<script>
$(function() {
function testFinish(){
alert("its finished");
}
});
</script>
How can I call the functions within jQuery from my original Javascript function? Thanks in advance.
why did you put it in a jQuery? it wouldve worked the same if you dropped the $(), and wrote it as a simple javascript function. and this way you couldve called it easily as well.
anyways, i think you could call it from your javascript if you just put the call in the $() as well:
Here is the code the complete code that I'm trying to use. The uploaderStatusChanged() is called from the uploader (I'm using Jumploader). I tried to put this in the jQuery but it wouldn't work if I took it out of the regular javascript tags. I'd like it to call the jQuery function testFinish() after the images are done being uploaded. Not sure how to updated this code to make that happen. Any ideas would be greatly appreciated. Here is the complete code:
well, of course it would'nt work, you call a function by its wrong name!
right now, your testFinish() is stuck in a jquery function... so my first advice is.. let it out of there. there is nothing jquery in a simple alert. just delete the orange part from
Code:
$(function() {
function testFinish(){
alert("its finished");
}
});
if, for some unreasonable unlogical reason that does not work, youll just have to turn every call for this function jquery, like this:
Bookmarks