/    Sign up×
Community /Pin to ProfileBookmark

Browser in a Browser

Create a “browser in a browser” using iframes. Have it maintain a URL history: every time the user enters a URL in the input text field, add that URL to a JavaScript array. Implement “Previous” and “Next” buttons plus any necessary variables, so that the user can go backward or forward in the history, and the iframe loads the corresponding web page accordingly. Upon reopening your browser in a browser, the history should be accessed through the previous and next buttons.

What I don’t know is, how to save the URLs, and then retrieve those URLs upon a reload. Where would I do this?
Here is where I am at:

function get(eID) {
var historyArray = [];
var y;
var webPage = document.getElementById(eID);
historyArray.push = (webPage);
for (y = 0; y < historyArray.length; y++) {
webPage += historyArray.join();
}
return webPage;
}

function loadWebPage() {
var webSite = get(‘webAddress’).value;
get(‘viewWebPage’).src = webSite;
historyArray.push(webSite);
}

function backward() {
window.frames[‘viewWebSite’].history.go(-1);
}

function forward() {
window.frames[‘viewWebSite’].history.go(+1);
}

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@ReFreezedOct 29.2012 — If you want to save data locally then you should look into [COLOR=#323232]localStorage.[/COLOR]
Copy linkTweet thisAlerts:
@ArtDudeauthorOct 30.2012 — If you want to save data locally then you should look into [COLOR=#323232]localStorage.[/COLOR][/QUOTE]

Thank you very much. You just confirmed what I was finding on the internet. My "instructor" is not very instructional or forthcoming with her instructions or directions. Thanks again!
×

Success!

Help @ArtDude 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 5.30,
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,
)...