Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by maja88g

  1. I have resolved this issue by using an image with a lower resolution.
  2. Hi all, I have a iframe that is populated with customer information dynamically from the javascript. The focus is then set to the iframe and an option to print the iframe is displayed. The information loads perfectly in the iframe but does not print the contents of the iframe, instead it prints the contents of the page that is displaying the iframe. As soon as I remove the image from the document.write then the the contents of the iframe are printed out perfectly. Any ideas what I could be doing wrong? Here is my html code: <iframe id="ifmsselectedorderprint" style="display:block; height: 1px; width: 1px; position: absolute"></iframe> Here is my js code: var pri = document.getElementById("ifmsselectedorderprint").contentWindow;pri.document.open();pri.document.write("<table width='800'><tr align='center'><td><img src='orderprint.bmp'></br></br></td></tr></table><label>_________________________________________________________________________________________________________________________</label><h1><font face='tahoma'><center>Cashbuild: Tembi-Mall Community Store Order Print</center></font></h1><label>_________________________________________________________________________________________________________________________</label><h2><font face='tahoma'><center>Order Details</center></font></h2>");pri.document.write("</br><table border='0'><tr><th><font face='tahoma' size='4'>Order No.</font></th><th width='10'></th><th><font face='tahoma' size='4'>SAP No.</font></th><th width='10'></th><th><font face='tahoma' size='4'>Sub Total</font></th><th width='10'></th><th><font face='tahoma' size='4'>Vat</font></th><th width='10'></th><th><font face='tahoma' size='4'>Rounding</font></th><th width='10'></th><th><font face='tahoma' size='4'>Grand Total</font></th></tr><tr><td><font face='tahoma'>"+orderno+"</font></td><td width='10'></td><td><font face='tahoma'>"+sapno+"</font></td><td width='10'></td><td><font face='tahoma'>"+subtotal+"</font></td><td width='10'></td><td><font face='tahoma'>"+vat+"</font></td><td width='10'></td><td><font face='tahoma'>"+rounding+"</font></td><td width='10'></td><td><font face='tahoma'>"+grandtotal+"</font></td></tr></table></br><label>_________________________________________________________________________________________________________________________</label></br>"); pri.document.close();pri.focus();pri.print(); Without the following code: <table width='800'><tr align='center'><td><img src='orderprint.bmp'></br></br></td></tr></table> It works perfectly. I would also like to stress that in both cases the iframe loaded correctly. Thanks for all the help.
  3. Hi all, I am creating a calculator using images I have created, and am using the onmousedown and onmouseup eventsin html, to simulate 'clicking a button'. This works fine if I press the image at a moderate pace, but if i press the imagemore then once quite fast or if I double click then the image completely disappears. I have tried a number of things to fix this issue incl: timeout, sleep //written function that loops through time, calling a blankon double click, calling the mouse up from the mouse down function instead... but none of this seems to prevent the imagefrom disappearing if it has been double clicked of clicked at a fast pace. The image size is 1.37kb. Any ideas on what I am doing wrong or how I can fix this issue? Here is my html code: <td><image src="../images/keyboardnumbut7.gif" id="button15" onmousedown="mouseDown(this.id, this.src)" onmouseup="mouseUp(this.id, this.src)" onClick="numkeypressed('7')"></td> This is my javascript code: function mouseDown(id, src){var mySplitResultSrc;var mySplitResultImg; mySplitResultSrc = src.split("/");var msrs8 = mySplitResultSrc[8]; mySplitResultImg = msrs8.split(".");var imgname = mySplitResultImg[0];var imgext = mySplitResultImg[1]; document.getElementById(id).src = "../images/"+imgname+"me."+imgext;} function mouseUp(id, src){var mySplitResultSrc;var mySplitResultImg; mySplitResultSrc = src.split("/");var msrs8 = mySplitResultSrc[8]; mySplitResultImg = msrs8.split(".");var fullimgname = mySplitResultImg[0];var imgext = mySplitResultImg[1];var endpos = fullimgname.length - 2;var imgname = fullimgname.substring(0,endpos); document.getElementById(id).src = "../images/"+imgname+"."+imgext;}
  4. Hi all, I am trying to print ALL the content of a scrolling table without usingiframes, opening a new window or hiding all the other elements on my screen. It it possible to send a command that will only print a specific element based onthe id without having to change screen displays? <!--Html table code I need to print, table is dynamically populated from javascript so the length constantly varies.--> <!--some code--><div id="printme"><table border="1" width="598" id="ccblanktableheader"> <tr bgcolor="#E4E5E5"> <th width="15%"><font face="tahoma" color="rgb(6,79,168)">Date</font></th> <th width="20%"><font face="tahoma" color="rgb(6,79,168)">Customer No.</font></th> <th width="23%"><font face="tahoma" color="rgb(6,79,168)">Complaint No.</font></th> <th width="12%"><font face="tahoma" color="rgb(6,79,168)">Status</font></th> <th width="23%"><font face="tahoma" color="rgb(6,79,168)">Type</font></th> <th width="7%"><font face="tahoma" color="rgb(6,79,168)">View</font></th> </tr> </table> <div style="font-size: 12px; face:tahoma; height: 315px; overflow:auto;border:1 "> <table border="1" width="593" id="ccblanktable" align="center"> <tr bgcolor="#E4E5E5"> <th width="15%"></th> <th width="20%"></th> <th width="23%"></th> <th width="12%"></th> <th width="23%"></th> <th width="7%"></th> </tr> </table> </div></div><!--more code--> I have tried multiple javascripts but none work without either opening a new window or changing displays.This was my most recent test. var content_innerhtml = document.getElementById("ccblanktable").innerHTML; var document_print=window.open("","",display_setting); //Opens new windowdocument_print.document.open(); document_print.document.write('<html><head><title>print using javascript</title></head>'); document_print.document.write('<body style="font-family:verdana; font-size:12px;" onLoad="self.print();self.close();" >'); document_print.document.write(content_innerhtml); document_print.document.write('</body></html>'); //does not show as a table, rather a a single rowdocument_print.print(); document_print.document.close(); Any ideas how I can do this?Thanks.
  5. Okay, but i'm still confused. The structure I showed is the way it is working, it goes to into the sound folder and plays the clip. I need it to go back and play the clip?
  6. Sorry I didn't realize that spaces are ignored, hope it makes better sense now? No the backslash is correct, one has a ../(back) and the other ./(forward)
  7. So I got the above to work if I put the directory forward, then is works. ie - ./sound/bank_ directory structure when it doesn't work:c:----test folder---------html folder-------------------soundtest.html---------sound folder------------------bank_1.mp3------------------bank_2.mp3directory structure when it does work:c:----test folder---------html folder--------------soundtest.html--------------sound folder----------------------bank_1.mp3----------------------bank_2.mp3Any ideas as to why it works with directory forward but not back?Thanks
  8. Hi All,I am trying to get a sound file to play when a user clicks on an image, this only has to work in IE, and windows media player should be the only thing used.(Company std)The following is a short version of my code, it works fine when played with other player, but when I try WMP - even tho the player appears it does not autoplay and the play button does not work. Any idea's? <script language="JavaScript" type="text/JavaScript"> function playSound(soundfile) { soundfile=soundfile+"1"+".mp3"; alert("here:" + soundfile); document.getElementById("sound").innerHTML= "<embed src=\""+soundfile+"\" hidden=\"false\" autostart=\"true\" loop=\"false\" />"; //image_name = "../images/Text Personal Information_"+loglang+".gif"; }</script><html> <headind>SoundTest</heading> <center> <h1>Kiosk Sound Test</h1> </center> <body bgcolor="steelblue"> <center> <span id="sound"></span> <img src="../images/speakerPhoneIcon.jpg" id="butSound" height="50" width="50" onclick="playSound('../sound/bank_')"/> </center> <br> <!--<object type="audio/x-wav" data="../sound/bank_1.wav" width="200" height="45"> <param name="src" value="../sound/bank_1.wav"> <param name="autoplay" value="false"> <param name="autoStart" value="0"> alt : <a href="../sound/bank_1.wav">bank_1.wav</a> </object>--> <form method="get"action=""> </form> </body><html/> I have also tried object but I get the same problem, the player displays but doesn't autostart and the play button doesn't work.Thanks
  • Create New...