Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

External HTML into <DIV>

Featured Replies

Ok, here goes

 

I've been recoding this site to get around different issues with SEO and outdated standards. It's a general product site where there is a list in a <div> on one side of the page and another <DIV> next to it on which i've ID'd as "content"

 

I then wanted to build each product on it's own little html page just to make it quick and easy - and intentionally faster as it's only changing the content on one area of the apge.

 

I intiailly used the dreaded "<iframe>" and got no shortage of issues. so went looking about to externally load html into divs I then found innerHTML which of course works nice for the initial loading, but I cant figure out how to code it so when I click on the link on the left, it changed the content on the right. That's problem one. Problem 2 - As everyone knows (and I found out) Firefox does not support innerHTML - so now i'm back where I started.

 

Suggestions?

 

The page is posted at : dev.toraenergy.com/wind2.html

 

Any help suggestions PLEASE? Thanks in advance. ;)

Why don't you use SSI's to include common page elements like header, menu and footer? It's a lot lot easier!

 

You could call the content in using AJAX but then you don't get any SEO benefits because essentially you only have one "page"

If your server has PHP installed, you could use PHP includes to add other HTML files inside your main HTML file. Simple and should always work, without depending on what the client has or doesn't have. :)

 

And to make it vary automatically, you could make if-statements that select the correct includes to be used. ;)

  • Author

current code:

 

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="target.innerHTML=content.document.body.innerHTML">

<iframe id="content" src="iselect_Wind.html" style="display:none"></iframe>

<div id="target" style="width: 26.75em; height: 21.81em; overflow: auto></div>

 

href for link to new content

 

<a href="xxxxxx.html" target="content">XXX,/a>

 

 

ok we know this isn't working...

 

Stand at end of runway... watch plane fly over head, watch wheels not touch head.... really lost here

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.