草庐IT

mywindow

全部标签

javascript - 谷歌浏览器打印预览第一次不加载页面

我正在尝试使用此代码打印页面functionPopup(){varmywindow=window.open('','Ticketinfo','height=400,width=600');mywindow.document.write('mydiv');mywindow.document.write('*{margin:0;padding:0;}body{padding:3px;padding-left:20px;font:6pxboldArial;}');mywindow.document.write('');mywindow.document.write('');mywindow.

javascript - Window.print 在 IE 中不起作用

我必须按以下方式打印出一个div:functionPrintElem(elem){Popup(elem.html());}functionPopup(data){varmywindow=window.open('','toprint','height=600,width=800');mywindow.document.write('');mywindow.document.write('');mywindow.document.write('');mywindow.document.write(data);mywindow.document.write('');mywindow.pri

user-interface - 从一组代码同时打开 2 个相同的窗口

我正在使用以下代码创建并显示一个窗口,其中包含GUI组件作为标签、条目和按钮://modifiedfrom:https://github.com/andlabs/ui/wiki/Getting-Startedpackagemainimport("github.com/andlabs/ui")funcmakewinfn(){varname=ui.NewEntry()varbutton=ui.NewButton("Greet")vargreeting=ui.NewLabel("")box:=ui.NewVerticalBox()box.Append(ui.NewLabel("Enteryo

javascript - 使用 css 打印 div 内容

我正在做一个元素,我想打印div内容。我使用的代码满足了我的要求,但我得到的是简单的输出,没有应用Css,也没有得到图像。请帮助我。我附上了我得到的代码和输出以及我想要的输出。代码:functionPrintElem(elem){Popup($(elem).html());}functionPopup(data){varmywindow=window.open('','newdiv','height=400,width=600');mywindow.document.write('');mywindow.document.write('');mywindow.document.writ

javascript - 在 IE9 上,Win 7 window.open() 返回 null 而不是打开窗口的引用

我正在尝试类似下面的操作,varmyWindow=null;if(!myWindow||myWindow.closed){myWindow=window.open(url,windowId);}else{myWindow.focus();}所有浏览器都返回window.open()的窗口引用,但IE9返回NULL。是否有人有更多关于返回null的原因或IE9的解决方法的信息? 最佳答案 window.open如果在Internet选项->安全->此区域的安全级别下选中启用保护模式,则返回NULL引用对象>并且ZONE不同,即在我的例

javascript - html2canvas - 错误 - 对象 HTMLCanvasElement

我需要使用javascript打印div..这个div的内容是生成的条形码..使用打印div元素的正常方法不起作用,因为条形码图像是由php文件生成的,不会出现在打印页面中。所以我决定使用html2canvas方法来“渲染”div然后打印出来..这是我的代码:HTML:SomecontentandimgofbarcodeJavaScript:functioncapture(){html2canvas([document.getElementById('source')],{onrendered:function(canvas){varmywindow=window.open('','m

c++ - 为什么我的编辑控件在不使用 MFC 的 win32 c++ 应用程序中看起来很奇怪?

我有这个程序,我在其中创建了一个窗口,并在其中使用普通C(没有MFC或对话框)添加了一个编辑控件,编辑控件创建代码如下hWnd=::CreateWindowExA(NULL,//noextendedstyle"EDIT",NULL,//notitleWS_CHILD|WS_VISIBLE|WS_BORDER,x,y,Width,Height,hWndParent,(HMENU)id,(HINSTANCE)GetWindowLong(hWndParent,GWL_HINSTANCE),//themoduleinstanceNULL);但是渲染出来的控件看起来很难看...这就是我希望我的控

iOS触摸坐标系

locationInView:Returnsthecurrentlocationofthereceiverinthecoordinatesystemofthegivenview.ThismethodreturnsthecurrentlocationofaUITouchobjectinthecoordinatesystemofthespecifiedview.Becausethetouchobjectmighthavebeenforwardedtoaviewfromanotherview,thismethodperformsanynecessaryconversionofthetouch

javascript - 在打印 html 内容中添加外部样式表引用后打印预览为空白

我想打印页面的DIV内容。我所做的是使用JS检索div的内容并将其传递给我调用.print()的新窗口对象。文本内容和图像按原样显示。就在我将此行添加到检索到的div内容时打印预览为空白。我也尝试添加其他样式表,结果相同。无论我添加什么样式表引用来打印html内容,相同的结果-空白预览页面。这是我的JS代码来打印页面内容。varprintDivCSS=newString('');functionPopup(htmldata){varmywindow=window.open('test','eChallanReceipt','height=800,width=800,top=20;lef

javascript - 在打印 html 内容中添加外部样式表引用后打印预览为空白

我想打印页面的DIV内容。我所做的是使用JS检索div的内容并将其传递给我调用.print()的新窗口对象。文本内容和图像按原样显示。就在我将此行添加到检索到的div内容时打印预览为空白。我也尝试添加其他样式表,结果相同。无论我添加什么样式表引用来打印html内容,相同的结果-空白预览页面。这是我的JS代码来打印页面内容。varprintDivCSS=newString('');functionPopup(htmldata){varmywindow=window.open('test','eChallanReceipt','height=800,width=800,top=20;lef
12