473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to open a new window - trying to pass an anchor to a location in new window

Hello I was searching and I see that this question has been asked before but I unfortunately do not see the answer.

I'm new to Javascript so if I ask something impossible please let me know.

I'm opening a new window while trying to pass an anchor to a location in that new window. It's not working.

I used the simple script in my template:
Expand|Select|Wrap|Line Numbers
  1. function openwindow()
  2.  { window.open("/siteuser/do/general/application/eHelpPage", "HelpNotes", "resizable=1, status=1, scrollbars=1, width=400, height=400"); }
and on the page i call it this way:
Expand|Select|Wrap|Line Numbers
  1. <a href="#demo"><img src="/siteuser/images/Question.jpg" onClick="javascript:openwindow()" alt="Help Topics" /></a>
  2.  
It's a simple idea so I don't need to maintain a number of help pop-ups.

Now I did the onClick because I was using the href="#... as my anchor. I don't have a problem with the script working it's just not letting me hit anything other than the top of the new page each time.

I know this anchor tag is used for internal page references however I can't find anything to direct me to another technique or option.

Ideas? T
May 20 '10 #1
2 2196
Hi iam not sure i get your point BUT here is some code that might help you.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <script>
  3. function openwindow()
  4. { window.open("http://www.infimum.dk/HTML/JSwindows.html", "HelpNotes", "resizable=1, status=1, scrollbars=1, width=400, height=400"); }
  5.  
  6. function openwindow2()
  7. { window.open("http://www.infimum.dk/HTML/JSwindows.html#ref_3_5", "HelpNotes", "resizable=1, status=1, scrollbars=1, width=400, height=400"); }
  8. </script>
  9. <body>
  10. <a href="#demo"></a>
  11. <img src="/siteuser/images/Question.jpg" onClick="openwindow()" alt="Help Topics" />
  12. <img src="/siteuser/images/Question.jpg" onClick="openwindow2()" alt="Help Topics" />
  13. </body>
  14. </html>
  15.  
some note:
  • you must provide whole url to javascript window.open
  • if you want to change content of window just call same code with another url

for more information google or look here: http://www.infimum.dk/HTML/JSwindows.html

btw: is there a reson you have image tag with on click inside anchor tag?

Have a good time.
May 21 '10 #2
Thank you for your response and I'll research the link you provided.

btw I used the onClick in the anchor because it's an attribute that the anchor tag supported. I don't have an issue with opening the window and I'm sorry if I didn't communicate that well.

I see here I needed to place special tags around my code snippets so a special application pop-up in this environment can be used. It actually makes it really hard for me to see all the code but if it helps you who are helping me, ok. :)

I was hoping for a new window that displays text. On this text page I would be able to link to different destinations on that page depending of the initiator link noted or (named) anchor ref.

I hope this helps and if anyone else can help, I'd appreciate the input.
May 24 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: J P Singh | last post by:
Hi Guys Wonder if someone can help me with this. I have a form where a user clicks a button which gives them a pop up windows to allow them to add the data. The user adds the data and click...
2
by: Juan Garcia | last post by:
Subject says it all. Given: Window A with text field. Window B with a button (onClick opens Window C) Window C with a button (onClick I want it to modify text fields of Window A) I have...
19
by: Albretch | last post by:
Hi, client wants for a window with no toolbars to open (technical and 'esthetical' reasons) after the window, user clicks on, is being closed. I told them about security settings in browsers...
0
by: bhchng | last post by:
After I click the submit button on my child window, it successfully navigate the parent window to the indicated URL and close the child. But I dont understand why the child window reopen a new...
2
by: Vijay Kerji | last post by:
Hi, Please go through the following scenario. 1)On Button click, Parent window opens a child window using showModalDialog 2)Button is a server control and showModalDialog script is registered...
1
by: Matt Jensen | last post by:
Howdy I've got a ASP.NET webform page that pops up a window for a user to make a selection. Once they make a selection in this popup window, the form in the popup is submitted an update to the...
5
by: midnight_use_only | last post by:
hi all, quick question, how do you submit a form to a parent window from a child popup window? i have the following and all online documentation *suggests* that it should work but it does NOT: ...
1
by: devenderraopalleni | last post by:
can any one plz throw some light on my problem : i want to know how to automatically update the parent window when closes the child window
1
by: dev175 | last post by:
hi i need to know how to force opening a hyper link in a new window because when i use window.open() in internet explorer the hyper link gets opened in a new window but in Firefox the hyper link...
6
by: pramodsangur | last post by:
Hi, I open a window using window.open('win1') from a parent window, now this pop up window will have to be open until user uses the application. On click of logoff or 'X' button on browser the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.