Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6336251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:01:06+00:00 2026-05-24T19:01:06+00:00

This are the functions I got to -thanks to the search option in stackoverflow

  • 0

This are the functions I got to -thanks to the search option in stackoverflow and some modifications of mine-

<script type="text/javascript">

    function imprimirElemento(elem)
    {
        abrirElemento($(elem).html());
    }

    function abrirElemento(data) 
    {
        var style = '<style type="text/css">.titulosLightBox {border-bottom: 1px dotted #D1D1D1;color: #333333;font-size: 20px;font-weight: normal;line-height: 18px;margin-bottom: 15px;padding-bottom: 10px;}'+'strong{width:100%;font-weight:bold;}'+'</style>'; 

        var termsAndConditions = window.open('', 'tos', 'height=400,width=600');

        termsAndConditions.document.write('<html><head><title>Politica de Privacidad</title>');
        termsAndConditions.document.write(style);
        termsAndConditions.document.write('</head><body >');
        termsAndConditions.document.write(data);
        termsAndConditions.document.write('</body></html>');
        termsAndConditions.document.close();
        termsAndConditions.print();
        termsAndConditions.document.close(); /*This seems not to work*/
        return true;
    }

</script>

It works great, the window it’s opened; the file is getting printed with styles and everything but the window its not closed,

any idea why?

thanks a lot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:01:06+00:00Added an answer on May 24, 2026 at 7:01 pm

    The last line is wrong, because you have already closed the document object. Try termsAndConditions.close()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an object with functions that throw errors, myObj = { ini:function(){ this.f();
I've got a JavaScript object, built this way: function foo() { this.length = 0;
I've got some problem with my function and don't know how to solve this
I have a script called notify_me.php which I run like so: script type=text/javascript> //Run
In the end, I got this function. I don't know whether it's normal or
I've got a simple function like this: function CreateFileLink() { global $Username; return date(d-m-y-g-i);
I've got a .js file that has this function in it: function showDialog(divID) {
I've got this simple function which displays a message to the user. If I
Code is not running on .click when I have this: $(.cancel).click(function() { alert(got here);
I've got a function inside of a class that returns a string. Inside this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.