473,748 Members | 3,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jumping in a frame using Javascript

Hi,

I have two horizontal frames, one on top of the other.

The top frame is an image map of a street with property boundary's on
it.

The bottom frame is a table with each row of the table holds details
about a perticular property from the image map above.

The user clicks on the image map in the top frame and the corresponding
row in the table is highlighted in the bottom frame.

The table is very long and the rows continue below the visable canvas.

What i need is a way to jump to the row when it is highlighted so that
it displays no matter where in the table it is located.

Is it possible to jump in a frame or page using Javascript?

Jul 23 '05 #1
17 1666
Here is the script I am using (just encase it helps someone get an idea
of what I mean).
"passdata" is the row id being passed in from the top frame. The row id
is used to find and highlight the corresponding row. What I really need
to do is to be able to use the row id to jump to a particular area of
the frame.

<script type="text/javascript">
<!--
var passdata = 1;
var oldpassdata = 1;

function Start() {
if(oldpassdata != passdata)
ShowPass();

id1 = setTimeout("Sta rt();", 100); // check value every .1 sec.
}

function ShowPass() {
highlightrow(pa ssdata);
oldpassdata = passdata;
}

function highlightrow(n) {
clearallrows()
document.getEle mentById(n).sty le.backgroundCo lor='#FFAABB';
}

function clearallrows(){
if (oldpassdata ==1)
oldpassdata = passdata;

document.getEle mentById(oldpas sdata).style.ba ckgroundColor=' #FFFFFF';

}
// -->
</script>

Jul 23 '05 #2
Use anchors. For each row, have an anchor close to it with a unique
name. You can have something like rown. So for each row, have an anchor
text near to it with name/id = rown. You can then jump to that row by
setting the location property of the bottom frame to the anchor name.
sthg like this in the highlightrow (n) function :
eval ("bottomFrameNa me.location='ro w" + n + "'");

Thanks

Anand.

Jul 23 '05 #3
Thank you for that! That sounds like just what I need.

Jul 23 '05 #4
c.**********@gm ail.com wrote on 07 mrt 2005 in comp.lang.javas cript:
eval ("bottomFrameNa me.location='ro w" + n + "'");


why the evil eval?

bottomFrameName .location='row' + n

wouldn't that work?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #5
Yeah. Thanks

Jul 23 '05 #6
I used the bottomFrame2.lo caton='row' + n; and when i do I get
bottomFrame2 is undefined.
I then tried to place the document object before bottomFrame2 and I get

Document.bottom Frame2 is null or not an object error.

Any ideas?

Jul 23 '05 #7
I used document.locati on='row' + n and I get "The page cannot be found"
error message in the bottom frame.

Jul 23 '05 #8
wrote on 08 mrt 2005 in comp.lang.javas cript:
I used the bottomFrame2.lo caton='row' + n; and when i do I get
bottomFrame2 is undefined.


[please ALWAYS quote. Usenet is not email, and others want to read too]

bottomFrame2.lo caton='row' + n;

locaton ?????????????

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #9
you should use #rown. not just rown. using eval works for me fine.

Jul 23 '05 #10

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

Similar topics

3
1660
by: Dynamo | last post by:
Hi My site uses frames and some of the frame pages are ranked higher in search engine rankings than the main page. When somebody clicks on the link it takes them to the frame page and they don't see my page as it should be viewed plus it displays a javascript error. I need a way using php so that when the link is clicked on in either yahoo or lycos that it loads the main frame html page (not the subframe html) and that the subframe...
4
9257
by: Kathryn | last post by:
I hope you can help as this is driving me crazy! I have an asp which has 3 frames on it as follows: <FRAMESET rows="50%,*,10%"> <FRAME src="rundetailstop.asp" name="rundetailstop" scrolling="no"> <FRAME src="rundetails.asp" name="rundetails" scrolling="auto"> <FRAME src="rundetailsbottom.asp" name="rundetailsbottom" scrolling="no"> </FRAMESET>
2
1795
by: Paul | last post by:
I have a simple frame-based application where title information appears in a top frame and a lower frame contains the content for the application. One of the needs for this app is for a status line in the upper frame to be updated when certain actions are taken in the lower frame. In the top frame, I have a line of text wrapped with SPAN tags and assigned a unique ID attribute. In the lower frame, I run a JS function that looks up the...
3
1444
by: compassSoftware | last post by:
Hi, I have a script that allows me to highlight a row of text. This text is in a table. The table is long and scrolls down the page below the visiable canvas. What I need is a method to jump to the highlighted row.
1
6283
by: Robert Mark Bram | last post by:
Hi All, We are using a scrolling iFrame to present a list of options to the user within the main page with an anchor against each option. Depending on the user actions, we jump to an anchor in the frame with code like this: theFrameSrc = theFrame.src; theFrame.src = theFrameSrc + "#" + anchorName;
5
3509
by: Martin Chen | last post by:
I have a frame set (as per MS FrontPage 2000). It has a contents and a main frame. The contents frame has a menu bar written with with javascript (in the context of a table). In IE6.1 everything works fine as it also does in firefox if I call the contents frame directly (i.e. outside of its frameset). However, if I call my main page (index.html) which invokes the frame set, the contents frame javascript menubar onmouseover function...
42
3884
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
2
1864
by: mrjoka | last post by:
hi experts, i'm developing a page in ASP but i'm doing also some javascript insode the page. i'm creating a frame and i want to loop this frame with a duplicateloop function so the form will be duplicate so many time, also i'm using a removeloop if the client want to remove the frame, in the html of the page i'm creating a table and i'm calling this loop, the problem now is that when i'm calling the removeloop it removes the frame but not the...
6
1949
by: Richard Maher | last post by:
Hi, Now that I am aware that JS on a page in Frame A can directly call a function on a page in Frame B, I no longer have to continue with my frameB.location.reload() fudge in order to get some code to run in B's context. This is fantastic news, and I'm having a ball! But before running off with all my convert's zeal and converting all my <script src="common.js"copy-books to direct parent.frame.function() calls I'd like to pause for a...
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8241
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.