Essentially I'm trying to open a new window, based on selected images from the original page.
There's a fiddle here containing what I have so far, but I'd like to be able to open the new window with a different CSS and JavaScript file.
Current JavaScript:
var tickBoxHTML = "<div class='tickBox unselected'></div>"; $("img").after(tickBoxHTML);
$(".tickBox").click(function () {
$(this).toggleClass("tickBox selected", "tickBox unselected"); });
$("#compare").click(function () {
var compareText = "<p>Selected images for comparison:</p>";
$(".selected").each(function () {
var thisSrc = $(this).prev("img").attr("src");
var thisAlt = $(this).prev("img").attr("alt");
compareText += "<div><img src='" + thisSrc + "' alt='" + thisAlt + "' /></div>";
});
compareText += "<br><button onClick='window.close()'>Close Window</button>"
var compareWindow = window.open();
compareWindow.document.body.insertAdjacentHTML("beforeend", compareText);
});