Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onClick Redirect problem

Status
Not open for further replies.

DarkConsultant

Programmer
Dec 4, 2007
156
GB
Hi everyone,

I am using an onClick event to redirect to a new page but cannot achieve this ...

My code is
<a href='page1.php' onClick="return redirect (' >Click Here</a>

It works fine.

The problem is I wanted to open the bbc link in a new tab but when when I change the link to (' target='_blank') I get redirected to page1.php.

I have tried every way I can to add the target='blank' but all ways seem to stop it working.

Any help would be greatly appreciated.

TIA

David

DarkConsultant

Live long and prosper \\//
 
Additional ...

Sorry my redirect function is

<script language="javascript" type="text/javascript">
function redirect(URL)
{
document.location=URL;
return false;
}
</script>

DarkConsultant

Live long and prosper \\//
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top