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 6228519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:24:13+00:00 2026-05-24T09:24:13+00:00

OK, I looked a lot for this on the web but cannot find an

  • 0

OK, I looked a lot for this on the web but cannot find an answer.

I can expect CSS differences between browsers but there are JavaScript differences too?

So why this works in IE8:

window.print(); // works

but when I pass window.print to a function and call it, it don’t work in IE8 (works in IE9):

function callIt(f){
    f.call();
};



callIt(window.print);

Is it a known issue?


EDIT

OK it does not work means it will simply ignore it, no javascript error or anything.

Sorry it gives this error:

   Object doesn't support this property or method

EDIT 2

I need to use call or apply since I need to pass the context. I am trying to create a class which I can pass functions and it can call it with the possibility of passing context or arguments. Do not tell me to use f() that is not an answer since it does not fix my problem. The question is on call and apply.

  • 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-24T09:24:14+00:00Added an answer on May 24, 2026 at 9:24 am
        function callIt(f) {
            if (f) f();
        }
    
        callIt(window.print);
    

    Done, no?


    Update

    per the poster’s request that I answer the question, not recommend a solution that works, here she goes:

    If you view typeof(window.print) in IE, you’ll see that it reports itself as type object. Type object has no apply or call method. In my opinion, your design is wrong for the task. HOWEVER, if what you want is a rabbit hole to follow, here’s the top:

    var p = window.print;
    window.print = function() { p(); }
    
    function callIt(f){
         f.call();
    }
    
    callIt(window.print);
    

    I have no idea what will happen in any other browser or how many procedural exceptions you’ll have to make to account for it everywhere you’ll need to.

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

Sidebar

Related Questions

I looked all around SOF but no luck to find me answer. It is
I have looked for the answer to this on Google and stackoverflow, but unfortunately
This is a two-fer, and I've looked in a lot of places and could
I looked around and found that there is an onerror function for flexigrid but
I know there are a lot of questions out there about this - believe
I've looked around a lot (trust me :) before posting this questions and I'm
I have looked at a lot of answers but have not found a satisfactory
I've looked at a lot of questions on SO and google regarding sub-class mappings
I'm basically brand new to LINQ. I've looked around a lot on here and
I looked at this example http://msdn.microsoft.com/en-us/library/bb399420.aspx and clicked on DataContext.CreateDatabase which brought me to

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.