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

Test URL before using it?

P: n/a
I'd like to be able to see if a URL was functional before I attempt to put
it in an IFrame. Is there a way to do this so I can prevent the user from
ending up with a 404 error page in the IFrame?

thx

--

Robert Oschler
"Let the web hear you, add your voice to your web site in minutes!"
-- http://audiodirect.spiderchase.com/
(For a limited time, free voiceover with every sign-up, use this link
instead)
-- http://audio.spiderchase.com/
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Robert Oschler wrote:
I'd like to be able to see if a URL was functional before I attempt to put
it in an IFrame. Is there a way to do this so I can prevent the user from
ending up with a 404 error page in the IFrame?

thx

--

Robert Oschler


If you know your users are going to be using IE6+ and Netscape 7+, you could
use the XML HTTP Request object to check for the page prior to changing the
location of the iframe:

<url: http://jibbering.com/2002/4/httprequest.html />

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #2

P: n/a
In article <jv********************@news2.news.adelphia.net> ,
no_replies@fake_email_address.invalid shared the illuminating thought...
I'd like to be able to see if a URL was functional before I attempt to put
it in an IFrame. Is there a way to do this so I can prevent the user from
ending up with a 404 error page in the IFrame?


Not with javascript if the page is from a different domain, which I
assume it is or you'd know if it was there.
Could be done with dynamically generated pages (server-side), such as
JSP/servlet, using a language that understands URLs.
----------------------------------------
~kaeli~
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
----------------------------------------
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.