Solved

Safari Javascript issue

Posted on 2010-08-16
3
480 Views
Last Modified: 2013-12-07
Hi experts,

The following code works fine with other browsers but Safari

<input type="button" value="Cancel" OnClick="window.navigate('cohindex.php');" >

(OnClick="window.open('cohindex.php');"  works but it opens a new window which is not what i want)

Your help is highly appreciated.
Kind regards
0
Comment
Question by:Corona880
3 Comments
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 63 total points
ID: 33452151
Use window.location.href = 'cohindex.php';
0
 
LVL 7

Assisted Solution

by:jhp333
jhp333 earned 62 total points
ID: 33452163
window.open('cohindex.php', '_self')
will load the new page on the current window.

or you can also do:
window.location.href='cohindex.php';
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33452182
using an anchor tag would have simplified a lot
<a href='cohindex.php'>

but i guess since it is a php (a server side) script, you need to submit to it rather than just navigate to it.

<input type="button" value="Cancel" OnClick="cancel()" >

function cancel()
{
   document.forms[0].action = "cohindex.php";
   document.forms[0].submit();
}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now