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


ADVERTISEMENT

Target="_blank" Functionality - Target Page To Open It As Top Location From Within An Iframe

Mar 24, 2011

I am using the following javascript on the target page to open it as top location from within an iframe, which is working ok.

<script type="text/javascript">
if(self!=top) {
top.location.href=location.href
}
</script>

However my problem occurs when the user uses the browsers back arrow to return to the previous page, the script executes again returning them once more to the page they have come from. Is anyone aware of a work around to this problem as it would seem there isn't one? perhaps even a better solution for opening the target page from the iframe as top location. This is really causing confusion for users, and I really need to get the issue fixed.

View 2 Replies View Related

Move To Top Of Page In Href Having Target Of Iframe?

Jan 23, 2010

I am using the following sample code. I only telling u concept what the code looks like ... it may have single or two errors so igore them. code...

<p>here huge text is written so that the href tag goes very bottom of the page so that iframe is not seen while clicking on ...

Now my question is that how can i automatically scroll the browser slider to the top of the page when i click on href. Notice that when i click on href the control first goes to the file myfile.php

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

JQuery :: Way To Add Target Attribute To Window.location

Aug 22, 2011

I have a homepage with two frames. The left frame is the navigation menu with about 30 links to different websites. The right frame (frame name is "display") is used to display the content of websites when user click on the links on the navigation menu.Left Navigation MenuThis is part of the codes of the Left Navigation Menu:

<div id="LoadPage">
<a id="link1" href="http://domain1.com" target="display">Website 1</a>
<br>

[code]....http://domain1.com

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

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

Window.location.href On Mac Browsing IE

Aug 11, 2005

why window.location.href or window.location javascript functions doesn't
work on mac browsing IE

View 1 Replies View Related

How Window.location.href() Works?

May 23, 2006

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?

View 8 Replies View Related

Window.location.href With Encode?

May 17, 2007

I have a pop up window, that window needs to refresh the parent window when opened, I'm doing the following:

window.opener.location.href(window.opener.location .href);

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.

View 5 Replies View Related

Window.location.href Is Not Working In FF?

May 11, 2010

fixing window.location.href on localpath is not working in Firefox only but working fine in IE.

View 1 Replies View Related

How To Delay Window.location.href

Dec 8, 2009

I guess this is an easy question for all javascripters but I don't know how to manage (I'm pretty fresh with JS). I found two solutions on this forum but it seems that they don't work(?).I want to delay for few seconds window.location.href="destination_site.html" before it will automatically take visitor to destination site. It has something to do with setTimeout but I would be greatful for posting a fixed code.

View 3 Replies View Related

Window.open Location.href Frame

Jul 20, 2005

I have a page of 2 frame:

menu (menu.php)
corpo (corpo.php)

In menu.php i have:

View 4 Replies View Related

Can't Get Window.location.href To Work In Some Browsers

Jan 31, 2005

I have this line in an XHTML form:

Code:

<input type="reset" name="cancel" value="Cancel"
onclick="javascript:window.location.href('/index.php');" />
In IE5.5 clicking the cancel button loads the index.php page fine.
In Firefox 1.0 & also the version of IE running on my IPAQ it doesn't work - clicking the button doesn't do anything.

Anyone have any ideas or alternative solutions?
I thought maybe I was using an IE only thing but it is a version of IE on the IPAQ. I thought maybe it was not standards compliant but I haven't found anyone having a similar problem.

Any idea or advice?
TIA, BG.

PS Ignore that I am using a reset button to do this - I have also tried it in the body tag like this:

Code:

<body onload="javascript:alert('Login Successfull!
You are logged into my app');window.location.href('/myapp/index.php');">

View 6 Replies View Related

Does Window.location.href = Work In Firefox??

Mar 18, 2007

In my case it doesn't work. I need to transfer some variables from js to php Any work arounds???

View 5 Replies View Related

JQuery :: How To Window.location.href Parameter From The <select> Field

Nov 27, 2010

I've got code, but it doesn't href's (redirects) user after changing the <select> value; what I need to fix?:

what I want to open page (make redirect) and to do that I need to ADD to the LINK [url]

[url]

View 2 Replies View Related

Setting Location.href On A Modal Popup Opens A New Window

Sep 29, 2010

I am developing an application that is opened via a modal popup from another application that I do not have control over. In IE, the method of creating the popup that holds my application is window.showModalDialog. When I redirect the user via javascript with something as simple as, location.href='someURL'; another popup window is opened rather than just redirecting the browser. When a user is using anything other than IE, the window.open method is used and those browsers redirect within the same window appropriately.

[Code]...

View 2 Replies View Related

Location.href :: Pass Values From One Page To Another?

Feb 25, 2010

every time i try something it doesn't work for me :( god why is this javascript so hard to make it work... anyway, i just followed the guidelines to pass values from one page to another using ? and it simply, like always, DOES NOT work .

<HEAD>
...
...

<script type="text/javascript">[code].....

View 7 Replies View Related

Location.href Ignores Assignment And Loads A Blank Page

Jul 20, 2005

I have a webpage(with a text field and a button) which prompts for a
local file and attempts to load the file in the window if the user
clicks on the button. The javascript code onClick event uses the
location.href property to achieve the desired result. (This loaded
page has some additional functionality which lets them upload the
contents to the server.)

This approach only seem to work for some computers and on others it is
loading a blank page. I have alerts in the code to show that
location.href is correctly reflecting the file location after the
assignment. When it is loading the blank page I see the message
"Opening page about:blank" on the status bar. Iam currently using IE6
sp1 on Win2k. This issue is not just limited to this combination. We
are experiencing issues with IE5.5, WinXP as well.

The code works if I pass a web site address. It only fails if I
attempt to pass a file name(c: est.htm)

Any thoughts on why the blank page is being loaded or how can I go
about resolving this issue.

View 2 Replies View Related

JQuery :: Using Document.location.href To Direct To A Non-existant Page

Oct 14, 2011

I'm trying to create a player stats page, for my gaming server. I spoke to a guy who knows a little about javascript, and he told me there's a way to use document.location.href to direct to a custom page URL.

For example, if I search for a name, and the results are displayed. I want to click the players username, and be directed to. [url] without the "username.html" actually existing.

I heard it's possible, and it would save me a lot of time because I don't want to have 20,000+ individual pages, one for each username.

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

How Do I Find The Length Of Page In Target Iframe?

Oct 6, 2007

How do I find the length of page in target iframe?

I am looking for the code or give me idea to find the length

View 4 Replies View Related

Iframe Css Manipulation When Navigation Target Page?

Sep 13, 2010

I need this iframe for a facebook tab, since they changed the width to 520px. The original page in the iframe is 700px wide, and I've changed a few CSS properties using the frameReady plugin. It's works just fine, but trouble starts, when i'm navigating the target site, the CSS properties I've changed goes back to the original props.

[Code]...

Try clicking any of the 'view on map' links, then you'll see where I'm getting at.

How could I work around this? Can I make it apply the script every time something new loads into the iframe?

View 10 Replies View Related

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

Iframe Window.location As A Global Variable - String

Oct 18, 2010

I have come up with form which pulls membership id, allows checkbox selections and commentry (custom feedback). The final piece that needs to be captured is the iframe's url. Now the content in the iframe is content produced by (madcap) flare.

I need to capture the window.location of the iframe url and pass that onto the asp.net masterpage. The iframe is also located in a content page. The iframes content is controlled by it's own TOC. I have added a script to this output so that each time the content (page) in the iframe changes the script alert's me of the new URL of the page just clicked/opened (this is the information I need passed as a variable).

Here is the code producing the desired alert output (page url).

Code:

The above produces the output I would like to capture (but instead of an alert output, I require this as a string) which will allow the insertion into my form as the final piece of information required.

I am not sure how I can convert or catch the output. Of course I would not want to use the alert function everytime the page changes, but would like to have the window.location bound to a string which I can then use when inserting into my codebehind sql statement.

All the captured data is being inserted using vb.net into a sql table.

I just need to make that content page > iframe (window.location) a global variable that my masterpages codebehind can inject into the INSERT SQL statement.

View 11 Replies View Related

Window.location.href ... Flush - Webpage To Launch Setup.exe Then Go To Another Webpage On CD

Aug 10, 2010

It launches in IE and give the user instructions, then at the click of a button, launches my setup.exe. I want my webpage to launch setup.exe then go to another webpage on my CD, congratulations.html, which says "installation is complete etc". Here's what I am trying to do through JAvascript. It doesn't work. Should the first instruction be flushed in order for the 2nd one to work?

[Code]...

View 7 Replies View Related







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