Target Named Anchor When Opening Window
Jul 20, 2005I was wondering if it is possible to target a named anchor in a frame when
opening a new window with a javascript function? has anyone actualy been
able to do this?
I was wondering if it is possible to target a named anchor in a frame when
opening a new window with a javascript function? has anyone actualy been
able to do this?
I'm opening a new window that contains a simple frameset (topFrame,mainFrame). On the mainFrame page I have along list of service descriptions each with their own named anchor.
Here is the script i'm using to open / center window in browser (script is from 'ultimate window pack' extention for dreamweaver): Code:
I use named anchors to take users to specific parts of a long page. But I
want to add some processing and do some things with my nav bar when users go
to certain sections delineated by named anchors. I understand that the
anchors array creates an element for each anchor in the page when the page
is loaded, but how do I identify which anchor is currently being viewed?
Here's some pseudo code:
if (document.anchors.name == "section_B") {
then do this or that
}
But what do I test to determine the current anchor name?
What about using id's instead of names? Can the anchors array return
anchors created with id's as well as names? Would this be of any benefit?
I found a nice script over at jQuerry for Designers that I'm using in a Drupal site. It seems to work fine, except for that every anchor tag on the page triggers the script! how can i adjust the script to target a specific anchor (currently has an ID of "test") and ignore all other anchor tags? here's the script, its placed in an external .js file:
[Code]....
I am trying to redevelop firefox addon, to give it more funcionality. I found JS file where all the functions are and started to edit it.
What I want to achieve is to get target of an anchor under mouse pointer (when mouse pointer is over anchor, I right click and call addon from context menu).
For example when I have anchor which HTML code is:
<a href="somewehere.com/place">place</a>
when I right click on this code and call my addon I would like to alert its href (somewehere.com/place)
I wrote a function:
function ff()
{
var current_target=this.href;
alert(current_target);
}
but it gives me udefined on alert
[URL]
I am trying to redevelop firefox addon, to give it more functionality. I found JS file where all the functions are and started to edit it.
What I want to achieve is to get target of an anchor under mouse pointer (when mouse pointer is over anchor, I right click and call addon from context menu).
For example when I have anchor which HTML code is code...
consider the following code;
$("#content").click(function(event)
{
if($(event.target).is('a'))
{
$(this).//do something
}
}
I'm binding a click event to a div so that I can see whether is was the div or some element inside the div that has been clicked. When the if() in my code evaluates to true $(this) is still equal to $("#content") whereas I'd like to have the clicked anchor as matched element. How would I do this?
i want to submit form data from the popup window, close the popup, and load in the main window. problem is, it always opens a new 'tab'. i'm using google chrome, i didn't think to try this in
in the <head> of the 'main' window:
<script language='javascript' type='text/javascript'>
window.name='main';
</script>
[Code]....
I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.
View 4 Replies View RelatedI use a subroutine to popup windows in my sebsite. It looks like this :
function poplink(filename)
{
filestring = filename + "htm"
LinkWindow = window.open(filestring,'LinkWindow','');
}
Filename is just the extensionless web page name e.g. "Addresses"
Problem is of course every window popped up will replace the previously
popped up window and in the case of a popped up window popping up a window
the new window will just replace the calling window.
(Please, no lectures on popping up windows, I need to in my particular case
and here I'm just stripping it down to the bare problem for claritie and
simplicities s sake)
I'd be happy if I could create a new window handle each time so that all my
popup windows will be unique. If it could be the filename that would be fine
e.g. instead of the window handle variable being "LinkWindow" it would be
"Addresses". Is there some way of making the variable I assign the new
window to a variable? All I can come up with is somehow having LinkWindow an
array of window handles and just keep incrementing it e.g.
LinkWindow[100]; // 100 is more than enough windows for a typical session
LinkWindowCount = 0;
function poplink(filename)
{
filestring = filename + "htm"
LinkWindow[LinkWindowCount] = window.open(filestring,'LinkWindow','');
if (LinkWindowCount < 99)
LinkWindowCount++;
else
LinkWindowCount = 0;
}
What would be the correct syntax for creating LinkWindow as an array or is
there a better way of accomplishing the same thing?
I have Cycle "pager" navigation working flawlessly in one of my pages. What i'm trying to do is this:
I'm Attempting to LINK to specific Anchors from a link on a different page.
Example:
// external page link //
<a href="http://www.convertstyle.com/beta/apparel/womens-apparel#shirt1">Headline Womens</a>
[Code]....
I'm relatively new to jQ and would like to determine if a named window is already open. If it is then I want to change focus to that window/tab. The scenario is this. I have a link in App1 that opens a new window to an already existing linked (related) web form in App2. If the user forgets they have that window open in App2 and clicks the same link in App1 as before (to open the related form in App2,) it opens a window that is not the same window as the original window. I need App1 to detect if a window already exists in the browser of the same name and if so, change the browser focus to it.
View 4 Replies View RelatedI have a popup window which has the search form in. What I want to do is for the popup window to close once the form is submitted, and to post the form data to a page on the main window.
Is anyone able to advise. As the main page is dynamic, it is not possible to give the page a name.
code to show ( overlay / modal window ) to the user when closing or navigating away from the page ( i want put in this window facebook share to make the user to share the page in his facebook ) , bytheway i wanna use it in my wordpress in every post could it be happen ?
View 1 Replies View RelatedI'm using window.open and as soon as I click on the link to open the new window, my original page content is replaced with '[object]'.
<
href="javascript:onClick=window.open('leaving.htm','','t oolbar=no,location=no,status=no,menubar=no,scrollb ars=no,resizable=no,width=300,height=400')">Lin
1 </a>
Any ideas ...
I am looking to have a link open a closeable window that is contained within a browser window. If you click on the "sizing charts" link on this website, this is exactly what I am looking to do:
[URL]
The window is contained within the current browser window, it can be dragged around, but not outside the parameters of the browser window.
I have a site where one of the links I have set up to open a pop up window which will display Terms & Agreement information, at the bottom there is a check box and a submit button for users to click on if they agree to the terms. I was able to get that working but the thing is when the user clicks in the check box and hits submit I want them to be directed to a page which has a form on it but I wanted the page to open in the original (Parent) window. This is where I am lost cause I found some coding which will open the page with the form in the pop up window but Ideally once they agree to terms and hit submit I'd like the pop up window to disappear and the new page open in the Parent window... is this possible below is the coding I'm using.
Here is the form:
<form method="get" action="this is where my link will go" onsubmit="return yes_no(this.form) " name="Agree">
<INPUT name="agree" name="agree" value="agree" type="checkbox"> I agree to terms
<input type="submit" name="submit" value="Accept Terms">
[Code].....
I have a pop up window is for the user to submit some information.
That window is refreched a few times with the user inputs (its a form
submit in itself... couple of times). I would like that window to close
after the user submits a rating and refreshed the original page that
opened the window.
I cant use opener.document.refresh because afterall the page isnt
considered the opener after the user posts the information on the pop
up window.
I have a few banners and forms that I wish to open in a new tab not the same window or a new window. I have tried the deprecated
target="_blank"
But even that opens a new window.
I have done some research on google and came up with CSS code:
form[target] {
target-name: new;
target-new: tab;
}
a[target] {
target-name: new;
target-new: tab;
}
This however does not work and opens in the same window. When using the CSS I remove the inline target.
what I'd like to do is be able to click on a link in the popup window, and have the popup window close while reloading the parent window to the selected url.
View 1 Replies View Relatedin dreamweaver there's that show/hide layers behavior
can that be somehow tweaked to show hide layers in another window, to be specific parent window of the one triggering the show/hide?
I just want my form target to be another page but open it in the same
window. Here is my code for the 2 pages : Code:
Anyone know how to change the visibility of a DIV in one window from another (pop-up) window? The pop-up was generated by the window with the DIV. The situation: I've got 4 DIVs in the main window with only one showing at a time (it's a multi layered form). The pop-up window is generated from the main window when a user wants to edit certain form fields. When they've completed their edits in the pop-up and submit the main window refreshes with the new data, however the main window defaults to showing the first DIV and hiding the others. When the pop-up is generated from the 2nd, 3rd or 4th DIV I'd like to bring the user back to that DIV, not the first.
View 1 Replies View RelatedI am using the following code to display an image in a seperate
window.
<form>
<input type=button
onClick='window.open("image1.jpg","","width=260,height=260,resizable=0,border=0")'
value=Shhow Picture'>
</form>
I want the window to be the exact size of the image so I set the width
and height of the window the same as the width & height of the image.
The code works, however there is a white border on the top and left
side of the image. If I add 20 to the width and height of the window
then there is a white border around the whole image.
Is there anyway to have the window the exact size of the image,
without this white border? I know there is probably a simple solution,
but I'm a beginner at JavaScript.
I have a form on a page and when the form is submitted it should open a
new window and post the content to it.
When the script being posted to is a html page, then this works fine,
but when the script being posted to produces an svg graphic, then there
is no 'view source'. Its almost as though the opened page headers are
already set for html and doesn't like the svg xml schema.
Here is the code:
document.report.action="graphic_rpt.cfm?RequestTimeout=700";
var mywin;
if ( !mywin || mywin.closed )
{
mywin =
window.open(mycgi,'view_report','width='+mywidth+' ,height=425,top=50,left=0,scrollbars=yes,toolbar=y es,resizable=yes');}
}
document.report.target = 'view_report'
document.report.method = 'post'
document.report.submit();
mywin.focus();
I am confused as to why a window will not open if i include certain code. if i use code...
View 8 Replies View Related