fvink
fvink

Reputation: 50

Opening a page from DOM in current tab

On button click a PHP function is called where I use file_get_html() from Simple HTML DOM Parser to edit a form in the html file. I want to replace the current page with the edited DOM . I tried using javascript, document.write and window.open in various ways but it eitherappends the new page to current page or nothing happens.

Upvotes: 0

Views: 69

Answers (1)

Totò
Totò

Reputation: 1854

You can use the javascript

document.body.innerHTML = 'your html';

if you want to change the content of the page, or

location.href = 'some.url';

if you want to open a new url in the same page

Upvotes: 1

Related Questions