Window.print() function is not working properly in all browser - javascript

When I try to use Window.print() function that works good as I want in Google Chrome but same thing not working good in Mozilla Firefox. Here are some screenshots of the problem which is persisting. What's the problem here? and also how to remove default header and footer from print of Firefox because its works good in chrome
Html View of Report on Web:
View when do Print in Mozilla Firefox

Browsers render differently by default.
So this link might help in custom print CSS styling.
If still some problem persists, post that part of code.

Try adding the following CSS to see if that fixes it.
* {
overflow: visible !important;
}
You may need to experiment with overflow-x instead of overflow and applying to only the print media query.

try using some plugins to export your report into proper format.. ex. PDFMake.js

Related

How to enable javascript debugger in IE9

I've only got options to inspect html and css, the script tab shown in the docs is missing.
There was something wrong with Window's updater, IT ended up re-imaging the entire computer. Unfortunately the specific answer here will remain a mystery.

Unable to scroll IE7 scrollbar

I have a page with lots of scrollable containers in it. All these containers contain some list or so. Everything works perfect in all the browsers except IE7 (Having tested in IE6 and below). In IE7 when I try to scroll by clicking on the scrollbar, its not happening. But if I double click on the scrollbar, then I will get the focus on the scrollbar and I will be able to scroll. The mousewheel scroll works perfectly though.
There are a lot of jquery plugins in my page such as datatable, jquery UI, autosuggest etc.
When I disable script in my browser, the scroll works fine.
Any idea on what is happening? (as an ie7 issue)
An uncaught javascript error may be the cause of your problem. Try using try...catch, e.g.
try {
//any questionable JS code
} catch(err){
alert(err.message);
}
If there is any error, that should let you know.
Without seeing your code I'm only able to guess that your page is throwing a javascript error in ie7. There are a few javascript functions that don't work in ie7 (such as getElementsByClassName which has caught me out before). I'd suggest debugging the javascript in ie developer tools or another debugging tool to find the problem.
It seems like theres an extra click event or something blocking the scrollbar, try using $(...).unbind('click') on those elements.
Some version of IE are temperamental to non-strict syntax, e.g. if you have a missing ; somewhere. An option is to run your code through jslint but this may prove tricky if your code is not well organised.
If you have IE9 you should be able to check for errors by hitting F12, roll back the version to IE7 and monitor the console output.
Trial and error is probably the answer, if all your code is just 1 big block then I'd suggest re-factoring into manageable chunks (classes methods) first.
Good luck.
If we can use a plugin :
http://jscrollpane.kelvinluck.com/
we can easily fix this issue of cross browser scroll pane.

CSS HTML: Text Wraps in Chome: Works fine in Firefox and IE

I have html and css as posted in http://jsfiddle.net/SLs47/ . When I open it in Chrome the title text get wraped (and misaligns) while zoom is increased. However it works fine in Firefox. Please see the following images.
What need to be altered inorder to make it working?
Chrome
Although i couldn't reproduce the error, i think changing #titleinfo 's display property to inline-block from inline should prevent it from wrapping.

Chrome alert/prompt displays off the screen

An alert/prompt called from chrome extension background pake is shown off the screen (or partially in top left screen). This bug has been fixed in canary build by now, see
http://code.google.com/p/chromium/issues/detail?id=113899 , but I need to get it working as soon as possible. Do you have any ideas how to work this around using javascript?
Thanks in advance.
PS: I'm talking about this extension: https://chrome.google.com/webstore/detail/jfiakckbklmccchjegnnojbalafebakb
You can't position the alert or prompt dialogs in browsers. You have to wait for the bug fix to propagate to the stable branch.
An alternative option is to inject an HTML lightbox into the current tab but that would be a lot of additional work.
One way to go is to further investigate the canary source code, found at the Chromium project on Google Code.
The issue is reported on the Chromium issues page, and the fix seem to be found at this revision on the Chromium sources.
You can check out the diff and compile a workaround based on their solution.

Problem with Chrome 12.0.742.100 and empty a/span positioning

For a site i made, http://crystalmurray.com, i have a simple little script to smooth scroll to local anchors and push the anchor to the history like it never happened. Recently my chrome updated to 12.0.742.100 and this stopped working, however, it worked fine in safari and firefox.
The obvious workaround for it is to add content to each empty anchor tag and hide it, whether manually or programmatically.
Heres an example and tester for it http://jsfiddle.net/arzynik/zfmgt/
Both empty a and empty span tags fail to position correctly.
Any other suggestions? Id rather keep editing to a minimum when updating other sites.
Your test seems to work in Chrome 14.0.794.0 (canary). The problem is probably already solved in a future version. You can wait Or file a bug report.
I encountered this same issue recently. My workaround for Chrome 12 was to set position: relative for any empty anchor tags I had. The following should fix you up:
a:empty {
position:relative;
}

Categories