PDA

View Full Version : object expected error



vineet
01-01-2009, 04:58 AM
hi

i m using this script



<script language="javascript" type="text/javascript">
window.top.window.stopUpload(<?php echo $result; ?>);
</script>


i get error "object expected".

I get this error only in IE7. I dont get any error in Firefox or opera.

what does this mean. how to solve

vineet

Nile
01-01-2009, 05:04 AM
Try this:


<script language="javascript" type="text/javascript">
window.top.window.stopUpload("<?php echo $result; ?>");
</script>

BTW: Provide a link to your site.

vineet
01-01-2009, 05:09 AM
Try this:


<script language="javascript" type="text/javascript">
window.top.window.stopUpload("<?php echo $result; ?>");
</script>

BTW: Provide a link to your site.


hi nile

i m working offline. its not online.

but ur code also gave me same error

This is what other code i have on my page


function startUpload(){
document.getElementById('f1_upload_process').style.visibility = 'visible';
document.getElementById('f1_upload_form').style.visibility = 'hidden';
return true;
}

function stopUpload(success){
var result = '';
if (success == 1){
result = '<span class="msg">The file was uploaded successfully!</span>';
}
else {
result = '<span class="emsg">There was an error. Plz upload GIF or JPG image only!</span>';
}
document.getElementById('f1_upload_process').style.visibility = 'hidden';
document.getElementById('f1_upload_form').innerHTML = result;
document.getElementById('f1_upload_form').style.visibility = 'visible';
return true;
}


vineet

Nile
01-01-2009, 05:23 AM
Can you post all your code please...

vineet
01-01-2009, 05:27 AM
Can you post all your code please...


hi nile

the error is in javascript and i have posted the whole javascript

vineet

Nile
01-01-2009, 05:30 AM
What does "window.top.window.stopUpload" do? I've never seen this before.

vineet
01-01-2009, 05:44 AM
What does "window.top.window.stopUpload" do? I've never seen this before.

hi nile

i dont know much.

i have also copied it from net for showing the fake loading mesage while my file is uploading.

The problem is only with IE7.

NO PROBLEM WITH Firefox or opera.

vineet

Nile
01-01-2009, 05:46 AM
Try deleting:


window.top.window.

vineet
01-01-2009, 05:50 AM
Try deleting:


window.top.window.



i myself have already tried it many times. it also gives the same error.

vineet

vineet
01-01-2009, 05:53 AM
hi nile

do you any script that allow us to hide the javascript error even if there is error.

can we hide javascript error from not showing in status bar

vineet

Nile
01-01-2009, 05:58 AM
No you cannot... What are you trying to accomplish with this script... I'll remake it.