Page 1 of 1

How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Wed Mar 12, 2014 2:03 pm
by Andrey Savitsky

Hello.
In component html code there:
!DOCTYPE html
html
head
title
function on_iframe_load() {
document.getElementById('iframe_a').onload = function() {
};
}
/script
/head
body
iframe name="iframe_a" id="iframe_a"
a href="http://gomel-transport.by/node/105" target="iframe_a" onclick="on_iframe_load()"Go!
/body
/html

How to save the contents of the iframe in the cache or local storage?
Help me, please.


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Wed Mar 12, 2014 2:42 pm
by Maryna Brodina

Hello! If you want to get iframe content, please take a look here http://stackoverflow.com/questions/92...


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Wed Mar 12, 2014 2:46 pm
by Andrey Savitsky

I want to save the contents of the iframe in the cache.


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Wed Mar 12, 2014 3:53 pm
by Nikita

Hello,

You should follow the link above and act as it's stated there. What is the problem?


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Wed Mar 12, 2014 3:59 pm
by Andrey Savitsky

Hello.

I got the contents of the iframe.

I do not understand, how to save the contents in the cache?


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Wed Mar 12, 2014 8:13 pm
by Nikita

Hi,

Then you should save values in localStarage, it will be easier. Get value from iframe and save it in localStorage:
var value = $("#id_description_iframe").contents().find("body").html();
localStorage.setItem("myFrame", value);


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Thu Mar 13, 2014 8:41 am
by Andrey Savitsky

Hello, Nikita.
Thanks you.
Where to put this code?
How to get the contents of a iframe from the local storage?


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Thu Mar 13, 2014 12:51 pm
by Maryna Brodina

Hello!

[quote:]Where to put this code? [/quote]it depends on your app logic. You can run this code om button click.
[quote:]How to get the contents of a iframe from the local storage? [/quote]read mor eabout localStorage here https://developer.mozilla.org/en-US/d...


How to save the contents of the iframe in the cache or local storage? Help me, please.

Posted: Thu Mar 13, 2014 3:19 pm
by Andrey Savitsky

Hello, Maryna.
Thanks you.