473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Safari window.location.href

I'm writing a file manager application using Ajax techniques and the
client wants to be able to bookmark file searches. I send the search
request to a remote server using a XMLHttpRequest and then write the
search string to a # URL, either using window.location.href or
window.location.hash. This works fine with no problems in IE and Firefox
and works OK in Safari, except the browser goes into a permanent page
loading state as soon as I write the # URL.

Any ideas on how to cancel this state?
Dec 29 '05 #1
4 13053
Jeff Paffett wrote:
I'm writing a file manager application using Ajax techniques and the
client wants to be able to bookmark file searches. I send the search
request to a remote server using a XMLHttpRequest and then write the
search string to a # URL, either using window.location.href or
window.location.hash. This works fine with no problems in IE and Firefox
and works OK in Safari, except the browser goes into a permanent page
loading state as soon as I write the # URL.

Any ideas on how to cancel this state?


Can you provide a code snippet that shows the behaviour?
--
Rob
Dec 29 '05 #2
RobG wrote:

Jeff Paffett wrote:
I'm writing a file manager application using Ajax techniques and the
client wants to be able to bookmark file searches. I send the search
request to a remote server using a XMLHttpRequest and then write the
search string to a # URL, either using window.location.href or
window.location.hash. This works fine with no problems in IE and
Firefox and works OK in Safari, except the browser goes into a
permanent page loading state as soon as I write the # URL.

Any ideas on how to cancel this state?

Can you provide a code snippet that shows the behaviour?

This shows the behaviour:

<head>
<title>Untitled</title>
<meta name="generator" content="BBEdit 8.2" />
<script type="text/javascript">

function foo() {

window.location.hash = 'test';

}

</script>
</head>
<body>

<a href="#" onClick="foo();">Click here</a>

</body>
Dec 29 '05 #3
Jeff Paffett wrote:
RobG wrote:

Jeff Paffett wrote:
I'm writing a file manager application using Ajax techniques and the
client wants to be able to bookmark file searches. I send the search
request to a remote server using a XMLHttpRequest and then write the
search string to a # URL, either using window.location.href or
window.location.hash. This works fine with no problems in IE and
Firefox and works OK in Safari, except the browser goes into a
permanent page loading state as soon as I write the # URL.

Any ideas on how to cancel this state?


Can you provide a code snippet that shows the behaviour?

This shows the behaviour:

<head>
<title>Untitled</title>
<meta name="generator" content="BBEdit 8.2" />
<script type="text/javascript">

function foo() {

window.location.hash = 'test';

}

</script>
</head>
<body>

<a href="#" onClick="foo();">Click here</a>

</body>


That appears to do nothing in Safari 1.0.3, location.hash is changed,
but then the link is followed so that "http://...#" is shown in the
address bar. Maybe you should use:

<a href="#" onClick="foo(); return false;">Click here</a>
Which changes what is displayed in the # part of the URL in the
address bar.

The permanent page load doesn't happen for me at all, which version of
Safari are you using?
--
Rob
Dec 29 '05 #4
RobG wrote:

Jeff Paffett wrote:
RobG wrote:

Jeff Paffett wrote:

I'm writing a file manager application using Ajax techniques and the
client wants to be able to bookmark file searches. I send the search
request to a remote server using a XMLHttpRequest and then write the
search string to a # URL, either using window.location.href or
window.location.hash. This works fine with no problems in IE and
Firefox and works OK in Safari, except the browser goes into a
permanent page loading state as soon as I write the # URL.

Any ideas on how to cancel this state?
Can you provide a code snippet that shows the behaviour?

This shows the behaviour:

<head>
<title>Untitled</title>
<meta name="generator" content="BBEdit 8.2" />
<script type="text/javascript">

function foo() {

window.location.hash = 'test';
}

</script>
</head>
<body>

<a href="#" onClick="foo();">Click here</a>

</body>

That appears to do nothing in Safari 1.0.3, location.hash is changed,
but then the link is followed so that "http://...#" is shown in the
address bar. Maybe you should use:

<a href="#" onClick="foo(); return false;">Click here</a>
Which changes what is displayed in the # part of the URL in the address
bar.

The permanent page load doesn't happen for me at all, which version of
Safari are you using?

I'm on v 2.0.2.

According to this: http://www.s-seven.net/safari_bug.html#h_value6 your
version won't show the problem.
Dec 29 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Anderson | last post by:
Sorry if this is a rookie mistake... I've been through all the FAQs and the books I have but I can't see the mistake so I guess it's something simple <g> - I'm an occasional JS user. I've got...
3
by: saiho.yuen | last post by:
Hi, Is anyone know what is the difference between Location.href and Window.location.href Thanks you very much:) Saiho
3
by: Christian Hubinger | last post by:
Hi! I'm working on a page that uses javascript very much. My problem is now that i cannot redirect to another page in IE with window.location =<URL>; This command gets executed (proofed with...
8
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript"...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
1
by: OtisUsenet | last post by:
Hi, I have a bookmarklet that works perfectly in Firefox, IE, Konqueror, and Opera, but in Safari 2.0.3 (417.9.2) it doesn't work. I enabled debugging and I can see "TypeError - Undefined...
3
by: mark.middlemist | last post by:
Hi All I've got a wierd and urgent problem I could do with some help for. In our forms system in several places we need to use javascript to redirect to the next frame up (parent), which works...
7
by: Tom | last post by:
I have an oo-type javascript program running perfectly on IE 6.0+, FF 1.5+, and Opera 7+ on Windows 98+, Linux (RH 9, FC 6), and Mac OS X. 4. As usual, the Safari browser is not working correctly,...
5
by: loveshack | last post by:
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem. Firstly, everything i have written...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.