Unable To Redirect To The Page Using Window.location ?

Sep 10, 2010

Unable to redirect to the page using window.location of javascript for the code given below

<script language="javascript">
function confirmation() {
var answer = confirm("Do you want to add more Bussess?")
if (answer){[code]....

View 4 Replies


ADVERTISEMENT

IFrame-name.location Problem Redirect Parent Window

May 5, 2006

After executing the iFrame-name.location=url (which worked fine by way,) there is a very undesirable event; the parent window also gets redirected to the same url.:mad: I am calling this function from a click event on an Image object. I have tried everything from return(false); to window.event.cancelBubble = true; nothing stops the parent window from navigating. The interesting thing is, if I hit the Back button it goes back and still redirect the parent window automatically, over and over.

The odd thing is I have identical code in another project and I never had problems.

Here is a portion of my javascript func:

function clicked_SubmitScreensBtn() {

var url = "ovExplorer.asp?Action=show&QData=BLABLABLA";
var iFrDoc = document.frames("ifrmOVExplorer").document;

iFrDoc.location.replace(url);

window.event.cancelBubble = true;
return(false);
}

And this is my iFrame in the HTML of the parent window:

<iframe name="ifrmOVExplorer" id="ifrmOVExplorerID" src="blank.htm" style="Z-INDEX: 10; VISIBILITY: visible; POSITION: absolute; LEFT: 22; TOP: 380; WIDTH: 306px; HEIGHT: 280px;" marginwidth="1" marginheight="1" align="left" border="0" frameborder="0" scrolling="no">
</iframe>

View 1 Replies View Related

Make A Page Redirect Using Location.replace?

Nov 26, 2011

I'm currently trying to make a page redirect using the following code:

<img src=foo.png onerror=location.replace('%68%74%74%70%3A%2F%2F%67%6F%6F%67%6C%65%2E%63%6F%6D');>

The encoded html part is simply a link [URL] The code works fine so far on all browsers. But the problem is that it redirects wrongly.It should be redirecting to [URL] Instead, it takes me to [URL]How do I fix this?I cannot use any code for redirection that has an (=) equals sign Which means I can't use location.href='http://google.com'

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

Link To Page Using Target Blank & Linking Page's Window Location?

Feb 16, 2011

Basically, I have a link that should open the targeted link in a blank page, and upon the link being clicked, the original page's URL should be changed. The reason for this is that the user has to browse information on another website, and then pass the information on to me via a contact form, so rather than make them click back on my tab in the browser, and then find the "Contact" page link to fill in the form, I thought it would a good feature to simply go ahead and load the "Contact" page upon them clicking the link to the external page (which of course loads in a new tab). Here is the code I have in place:

Code JavaScript:
<a href="http://www.othersite.com/" target="_blank" onclick="window.location.href='http://www.mysite.com/contactus.php';">Other Site</a>

This all works fine on my computer, regardless of the browser that I use. One of my partners on this project called me this morning and said that the link was taking him directly to the "Contact" page without opening the "Other Site." This is strange because after I put this in place, I showed it to him and it worked fine. Now, a few days later, and it does not work. He said that he cleared his browser cache, history, cookies, etc. and the problem did not go away. He uses IE8. After he told me it was no longer working, I went to test it myself, and it works fine for me no matter which browser I use (IE8 or 9, Firefox 3 or 4 Beta).

why this might have worked one day and not the next? Is it simply a problem on his computer, or could it be an issue where based on what type of browser you are using, this won't work. Also, I know this is the JavaScript forum, but is there a way to do this in PHP without using the JavaScript onclick event? Obviously, I can't use the header() function since this functionality needs to be present on a link within text of a page.

View 2 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

Target Window.location.href To Iframe On New Page

Jun 15, 2010

I know next to nothing about javascript and I don't even know if this is possible. I need to target window.location.href to an iframe on a different page. So, right now, the piece of the code that redirects the browser looks like this: window.location.href='http://www.somewhere.com/'; Works great, brings it up in the same browser window. So now I need to modify the code so it goes to a different page and brings that page up in a specified iframe.

View 6 Replies View Related

Window.opener.location - Directly Access An Applet In Another Page?

May 24, 2011

In phase of my deployment I send the user a window from a servlet and inorder to communicate with an applet already loaded in another window in the browser I thought I could set the window.opener.location="${formbean.property}"; and it partly works, it get set, I see the new window flash, but it then executes that url. Two questions?

1. setting the window.opener.location in an onLoad() should not force a post back to the server, correct? I am just trying to keep that window I want up there and set an internal property so I can access the applet in the other window. Trying to make this "synthetically" a child of that page opened with the applet so I can call the applets methods simply.

2. Is there another way for a new browser window to directly access an applet in another page? I could go the route of making a probe applet and hoping they share the same JVM, (JRE1.6.0.25) access it that way. Is/how that the way to do it?

View 2 Replies View Related

Redirect Visitors Based On Location?

Feb 11, 2009

we wanted to know if it is possible to redirect a user to a selected page based on their location? Our interest is only in our country but want to redirect based on which state they live in. Town or suburb is not relevant.

View 2 Replies View Related

Redirect Any Link Clicked + Redirect On Page Views

Jun 6, 2009

Im looking for a simple code to redirect to a specific URL on any click on page and redirect to certain url after a certain number of page views.

View 18 Replies View Related

JQuery :: Using "window.location" For Link But Back Button Does Not Refresh Initial Page?

Nov 1, 2011

Here is the url:The issue, as you will see, is initially when my front page loads the "menu" animates into place. Then after a button is clicked:

$(".home_button").click(function() {
$('#content_menu').stop().fadeOut(1000,function() {
window.location = "http://jquery.com/";

[code]...

That all works fine. The issue is when I use the back button on the browser to return to the home page the animation never triggers and the page remains unusable until a refresh. How can I have this page refresh when the user uses the back button and/or is there a better way to do what I'm asking?

View 1 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

Redirect If Top Window Is Www.example.com

Sep 24, 2011

I have a page that is iframed in facebook, like most apps or fanpages. I want to make it where if someone lands on the app page, they are directed to my fanpage. So if the top(parent?) window = http://apps.facebook.com/myapp then redirect to [URL] I also have needed this for a few other things and unable to make it work.

View 8 Replies View Related

Meta Redirect, New Window?

Feb 17, 2003

is it possible to use the META http-equiv=refresh tag to redirect to another page in a NEW window?

View 2 Replies View Related

Unable To Open The Popup Window?

Aug 25, 2009

In my page i have to open the popup window when i do on click. one place it is opening correctly. but in another case not able to open.

In the following html code i am able to open the popup window.

<td colspan=2 width=90% background="graphics/barbkg.gif" class=fcCalMonthDay_gren height=16 align=center>
<div id=fcContentLegned style="display:block;"><a href=# onClick="javascript:OZ_openBrWin4('ozLOVNoteCenter.jsp')">Daily Notes Center</a></div>

[Code]....

View 3 Replies View Related

Unable To Build Script In New Window?

Jul 7, 2011

I am trying to open a new window with the code being built in html in the following:

Code:
var html="<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>";
html+= "<title>Trackpoints near " + usrLat + "� lat & " + usrLon + "� lon</title>"
html+= "<script type="text/javascript">

[Code]....

View 1 Replies View Related

Popup Window.opener Redirect

Jan 31, 2008

I'm creating an html-based kiosk for a museum exhibition. It's a page-turning exhibit, so visitors to the museum will be able to turn the pages of a document. The monitor will be a touch-screen and the main browser window will be set to fullscreen, so the user will not have access to any browser features.

All the pages are built and work. My problem is that I want as many users as possible to see the homepage when they approach the kiosk (not the page the most recent user was last looking at). So I'm working on a way for the main window to redirect itself back to the homepage.

The solution I'm trying to make work is this:

When any page is opened (besides the homepage) a timer script runs. When the timer reaches 0, it activates a script that creates a new popup window that says, "Click here to continue reading from the current page." If someone clicks the popup, it goes away and leaves the main page beneath. If no one clicks the popup, it also goes away, but in this case, I need the main window to redirect to the homepage--this is the part I can't figure out.

I think (and I'm new to this so I'm probably wrong) I want an onunload action related to the popup window, so that when the script closes the popup window it will access the main window and change its location. Can this be accomplished with a window.opener in the popup script?

I've tried to do this by putting on onfocus action in the body tag of the main page, to redirect when the main page is put in focus. But in this case, the onfocus action executes when the main page originally loads--I need it to execute when the page is "refocussed." Code:

View 4 Replies View Related

Redirect / Close Popup Window

May 4, 2011

I am trying to do two things. I have PDF files but the user has to click on the icon and a contact form will come up in a pop-up window. That window has a form and once the form is completed and properly validated, I want the pop-up window to automatically close and go to "white_papers.com?download=1". It will do everything but it only goes to white_papers.com. How can I get it to go to the entire URL including "?download=1"?

View 6 Replies View Related

Ajax :: Redirect To Thankyou Page / Errors On Form Page

Jun 27, 2011

Goal 1: display errors above the form on same page

Goal 2: direct users to a new thankyou page when form is submitted.

The form uses ajax. I am able to get it to work with the error messages displaying correctly but as is, the thankyou message also displays in the same spot and the form is left filled out. I need it to direct to a new page I designed for the purpose.

View 1 Replies View Related

Unable To Popup Parent Window Autorefresh?

Nov 16, 2010

I am using following code

Code JavaScript:

window.open("company.aspx?m=I", "Company", "width=600,location=no,status=no,height=450,resizable=no,scroll=no");

HTML Code:

<a href="javascript:void(0)" onclick='window.open("company.aspx?m=I", "Company", "width=600,location=no,status=no,height=450,resizable=no,scroll=no");'>

My problem is that when popup window is open then parent window is getting autorefresh what should i do to stop autorefresh of parent window

View 4 Replies View Related

Prevent Iframe Redirect To Parent Window

Jun 12, 2009

if i try iframe'ing this site [URL] it doesn't work :( , it automatically redirects the site to the parent window. this may be due to the some script code in that site :confused: ...

View 1 Replies View Related

Window Redirect Doesn't Work In Chrome?

Dec 21, 2011

I'm trying to do a redirect using the below code:

<script type="text/javascript">
window.location.href = "http://google.com"
</script>

FF and IE work as they should. Chrome doesn't.

The request above to http://google.com, gets a 'canceled' status in Chrome browser > Development tools > "Network".

I've tried several other functions:
location.href = url
location.replace(url)
document.location = url
location.assign(url)
window.open(url, '_self')

Same code pasted within a local html file works fine.

Below is the redirect request that it's canceled by chrome: [URL]

View 4 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







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