Solved

how to know is setHomepage is success or not in IE.

Posted on 2008-10-28
8
635 Views
Last Modified: 2013-12-08
using this code we can set the home page as http://www.searchmore.in. but my question is it is asking for do set as home page or not.  how to detect the result given by user as yes or not.  because for my code. i need to continue only if the user accepts to set that page as home page.

kindly help me in this issue please.
document.body.style.behavior='url(#default#homepage)';

   document.body.setHomePage('http://www.searchmore.in');

Open in new window

0
Comment
Question by:psarun85
  • 3
  • 3
8 Comments
 
LVL 16

Expert Comment

by:sh0e
Comment Utility

try{

document.body.style.behavior='url(#default#homepage)';

   document.body.setHomePage('http://www.searchmore.in');

   }

   catch(e){

   alert(e);

   }

}

Open in new window

0
 

Author Comment

by:psarun85
Comment Utility
hi sh0e,
thanks for commenting my question. but.......
do you thing  this will be answer, how did you thing like this..

its a simple fact , catch will be executed only when some exception arises, but it the try statement it asks for to set as home page or not.. then how come the exception will arise. only two possiblities.. yes or no.

experts kindly  help me. please
0
 
LVL 16

Expert Comment

by:sh0e
Comment Utility
If there is an error, such as lack of permissions, try catch would catch it.

alert(document.body.isHomePage('http://searchmore.in'));
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:psarun85
Comment Utility
thanks
but again the problem..

this function always returns false only.



0
 

Author Comment

by:psarun85
Comment Utility
even though the homepage is searchmore.in.. but its not returning the positive reply...

always negative.. kindly  analyse this.
0
 
LVL 16

Accepted Solution

by:
sh0e earned 500 total points
Comment Utility
The isHomePage method will always return false if the document that is calling the isHomePage method is not on the same domain. For example, if www.microsoft.com is set as your homepage, and you call this method from a page on the Microsoft® Web site, then the isHomePage method returns true. However, if your homepage is set to www.microsoft.com and you call this method from a page on a different domain, the method will return false.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now