By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

Safari window.location.href

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.