1
为了在我的页面框架上打印一组数据,我创建了一个javascript function
以将其设置为a
标记上的onClick
。但是,该功能只是在点击打印时仅获得一个参数,而不是全部。将两个函数参数应用于onClick标记
所以我做了HTML:
<div id="services">Services available</div>
<div id="products">Products available</div>
和JavaScript函数(两个参数):
function Popup(data1, data2) {
var printWindow = window.open('', 'Page', 'width=600,height=600,left=400');
printWindow.document.write(data1);
printWindow.document.write(data2);
return true;
}
function PrintElem(elem1, elem2) {
Popup($(elem1, elem2).html());
}
而且a
标签设置为被点击并打开一个弹出窗口。窗户被打开,与提供的服务,但产品不会出现和输出undefined
<a onClick="PrintElem('#services, #products')">Print page</a>
我怎样才能让阅读功能都IDS?
抓住了我,因为我是编辑它@KJPrice :)看准那之后我做了回答第一个问题。 – epascarello