Notice Change Of Window.location.hash Without Polling

Nov 29, 2005

Is it possible to notice a change of window.location.hash without
polling?

I'm working on a Ajax-platform (yes, inventing the wheel again) and
have finished almost everything except the support for
back/forward-buttons. The track I'm working on is "hidden frames" to
keep state in window.location.hash. I've seen some solutions along this
way that includes polling window.location for a change... which doesn't
comply with my otherwise strict event-driven design...

View 2 Replies


ADVERTISEMENT

Detection Change Of Location.hash

Aug 18, 2005

A page I have shows a different background colour depending on the
hash portion of the url as it is first loaded. For example a link to
mysite/mypage#0000FF would result in a page with a blue background. But
another link, this one to mysite/mypage#FF0000, would not give me a red
background if directed to the window where mypage#0000FF was loaded
just one moment ago. This is normally to be expected, because the browser
thinks same page, no load event, basta.

If I use the search portion, for obvious reasons, that is treated a new page
load, even when it is from the cache, but I need the hash here. So how do I
detect in mypage the moment when the hash string is changed by a user click
event on another page in another window, perhaps even from another domain?

View 7 Replies View Related

Refresh Php Can't See What Was Appended With The Window.location.hash

Aug 24, 2011

To make a long story short when I do a redirect like this...

Code:
if(window.location.hash.length > 0){
window.location = "http://" + "<?php echo $_SERVER['HTTP_HOST']; ?>" + "/" + window.location.hash;
}

it goes there, but on the refresh php can't see what was appeneded with the window.location.hash, so its like I'm going to

[Code]...

View 3 Replies View Related

Change Location.hash (1) Without History Entry And (2) Without Scrolling The Page

Mar 13, 2009

I'm attempting to implement some deep-linking in my simple AJAX application by setting location.hash, and I've run into two problems:

1) Sometimes setting location.hash seems to send the window on both IE and FF to scroll to the top of the page. I do not want any scrolling to occur. The location.hash change happens in a function which is triggered in an onclick event.

2) Changing location.hash creates a history entry on FF (not on IE)... that's pretty cool for FF, but in this case I do not want a history entry created. How can this be avoided?

I found an example which seems to have avoided both these problems, but cannot decipher the pertinent code: [URL]

View 6 Replies View Related

Location.hash

Jul 23, 2005

Here is my relevant code for an arbitrary page (let's call it PAGE_B):
<body onload="window.location.hash='anchor'">

With this code, if the user goes from PAGE_A to PAGE_B, he will jump to
PAGE_B#anchor after PAGE_B has fully loaded. BUT... if he clicks the
back button, instead of returning to PAGE_A (which is what I want), he
will return to PAGE_B (without the anchor).

Is there any way to change this behavior... perhaps to replace the
anchor of page without touching the history stack?

View 1 Replies View Related

Location.hash Does Not Work Without SetTimeout

Jul 23, 2007

Basically, my problem is exactly as described in the subject. The
problem is somewhat intermittent and unpredictable, but the majority
of the time if I just have a statement such as

window.onload=location.hash('somewhere');

the URL is indeed appended, i.e. www.example.com/index.php#somewhere,
but window itself doesn't actually move to the bookmark. However, if
I do something like

window.onload=setTimeout("location.hash('somewhere')",0)

it works fine. On very large pages, the timeout actually has to be a
second or two. Any idea why this is happening? I don't know much
about JS, but my thought is that it's trying to move to that bookmark
before it has actually been loaded in the page; the timeout forces it
to wait for the rest of the page to load before going to the bookmark.

View 2 Replies View Related

JQuery :: Hash Location But Different Files?

Sep 25, 2011

I am trying to make sense of the location hash etc. However, I have a few issues that I need to overcome in the process.I have 3 tabs, which need to create a hash and then allow return to that tab on page reload.This is what I need doing: firstly, I need to check the filename accessed and if it is the correct filename (say 'testing.php' or 'testing') then I need to check the GET parameters to see which ones have been called and exist, THEN I need to check the hash to see which tab to load.

View 4 Replies View Related

Location.hash Not Changing History In Ie6?

Oct 10, 2008

I have a problem with IE and location.hash. If I change the hash, the history doesn't "update" and it only keeps one record of the URL. This whole website is AJAX-driven and I need the user to be able to use the forward and back buttons in the browser. Everything works fine and dandy, tested on all the major browsers on PC and Mac, except for IE (both 6 and 7).

In case I wasn't clear, here's a way to reproduce in IE6/7:

Go to google.com
Go to yahoo.com#one
Go to yahoo.com#two
Click back. You'll be back to google.com instead of yahoo.com#one

View 5 Replies View Related

Setting The Hash Location Of A Web Page With The Onkeyup() Event

Aug 10, 2010

What I want is a textbox that the user can enter information into. When they press a key the onkeyup event will simulate a function. All that I can do. The function needs to automatically scroll down the page to the anchor that corresponds to the number the user entered. The web page is a factor finding program. You can enter 2 numbers and it finds all the factors of all the numbers between the 2 you entered. Here is the link: [URL] As you can see, when you try to find factors of numbers a new window opens and there is a search box in the top left. Unfortunately, it doesn't work. If you want to check out the code look at the web page but here is the bit that creates the new window

[Code]....

View 6 Replies View Related

Change Window.location Value Without Loading Page?

Jul 23, 2005

I have a site with dynamic pages, where content is fetched via
a hidden iframe client/server. I'd like to be able to allow
people to bookmark the 'state' of the page, by generating a
URL depending on current content. That URL would ideally be
visible on the location field of the browser, and bookmarkable.

Any idears?

View 1 Replies View Related

JQuery :: $.url() Function - Being Utilized For Parsing Out The Window.location Or Window.location.search Parameters

Feb 14, 2010

Danged if I can find the thread, but I swear I saw a $.url() reference in here a day or two ago. It was beingutilized for parsing out the window.location or window.location.search parameters. I made a mental note because that was something I would be needing to do.

Now I can't find it, either because the search isn't finding it or I was dreaming about this function existing.

I rummaged about the API docs and didn't find it there either. Is it something provided by one of the plugins and not a function native to jQuery?

View 3 Replies View Related

Changing Document.location.hash In IE7 Overrides Event.stop(e) And Submits Form

Jul 7, 2009

I am writing a modification to Invision Power Board that makes replying to post via Ajax.

The "Submit" button is being overrun by Prototype's observe function. When the custom function is executed, I run Event.stop(e) to prevent the actual form from being submitted and reload the page.

I have developed and tested on Safari but users began to report bugs in IE, after investigation I discovered that the line

Code:

Is making IE execute all the code after it, and then execute its own onclick() function as if Event.stop(e) was not there. Commenting this line fixes the problem, the page is not reloaded, but this line is vital to the code.

So why do I need to set the anchor? To support the back button function after a user makes an ajax reply, pressing Back should hide the new content, and pressing Forward should make it visible. (e.g. every time the anchor is changed) This all works nicely. But not in IE.

This only happens the first time the page is visited ever, or clearing cache and visiting it again. Reloading the page fixes the problem but this is not normal behavior and users shouldn't have to reload to use the Ajax fast reply...

View 4 Replies View Related

Cleaning Up The "hash" Part Of The Location

Dec 30, 2005

I don't like the way that a link to page top leaves the location bar with something like '#top' appended to it.

So, I'm hooking a listener to the link click event, doing a window.scroll and stopping default action. This is fine as long as the location doesn't already have a hash portion. When it does, I'd like to clean that up without causing a page reload or any server requests.

Is this possible? The closest I got with MSIE is to remove the tail end, but I can't get rid of the actual '#'.

View 6 Replies View Related

Hash Change On Forum

May 9, 2011

I need to change the way a form on my page works. As currently when you enter in the form information and hit send, you get sent to another page that loads up for testing purposes a basic 'message sent' message. I want the HTML page to load within the ID#Contact which is stylized with a width and a height. I've been directed to the following procedure but I don't know how to make it come together.

jQuery.post() jQuery API
.load() jQuery API
.ready() jQuery API

View 24 Replies View Related

"#" Prefix For Location.hash?

Jul 20, 2005

Does anyone know if there are any browsers where you must specify "#"
as a prefix when setting the hash for the location?

For example, the following would move to the intro section of the
document:

window.location.hash = "#intro";

But in the same browser, this would not work:

window.location.hash = "intro";

So far, in the browsers I've tested, the "#" seems to be optional. If
this behaviour is compliant, any references, on-line or otherwise,
would be welcome.

View 1 Replies View Related

JQuery :: Change Values Returned By JSON Hash?

Sep 1, 2010

All of the following works fine - except when I put in the switch() to adjust a value returned

$.getJSON( urlCalled, parametersUsed, function(dataReturned)
{
pj= dataReturned;

[code]....

View 2 Replies View Related

Trouble Retrieving Window Location From A Previously Opened Window ?

Dec 24, 2005

I am trying to open up a new window and then get the current url/location
back from the (win_1) window and display the url in an alert box.

Here is the code I am using :-

<script type="text/javascript">
var mywin_1 = open ("http://www.anysite.com/index.htm", "win_1",
"height=640, width=820, left=200, top=0, scrollbars, status, location");
var temp = mywin_1.location;
alert (temp);
</script>

Where am I going wrong?

View 2 Replies View Related

Window.opener.location - Set The Parent Window(main Browser)

Nov 13, 2011

I'm using window.showModalDialog but having an issue trying to set the parent window(main browser). I open modal window A which is then opens modal window B, top of modal window B onload I do window.opener.close()". My issue now is when i'm finished with B I set parent window(main browser) to a new url with window.opener.location. So my problem is modal window A the parent has been closed so window.opener.location will not work.

View 3 Replies View Related

JQuery :: Add To Complete The Long Polling Effect

Jan 4, 2011

I am workong on a long polling chat for my site by finding examples on the net and i am using this particular one i found, but am slightly confused as to what i need to add to complete the long polling effect. Currently it loops infinetly isntead of waiting for the server to push a message so its obviously not working.

[Code]...

View 1 Replies View Related

How Do I Change The Text In The Url/location Bar?

Nov 10, 2006

This text can only be altered by changing the URL of the page.
The normal solution is to use frames, though this can introduce
problems of its own...

View 5 Replies View Related

JQuery :: Using Click() To Change Location?

Aug 5, 2011

I want to use the click() function to implement the javascript:

onclick="window.location.href='newpage.php'"

But I'm not sure what to put for the function:

$('.target').click(function() {
?
});

View 2 Replies View Related

Window.location.href

Jul 23, 2005

<script language="javascript">
function ConfirmPage() {
window.location.href="http://ConfirmationPage.htm";
return false;
}
</script>

How can I use this script to display a page in my current directory? It woriks fine when using a domain such as yahoo.com or google.com.

View 3 Replies View Related

Window Location In An IFRAME

Jul 23, 2005

i have the following script:

function subCat(){
var d = document.all;
var i = d.sid.value;
if(i != "-1"){
window.location = "subcat.php?sid="+i;
}
}

That is called on the following drop down menu:
<select name="sid" class="dropBox" id="sid" onChange="javascript:subCat()">
<option value="-1">Please Select</option>
<option value="1">category 1</option>
<option value="2">category 2</option>
<option value="3">category 3</option>
<option value="4">category 4</option>
</select>

It works fine in IE but not in Mozilla Firefox, what do i need to chnage to
make it work correctly?

View 2 Replies View Related

IE Window.location Not Redirecting

Jul 23, 2005

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:

this.NodeSelected = function( node ) {
if ( node.Value != null && node.Value != "" ) {
window.location = node.Value;
}
}

View 3 Replies View Related

Window.location Not Working In IE 6

Jun 13, 2007

The following JS script works fine in FF and IE7. It fails though in IE6, which happens to be my target audience. Whats failing is.. the window.location is not calling.


function confirmation(text,url_link) {
var answer = confirm(text)
if (answer){
window.location = url_link;
}

}

View 2 Replies View Related

Location.href To A New Window

Jan 25, 2006

I use this code to create a banner that contains text:

<table of banner...

because it makes the whole banner a link. If I do it this way:

<table><tr><td ><a href='http://URL' target='_blank'>text of banner...

only the text is the link and if someone puts their cursor over a non-text area they might no realize they can click on it.

In the second example, however, I use target='_blank' to open up a new window.

My question is, is there a way to use the first method and open a new window.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved