1
Well, I have a Chrome extension with page 1 and page 2, each with its script.js. On page 1 I can open a new tab/window when I click on a button, and when the new tab opens, the . page html 2 calls a search script, via Jquery.load(), load a div with an element <textarea>
of page 1, except that: <textarea>
comes with the initial value of the DOM when loaded/built, but before clicking on the X button of the page1, the <textarea>
was edited - I entered a new value through a script, however, when the function .load
query such page element 1 for the page2, it comes with the original value. The command in the.js script of page2 is as follows:
$("#divPagina2").load("../pagina1.html #idTextareaPagina1");
In short: in page . html 1, I define <textarea>
worthwhile textareaOriginal
, then, in the script.js of this page1, I update to (for example) textareaComValorAlterado
, and just this changed value is not taken by . load(). Any hint?
load makes a GET request and returns the initial value, in order to get the new value, the initial must be exchanged for the new value or when changing, the new value be saved somewhere, such as Localstorage to be accessed by the second page
– Costamilam
The
.load
retrieves what’s on the server, not what’s on the browser screen.– Sam
William Constamilam... and how do you do that, can you demonstrate? grateful.
– Fernandes