tags:

views:

50

answers:

3

Hi,

I have defined a function in which i want to open a page on a new window. The function has following code:

echo"<script>window.location.href='http://localhost/paymentsystem/views/payment.php?id=".$id."'&lt;/script&gt;" ;  

Right now its opening the page on the same window.

I want to know how can i open this page on a new tab?

Regards,

Pankaj

+2  A: 

Try:

window.open("yourSite.html","plain","width=470,height=452");

instead of window.location.href

Enrique
A: 

You can also use

<a href="http://example.com" target="_blank">Click here</a>

for a simpler solution, although I believe the 'target' attribute will be deprecated soon.

Lotus Notes
A: 

if you prefer to use html to open new window then you have to use below

       <a href="example.html" target="_blank">link text</a> 

and to implement it in javascript you have to try below

echo"window.open('http://localhost/paymentsystem/views/payment.php?id=".$id."')" ;

I hope this will help you..

Thanx.

ravindrakhokharia