473,395 Members | 1,999 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,395 software developers and data experts.

problem launching window.open(javascript:setCursorPosition(1527,'HAT SFORM'))

Hi,

I am trying to launch a new browser with the same url location as the
current browser, and at the same time run some javascript.

This works with <a href=javascript:setCursorPosition(1527,'HATSFORM') >test</a>
, which runs the javascript in the current url location, but when I
try window.open(javascript:setCursorPosition(1527,'HAT SFORM'), it
opens a new browser with the string
"javascript:setCursorPosition(1527,'HATSFORM') " in the url location of
the browser, which obviously fails.

So I need the window.open to open up a new browser with the same
relative url and then execute the javascript string. Any ideas?

BTW, this also fails when I try <a
href=javascript:setCursorPosition(1527,'HATSFORM')
target=_NEW>test</a> for the same reason that the relative url
location is not kept for the new browser.

Thanks in advance
Bill
Jul 23 '05 #1
1 2855
> This works with <a
href=javascript:setCursorPosition(1527,'HATSFORM') >test</a>

I'm guessing that this method simply moves the current window to the correct
location on the page.
, which runs the javascript in the current url location, but when I
try window.open(javascript:setCursorPosition(1527,'HAT SFORM'), it
opens a new browser with the string
"javascript:setCursorPosition(1527,'HATSFORM') " in the url location of
the browser, which obviously fails.


Yeah, window.open requires a URL to be passed. I think what you need to
something like this:

var newwindow = window.open(window.location.href);
newwindow.setCursorPosition(1527,'HATSFORM');
The idea is to open a new window with the same URL as the current window and
then call the setCursorPosition() method with the correct parameters in the
new window. This is assuming that the method will exist in the new window.

Hope this helps
Mike
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
I am having a problem with window.print in a popup window. I am creating 2 popup windows both with a print button in them, 1 works the other doesn't. Code runs in a javascript function on a...
2
by: Martin Nadoll | last post by:
Hello, i want to close a popup-window with the onBlur eventHandler. function closeIt() { setTimeout('window.close()',2000); } <body onBlur="closeIt()"> html </body>
1
by: dibyendu_k | last post by:
Hi, There is a problem i cant solve regarding Internet Explorer 5.5. It is regarding the Print Dialog Box. From a webpage if I open a popup window (window.open()) containing buttons Print and...
1
by: Dave | last post by:
Hi, I am using the following code to try to open a window in a target frame using a button control that is in the original frame. It does not work unless I click the button twice. If anyone...
0
by: Scott Zabolotzky | last post by:
I'm using the following code to launch SIGNCODE.EXE to sign a CAB provisioning file from an ASP.NET app. When I run the code the exit code comes back as -1. I have not been able to determine what...
13
by: tochiromifune | last post by:
Hello The window.open method brings my window to the top only if it is new. If it's being reused, the window does not come to the foreground (with IE 6 it does). Is there a new way in...
2
by: John | last post by:
Hi, I posted this earlier in microsoft.public.dotnet.framework.aspnet, but didn't get a response, so I thought I'd try here. Basically, I'm having a problem opening / downloading csv files...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
1
by: ajay7387 | last post by:
i am facing a problem with window.opener. i have a function addToTable(var d) and if i am calling that from child window using window.opener.addToTable(var) its not working. "<A HREF='#'...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.