Search code examples
javascripthtmlfaviconframeset

Creating head tag outside a frameset


So i have a website: www.site1.com

and inside the head tag of it i have placed these two elements:

<link rel="shortcut icon" type="/favicon.ico?">

for the favicon,

and

<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1">

for the responsive behaviour.

If you navigate to www.site1.com, everything works perfectly.

Now: actual domain for the website is www.site2.com And who navigates on this domain seems to get a new page with a frameset that wraps the www.site1.com website. I have no access to the server (and code) which does the "magical trick":

problem is that this way the head element of my pages will be somehow ignored by the browsers: favicon is not showing and website doesn't go responsive.

I've tried to add the head element dynamically through JS script at the end of page: didn't work. Then i tried to put this script in an external file and then load it dynamically using a link to the file: didn't work. Both the solution DO add the elements, but still in the wrapped-head-element and not in the external one.


Solution

  • Cross origin limits on JavaScript make this impossible.

    This is one of the drawbacks on using frame masking based domain name hosting instead of properly configuring the DNS and webserver to point the domain name at the actual site.