473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 13073
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
8813
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 some code (in an external JS file) attached to a number of links off a query result page. The code it checks if there are any ticked items on the...
3
50393
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
22986
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 alert messages) but nothing happens. FF acts like expected but i cant get it work in IE. What can be the problem here? here the code i use:
8
2479
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" type="text/javascript"> <!-- ; var newwindow = ''
18
3320
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 the image. The desired behavior is that when the pop-up is invoked, I want the underlying window to stay put. I don't have this problem when I...
1
5898
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 value" reported in the Javascript console, but I'm not sure where the error is. The bookmarklet in question is here: javascript:if...
3
10931
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 fine with every browser on the planet, except safari (1 definately, don't know about 2). I've incuded an example that doesn't work below. Any...
7
2534
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, and because it lacks an internal debugger, I'm completely unable to see what the problem is. So I downloaded that "Drosera" debugging program,...
5
2681
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 works fine in IE7 and beta IE8. My pages do not work however in Safari or Firefox, and please dont beat me, but i use Frontpage to write my site, and i...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8202
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.