/    Sign up×
Community /Pin to ProfileBookmark

HTML in Data File Usage Help — Please

Hi folks —

I am wanting a button handler to open a file and place that file’s HTML content into a named div.

myNamedDiv.innerHTML = {the contents of a data file}

I have managed to create HTML files and load these into iframes >>

iframeName.location = dataFileName.html;

Conserving memory usage is one of the desirable aspects of using HTML data files. Let’s say I have 10 buttons and each button represents 3 or 4 pages of HTML content … I’d like to avoid having 30 to 40 pages of content consuming memory and only load the target content on demand.

IE compatibility is driving my desire to use divs instead of iframes.

At this time … I am only working with client side JavaScript. I hope to groove out the client side and migrate to server/client in the future. Unfortunately, I am still a novice and have no server side experience.

Is this crazy? >> Create an input iframe that is hidden and open data files into the iframe and then copy iframe content into the named div?

All this because of security constraints, lack of data file methods within ECMAScript, and iframe inconsistencies between IE and FireFox.

Thanks in advance for all suggestions and guidance.

— Tom

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @thollister spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...