Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
EXEC command not running !
Old 08-15-2011, 04:33 AM EXEC command not running !
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
HI,
i've written a php app that will generate a table on page.

So basically, i want to make users able to take print of this page.
I've written javascript that'll do the job.
here's the code -
HTML Code:
<script type="text/javascript">
function print(){
		opt="";
			document.execCommand("print","",opt);
		}
</script>
and html -
PHP Code:
echo '<button onclick="print()">Print</button>'
this runs very well on chrome and IE.
But i can't run it on firefox. i'm using FF 5.

I know javascript behavior varies with browsers. So there are compatibility issues. Does anyone know how to solve this or link might be helpful.
__________________
Make everything as simple as possible, but not simpler. — Albert Einstein

Please login or register to view this content. Registration is FREE
phazorRise is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-15-2011, 05:15 AM Re: EXEC command not running !
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Just use:
Code:
<form>
<input type="button" value="Print this page"onClick="window.print()">
</form>
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 08-15-2011, 05:39 AM Re: EXEC command not running !
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
it's not working on FF and Opera. :/
__________________
Make everything as simple as possible, but not simpler. — Albert Einstein

Please login or register to view this content. Registration is FREE
phazorRise is offline
Reply With Quote
View Public Profile
 
Old 08-16-2011, 04:31 AM Re: EXEC command not running !
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
http://www.javascriptkit.com/howto/newtech2.shtml
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to EXEC command not running !
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29343 seconds with 12 queries