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
Old 11-25-2009, 12:52 AM window.open
Junior Talker

Posts: 3
Name: yogesh kapil
Trades: 0
hi all,

please help me i am using the below code to open my pdf file when user click the link given.

now i am facing some problem when i run my code in safari browser,

its open my pdf file but another window also get open .



function showDialogWindow(pdfName)
{
var left=(screen.width-800)/2;
var top=(screen.height-600)/2;

window.open(pdfName, "", "ststusbar=no;toolbar=1; resizable=1; width=800; height=600; top=" + top + "; left=" + left + ";");
}
yogesh kapil is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-25-2009, 03:26 AM Re: window.open
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use href="#" or add return false; to the onclick event
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2009, 02:21 AM Re: window.open
Junior Talker

Posts: 3
Name: yogesh kapil
Trades: 0
hello,

thanks for your reply:----------

i already used href as you said, in my code, its not working please see the below code and when i used in href with on click event then error occur.

please suggest me the correct position of href or reture false .


<p><a onmouseover="this.style.color='#ffffff';" onmouseout="this.style.color='#999999';" href="#" onclick="showDialogWindow('LK1-NN.pdf');">UNAUDITED FINANCIAL RESULTS ( PROVISIONAL ) FOR THE QUARTER ENDED 30TH JUNE, 2009.</a>&nbsp;<img src="image/pdf_pho.png" /></img></p>
yogesh kapil is offline
Reply With Quote
View Public Profile
 
Old 11-26-2009, 05:12 AM Re: window.open
Super Talker

Posts: 139
Name: John Davis
Trades: 0
1. </img> - not required, this is misstake
2. Right case:
Code:
<a onmouseover="this.style.color='#ffffff';" onmouseout="this.style.color='#999999';" href="http://www.eny_url_you_wish.com" onclick="showDialogWindow('LK1-NN.pdf'); return false;">UNAUDITED FINANCIAL RESULTS ( PROVISIONAL ) FOR THE QUARTER ENDED 30TH JUNE, 2009.</a>
You've saide about error occur. Can you provide error text?
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Old 11-26-2009, 06:23 AM Re: window.open
Junior Talker

Posts: 3
Name: yogesh kapil
Trades: 0
dear all now i am giving you snap shoot so that u can understand my problem

when user click this below link in safari browser

UNAUDITED FINANCIAL RESULTS ( PROVISIONAL ) FOR THE QUARTER ENDED 30TH SEPTEMBER, 2009.


then this untitled window get open with the file downlaod-security window.(please scroll down to see the image)

when user click the open button then my pdf file get open in new window.

now in my web page have two window one is untilteld and another one the window is in which pdf is opened.

i want only one window with my pdf.

one more thing i want to say the code work very fine in other browser.

please help it is very urgent.



[IMG]file:///C:/Documents%20and%20Settings/user/Desktop/problem/Untitled-1.jpg[/IMG]
yogesh kapil is offline
Reply With Quote
View Public Profile
 
Old 11-26-2009, 06:32 AM Re: window.open
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
We cannot test anything that is ON YOUR MACHINE
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to window.open
 

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.23632 seconds with 12 queries