open popup in new window

 

Hi, I am using following code to make table and with linmks,and when the link is clicked,file is opened.But now i want file to be opened in a new window.

var tblBodyObj = window.opener.document.getElementById("maintable").tBodies[0];

var newCell=tblBodyObj.rows[0].insertCell(-1);

var doc = window.opener.document;

var link = doc.createElement('a');

link.href = '../UploadedFilesByUser/'+fname[j]+'';var img= doc.createElement('img');

ext[j]= fname[j].slice(-3)

img.setAttribute(
"src",'../images/'+ext[j]+'.PNG');

newCell.appendChild(img);

link.appendChild(doc.createTextNode(fname[j]));

newCell.appendChild(link);

j++;

 

Please help.

thanks

Prachi

0
prachikaushik07
5/5/2009 3:56:39 AM
asp.net.web-forms 93655 articles. 3 followers. Follow

3 Replies
2505 Views

Similar Articles

[PageSpeed] 42

link.setAttribute("target","_blank")

 

 


Plz remember to click "Mark as Answer" if this helped you.
1
Ugly
5/5/2009 4:20:33 AM

Add the Target property and that will open it in a new window:

img.setAttribute("target",'_blank');

Other options are:

_blank - will open a new browser window with no name.
_self - will replace the current html page, so if it is in a frame or frameset it will load within that frame. If it is the full browser, it will open to replace the page in the full browser.
_parent - will replace the html page it came from.
_top - will load in the current browser by replacing anything within the browser such as a frameset


Sincerely,
Malcolm Sheridan
Microsoft Certified Solution Developer
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as
Answer" if a marked post does not actually answer your question.
1
malcolms
5/5/2009 5:04:07 AM

 Try with this:

img.setAttribute("../images/'+ext[j]+'.PNG","_blank");


Ahsan Murshed
__________________________
Please "Mark as Answered" if helpful for you.
ASP BOSS
0
ahsanm
5/5/2009 5:23:28 AM
Reply:

Web resources about - open popup in new window - asp.net.web-forms

Window - Wikipedia, the free encyclopedia
This article is about the part of a building. For the Microsoft operating system, see Microsoft Windows . For other uses, see Window (disambiguation) ...

Microsoft Windows Information, Solutions, Tools - Windows IT Pro
Microsoft Windows information and solutions for IT pros. Topics include cloud computing, Windows Server, Exchange, Outlook, PowerShell, virtualization, ...

The Windows Blog
The Windows Blog is Microsoft's Official Blog for the Windows Operating System.

Microsoft To Only Support New Processors On Windows 10
... support news out of Redmond is particularly surprising. Intel launched it’s 6 th generation Skylake cores back in August, and support on Windows ...

Skylake users given 18 months to upgrade to Windows 10
... die shot. (credit: Intel) If you own a system with an Intel 6th generation Core processor—more memorably known as Skylake—and run Windows 7 ...

Best Windows apps this week
One-hundred and sixty-three in a series. Welcome to this week's overview of the best apps and games released for Windows 8.x and Windows 10 in ...

Why are plane windows round instead of square?
If you've ever traveled by plane, you're likely aware that every airplane window you've ever seen has a round design, whether it be a circle ...

Microsoft has finished rolling out Skype Translator to all Windows users
Microsoft has finished rolling out Skype's much-anticipated real time voice translation service to all of its Windows users, according to a post ...

IDG Contributor Network: Here’s why a jaw-dropping 200 million devices run Microsoft Windows 10
200 million devices are now running Windows 10 all over the world , or almost two-thirds of the entire U.S. population. It’s a bit surprising, ...

Microsoft won't support old Windows versions on new processors
Were you hoping to get a new Windows PC in the office this year without having to move to Windows 10 in the process? You might not have much ...

Resources last updated: 1/17/2016 8:10:05 AM