Javascript Help

Posted on 2012-08-16
Last Modified: 2012-08-20
I am trying to Print the contents of the textarea and in all browsers except IE8.0.6001, it works fine

<script language="javascript">
function printerfriendly() {
  childWin = open("", "childWin", "location=yes, menubar=yes, toolbar=yes, scrollbars=yes");
  var text = document.printfrm.editDetails.value;

what happens is when i click the-print button, it banks empty page and below shows the image is being downloaded, it keeps waiting unless and until i press the refresh[f5] and then it appears OK,

other browsers, it works fine

can anyone guide why this stupid IE behavior
Question by:myselfrandhawa
    LVL 38

    Expert Comment

    by:Tom Beck
    I would try a different syntax on this line:

    var text = document.printfrm.editDetails.value;


    var text = document.forms[0].editDetails.value;


    var text = document.getElementById("editDetails").value;
    LVL 49

    Accepted Solution

    Try replacing:

    Open in new window


    Open in new window

    LVL 15

    Author Closing Comment

    Can you explain it Please why it worked this way

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now