Right, this is such a pain, I can't believe its not possible!
I am using window.location.href but can't appy a target blank to it! Just self or top...why is that?
Any other options?
window.open ?
Cheers
SBM
Right, this is such a pain, I can't believe its not possible!
I am using window.location.href but can't appy a target blank to it! Just self or top...why is that?
Any other options?
window.open ?
Cheers
SBM
Try:
This will cause Google.com to be loaded in the browser window, clearing any frames if it's inside one.Code:window.parent.location="http://www.google.com"
Just in case ddadmin has missed what I think the question is here, I think what you are looking for is the window.open() method. It is the javascript equivalent to the html anchor tag with the target attribute set to _blank. Here is how it is used to open a basic new window:
window.open('some.htm')
If you can follow this logic, the window.open() part replaces:
target="_blank"
and the 'some.htm' part replaces:
href="some.htm"
If ddadmin got it right, this post will self destruct in 10 seconds.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
thank you both, and thank you mad professor for answering correctly!
![]()
Hi
I have an add on to this post.
I am a newbie at JavaScript.
Can the window.open() method be added to the following line of code so it redirects on the click to a new browser ?
onClick="window.location.href = 'some.htm'"
Thanks
Mark
But one can just as easily:Code:<span onclick="var bob=window.open('','_blank');bob.location='some.htm';">Whatever</span>
Code:<span onclick="window.open('some.htm','_blank');">Whatever</span>
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thats perfect !
Thankyou very much.
Mark
Hi i have a question a bit different that probably touch everything you wrote in this tread.
I need to open a pop up window from a list i generated from a database.
Up to now this is what i was using to see my results from my list.
The problem is i need to make the page appear in a pop-up window.Code:<?php [...] echo ' <tr class="content" onmouseout="this.className=\'content\'" onmouseover="this.className=\'mouseover\'" onclick="location.href=\'add.php?id='.$line['id'].'\'">'; [...] ?>
I need to be able to set the width and height of that window also.
I tried several things but i still didn't found anything that worked since its in a <TR>.
Any tips or help would be greatly appreciated.
Thanks
G78.
Last edited by g78; 04-20-2008 at 03:08 PM.
Try this:
Code:<?php [...] echo ' <tr class="content" onmouseout="this.className=\'contenu\'" onmouseover="this.className=\'mouseover\'" onclick="location.href=\'add.php?id='.$ligne[id].'\'">'; [...] ?>
Jeremy | jfein.net
Erm, are you saying it can't be done?
Its the exact same code.
Heres the full function.
Code:<?php function ShowContent($line) { global $Columns; echo ' <tr class="content" onmouseout="this.className=\'content\'" onmouseover="this.className=\'mouseover\'" onclick="location.href=\'add.php?id='.$line['id'].'\'">'; foreach ($Columns as $col => $title) { if ($line[$col]) { echo '<td>'; echo htmlentities($line[$col]); echo '</td>'; } } echo "</tr>\n"; } ?>
Last edited by g78; 04-20-2008 at 03:09 PM.
Bookmarks