Solved

Safari Javascript issue

Posted on 2010-08-16
3
485 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
html input 8 42
multiple selects 23 48
Can I install Windows on a Chromebook? 3 45
MyWay Virus 9 27
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

840 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