i think i am not going about this quite right, being very new to jquery.
i have a page with 3 recipes on it hidden. when a link to recipe A is clicked it opens in a modal. i want to be able to print just the content of the recipe. so i am opening a new window (nonmodal) and trying to write the recipe to it (depending on which recipe is chosen)
this is the code i am using
$('a.new-window').click(function(){
var recipe = window.open('','RecipeWindow','width=600,height=600');
$('#recipe1').clone().appendTo('#myprintrecipe');
var html = "<html><head><title>Print Your Recipe</title></head><body><div id="myprintrecipe"></div></body></html>";
recipe.document.open();
recipe.document.write(html);
recipe.document.close();
return false;
});
but it returns an error. i think it is close but not quite right. the error is:
missing ; before statement
[Break on this error] var html = "Print...="myprintrecipe">";
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…