Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7947351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:24:22+00:00 2026-06-04T01:24:22+00:00

I found the snippet below for creating an iframe: I’d like to only load

  • 0

I found the snippet below for creating an iframe:

I’d like to only load the textual content at http://www.host.com and make the iframe invisible using display:none

Background:

I need an effective way to parse out the favicon location. Not all site have a default location. For example <link rel="SHORTCUT ICON" href="../images/logo_small.ico" />.

Hence all I need are the textual contents. PHP has a function that does this ( file_get_contents) but I want to do it on the client side.

Here is the mdn documentation on iframe

For server-side PHP use file_get_contents.

function makeFrame() {
   ifrm = document.createElement("IFRAME");
   ifrm.setAttribute("src", "http://www.host.com");
   ifrm.style.width = 640+"px";
   ifrm.style.height = 480+"px";
   document.body.appendChild(ifrm);
} 

Example of Delicious Bookmarklet:

javascript:(function()
{
    f='http://www.delicious.com/save?url='+encodeURIComponent(window.location.href)+
    '&title='+encodeURIComponent(document.title)+'&notes='+
    encodeURIComponent(''+
    (window.getSelection?window.getSelection():document.getSelection?
    document.getSelection():document.selection.createRange().text))+'&v=6&';
    a=function()
    {
        if(!window.open(f+'noui=1&jump=doclose','deliciousuiv6','location=1,links=0,scrollbars=0,to
        olbar=0,width=710,height=660'))
        {
            location.href=f+'jump=yes'
        }
    };
    if(/Firefox/.test(navigator.userAgent))
    {
        setTimeout(a,0);
    }
    else
    {
        a();
    }
})()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:24:24+00:00Added an answer on June 4, 2026 at 1:24 am

    You will only have access to the link element in the iframe when both yours and the framed page are in the same domain. To cite the docs you found:

    Scripts trying to access a frame’s content are subject to the same-origin policy, and cannot access most of the properties in the other window object if it was loaded from a different domain.

    Therefore, it will be needed to use a PHP solution. Load a given domain, use a tagsoup parser and query the dom for link[rel="SHORTCUT ICON"].

    You can create a JSON API with that solution, which can be used over Ajax from the clientside js code of your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to use the snippet below (found from https://stackoverflow.com/a/3675110/782880 ) in several places
In this blog, http://www.bswebdev.com/2008/12/javascript-change-input-box-type-to-password/ I have found the following snippets for fixing change input
I have found services like ClearSpring and Widgetbox for putting content snippets onto a
The code snippet below causes this warning in NetBeans 6.9. [rawtypes] found raw type:
FIXED : SEE BELOW ok. so here's my app. http://libwiki.heroku.com/libraries if you view it
I have found a code snippet as given below which is used to disable
I saw some code snippet like below: process.stdin.on('keypress', function(c, key){ if (key && 'enter'
I found this snippet of code I am having trouble trying to find a
I've found this snippet of code on the net. It sets up an NSMutableArray
I'm trying to produce random integers (uniformly distributed). I found this snippet on an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.