For instance, say I have the HTML page index.html
. It has a javascript function someFn()
(upon onclick
) that needs to obtain the entire contents of this page (which also has text fields that are modified by the user. (So as a result, the page contents will be modified from the original content.) Eventually, this someFn()
will try to obtain the entire contents of the page in a variable. This variable is then passed on to a PHP script in another file that does the required work. Alternatively, it may output it to a file which is read by the aforementioned PHP script.
The only problem is how the JS function will obtain the page contents in a variable. jQuery alternatives are welcome as long as they don't mess with the workflow of data shown above.