By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,693 Members | 1,264 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,693 IT Pros & Developers. It's quick & easy.

simple question

AnuSumesh
P: 96
Hi All,

I know it is very simple question.

what is the meanig of following code and how it works :

Expand|Select|Wrap|Line Numbers
  1. if (document.images)
  2. {
  3.     location.replace(//some url);
  4. }    
  5. else    
  6. {    
  7.     location.href =//some url;
  8. }
Regards,
Anu
Jan 23 '08 #1
Share this Question
Share on Google+
7 Replies


gits
Expert Mod 5K+
P: 5,327
hi ...

i think document.images checks for IE and in that case the current href of the window will be replaced with a new one. even in all other cases ... but when using location.replace() the page will not be saved in the local browser history ...

kind regards
Jan 23 '08 #2

AnuSumesh
P: 96
Hi

Thank you very much.
One more question: Mozilla supports ActiveX controls ar not?

Regards,
Anu
Jan 23 '08 #3

acoder
Expert Mod 15k+
P: 16,027
what is the meanig of following code and how it works :

Expand|Select|Wrap|Line Numbers
  1. if (document.images)
  2. {
  3.     location.replace(//some url);
  4. }    
  5. else    
  6. {    
  7.     location.href =//some url;
  8. }
Surely, it'd make more sense to actually test for the method that you're going to use:
Expand|Select|Wrap|Line Numbers
  1. if (location.replace)
  2. {
  3.     location.replace(//some url);
  4. }    
  5. else    
  6. {    
  7.     location.href =//some url;
  8. }
Jan 23 '08 #4

gits
Expert Mod 5K+
P: 5,327
Hi

Thank you very much.
One more question: Mozilla supports ActiveX controls ar not?

Regards,
Anu
no it don't :) ... fortunatly mozilla don't support that ms-proprietary and security-risky component-model ...

kind regards
Jan 23 '08 #5

acoder
Expert Mod 15k+
P: 16,027
One more question: Mozilla supports ActiveX controls ar not?
There is the Mozilla ActiveX project, but it's not been updated since 1.5 and you can only use it for the specified browser version.
Jan 23 '08 #6

AnuSumesh
P: 96
Thanks to all

Anu
Jan 23 '08 #7

acoder
Expert Mod 15k+
P: 16,027
You're welcome.
Jan 24 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.