Solved

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

Posted on 2008-10-28
8
659 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
8 Comments
 
LVL 16

Expert Comment

by:sh0e
ID: 22828618

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
ID: 22828814
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
ID: 22828856
If there is an error, such as lack of permissions, try catch would catch it.

alert(document.body.isHomePage('http://searchmore.in'));
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

Author Comment

by:psarun85
ID: 22828917
thanks
but again the problem..

this function always returns false only.



0
 

Author Comment

by:psarun85
ID: 22828918
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
ID: 22828979
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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.

688 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