Compaibility Issue: Window.location Mismatch With Browser Locationbar
Jul 23, 2005
I already understand that one cannot disable a browser's
forward and back functions. This is a situation where I
have code working in Mozilla V1.6 and would like something
similar for Opera and IE.
I link within a page and display individual divisions of
that page, manipulating their visibility and display styles
with an onClick function. As long as I explicitly click a
link to progress, it works with browsers I've tried.
If I click the browser's back button I see the content of
the browser's location bar change as I expect. But I
need to set the visibility and display styles for the
corresponding division. In Netscape/Mozilla I have a little
function enabled by setInterval(). It looks to see if
window.location.hash matches the division which is visible
and modifies styles accordingly.
Under IE window.location.hash seems to be "stuck" at the
most "forward" link. Under Opera I can get only the URL
without the hash; it claims that the hash property is
undefined or empty. I've tried document.location and
document.URL with the same results.
Since there's no page load or unload involved, there's no
event generated; I could kludge some history of my own to
traverse.
Am I looking in the right place to get the hash info? Is
there some direct access to read the location bar?
Is there another approach to the problem, other than breaking
up the page so that I force a load or unload?
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.
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?
Is there a way in Javascript, or perhaps in HTML, to force a browser to re-render an image on an HTML page after a round-trip between the client and the server ?
In my particular case, the image is changing on the server although the URL for it remains the same, but the browser is still displaying the old image from its cache rather than the new image from its URL location.
I need to make sure the zip code the user enters matches up with 1 of 50 acceptable zip codes - so if they enter nothing at all or enter a zip code that does not match up with one of the 50 acceptable zip codes they get an error. I know I need some kind of conditional statement like: if (#zipcode != "12345 || 23456 || 45678 || 12365") .. do something...
I'm trying to force jQuery UI Tabs to work with browser locations (as in direct-linking or bookmarking), but having very little luck doing so. It feels like I've seen this question at least 50 times around the net, and the answer mostly consists of one of the following 5:
[Code]...
Hierarchically based tabs (hopefully something better than "level1-level2-level3") As I said, I know it has been asked before, but apparently I am now the only one struggling with this. So if anyone could give some suggestion on how to use jQuery Address, jQuery BBQ or any other method to accomplish this,
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?
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?
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; }
I am doing my final year project. I am trying to access webpages via javascript. while i am doing this i open a new window to display webpages.And i have to get the url from child window while i am navigating the webpages. I have tried to get the url from child window after the new window is opened. But i get the null value as a result.[code]
I have a inventory control program written and I use window.opener.location='filename.html' window.close()
It works fine in ie6 on windows 98 and XP home but sometimes for users with XP professional it crashes ie6 (wants to send a error reports to microsoft and the closes)
I was wondering if it could be that professionals "mutil" processing causing a problem by 1 process excuting before the other?
This may sound dumb but this is what I want and I am not sure how to frame it better. I see window.location.replace() creating problem with my "Back" browser button. This is because, location.replace() actually replaces the url in the history with the one currently given. So if I click on "Back" button after going to an url using window.location.replace, it goes to the previous-1 page.
Is there any measure to avoid this? Or do we have an alternative function that does the same action without replacing history?
I'm popping a window to a page with a different dns than the parent, and i want the opener's location reloaded when this window is closed.
With Mozilla it seems that all the opener's methods and properties are protected because the dns are different. A security exception (permission denied) is thrown every time i try to exec an "opener.location.reload()" from the pop up window.
An alternative would be catching the window closing from the opener, but i don't know how this could be done.
as i know href is a property of location but location.href(url) works fine with IE 6. i couldn't figure out how its possible? is it a kind of browser syntax-tolerance helping it to work? how the heck is this working?
problem I'm having is that the parent url has a # sign in it, like: http://localhost/mysite/me.html#01
i need the #01 to stay in the url after the refresh, anyway to do this? i tried using escape(window.opener.location.href) but that didn't work, as it escaped everything including the :// in http://
i also tried: window.opener.location.href(window.opener.location .protocol + "//" + window.opener.location.hostname + window.opener.location.pathname);
problem with that was i lost the #01 in the url, pathname didn't include it.
i am trying to redirect user from onchange event to another location in the page. its work fine in IE but not in firefox why window.location doesn't work in FF ?
I'm currently paying for a web service on a hosted platform. Basically, I'm unable to edit any raw content, however I am able to do things like add JS/HTML to the header or footer of a page, which will in turn be displayed on every page of this platform. My dilemma is, I only want content being showed on a single page of the platform. Specifically, I want a window.alert being displayed on the "/signup" page, but all I have to work with is JS in a global footer.Is there some way I can use window.location to achieve this?
I am trying to use the window.opener.location code from a link on my popup window to change the webpage in the window that opened my popup. It works on ie/firefox, but doesnt work on safari.
Now i've tried the link with both <a href="#" changepage(35);"> and <a href="javascript:changepage(32);"> but safari doesnt want to touch the opener page. Do you know of any workaround/hack to get this to work? If not, is there a way to check to see if the user has safari and change the code to opening the page in a new window?