Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>One approach would be to make the popup window a "real" page, so that the popup renders the same page, just without a layout, and all of the 'logic' (I assume this means including javascript files?) will be included. No copying of HTML here, you're rendering the page on the server. I'm not familiar with C#-based frameworks/web apps, but simply passing a URL query param, like 'layout=false' is an easy way to tell your script to render a page in a "plain" layout. There are likely more elegant approaches available here. For example, in a Sinatra app (Ruby), my route could detect what type of layout to use based upon some suffix on the route. E.g. /app/chat vs. /app/chat.part ... oftentimes you do this to render JSON, vs HTML, and so forth. '.part' can be anything you want, depends on if your framework allows for this (you can always roll-your-own function to examine the request vars, not that hard).</p> <p>Another approach, which I've never tried, would be to embed or inject javascript in the html that gets copied into the popup window before allowing the popup to open. Here is a SO answer related to that: <a href="https://stackoverflow.com/questions/5760213/capture-new-browser-window-open-event-with-javascript">Capture new browser window open event with javascript</a> </p> <p>I think there are more advanced approaches that would include some simple Javascript in the page which downloads necessary files from the server when the popup is opened, but that seems like overkill for what you described. My 2 cents is just use window.open, and use the query vars to tell the server what to render. But if you're a javascript guru, by all means, get fancy. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload