javascript - PHP Force Dynamic content into the DOM -


i'm trying come way html/text user sees on given url, though of see may produced dynamically (on page-load, example) not in dom, manually loading javascripts , putting resulting data page.

my thinking this:

  1. (naively) return array of javascript files scraping <script> tags src attribute.

  2. return array of on-page hard-coded javascripts like: <script> var example = true; </script>

  3. create function decide real urls encountered in internal , external page javascripts. example, when encountering example $.ajax({ url: '/relative-js-file.js', figure out absolute url php may access page.

  4. using php, load of javascript found on page in way resembles being loaded on actual page (the page came from).

  5. take whatever data javascript returns (plain, html, etc.), , inject new plain-text and/or html original page <body>.

i realize not work lot of time, hope @ least starting point until can find better solution or create more advanced function handle unrecognizable/inaccessable javascript. examlpe, javascript preventing being loaded on page other own.

my question

do think approach getting dynamic content not in dom, , forcing in dom? or can think of better approach? appreciate feedback , thoughts.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -