473,405 Members | 2,354 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,405 software developers and data experts.

Why my script is partly working?

Hello folks,

My script is as below:

parent.menu.location.reload(true);

parent.frames("menu").TreeView1.CollapseAll();
parent.frames("menu").TreeView1.SelectNodeById(id) ;
parent.frames("menu").TreeView1.Render();

The first line is to refresh the menu frame
The second to fourth lines are to highlight a tree node.

For some reason, the second to fourth line codes are not working, it
seems to me they can't co-exist with the first line code. I can keep
either part and it works fine, but once I put them together, first line
is working, I saw the frame will be refreshed, but nothing happen after
that (a node is supposed to be highlighted by the second-fourth line
codes)

Anyone has any idea?

Thanks.

May 18 '06 #1
3 1520
Ivo
"Raymond" schreef
My script is as below:

parent.menu.location.reload(true);

parent.frames("menu").TreeView1.CollapseAll();
parent.frames("menu").TreeView1.SelectNodeById(id) ;
parent.frames("menu").TreeView1.Render();

The first line is to refresh the menu frame
The second to fourth lines are to highlight a tree node.

For some reason, the second to fourth line codes are not working, it
seems to me they can't co-exist with the first line code. I can keep
either part and it works fine, but once I put them together, first line
is working, I saw the frame will be refreshed, but nothing happen after
that...


Presumably the page hasn't finished (re)loading when the second line is
called. Such things take some time. Try fiddling with window.setTimeout() or
put some code in the framed page that signals the parent when loading is
complete.
Also, creating a temporary variable to refer to parent.frames.menu or even
parent.frames.menu.TreeView1 seems like a good idea.
hth
ivo
http://4umi.com/web/javascript/
May 18 '06 #2
Thank you for your reply. Here is my new idea

Goal:

I need to create an onclick event for a button. When click the button:
1. run code to refresh the menu frame:
parent.menu.location.reload(true);
2. run code to highlight a node in the menu frame

How:

Code:
function syncNode(id)
{
parent.menu.location.reload(true);

parent.frames("menu").TreeView1.CollapseAll();
parent.frames("menu").TreeView1.SelectNodeById(id) ;
parent.frames("menu").TreeView1.Render();

return true;
}

It won't work. Because when reload() the page lost the value of id
I guess if I can declare a sort of session variable in the html page,
then:
1. Every time I load the page, the page will check the session
variable's value (How to do this in aspx HTML code?)
2. In the onclick event, run another method:

Code:
function set_currid()
{
1. assign a new value to the sesstion variable
2. parent.menu.location.reload(true);
}

I also need to run another function somewhere in the page's HTML code
to do the highlight:

Code:
function highlight(id)
{
parent.frames("menu").TreeView1.CollapseAll();
parent.frames("menu").TreeView1.SelectNodeById(id) ;
parent.frames("menu").TreeView1.Render();
}

By doing this, because the page will have a new session variable
everytime it starts, so the it will highlight the node I want, whose id
is passed by the button's click event.

But please help, although I think this is the right way to do, I don't
know much javascript, can someone tell me how to write the code in
javascript/ and how to run the javascript in a html page?

Thank you very much.

May 19 '06 #3
Raymond wrote:
function syncNode(id)
{
parent.menu.location.reload(true);

parent.frames("menu").TreeView1.CollapseAll();
parent.frames("menu").TreeView1.SelectNodeById(id) ;
parent.frames("menu").TreeView1.Render();
Window::frames is a collection, not a method:

parent.frames["menu"]...
return true;
}

It won't work.
<URL:http://jibbering.com/faq/>
Because when reload() the page lost the value of id


Unless syncNode() is declared in the same frame that is reloaded by that
code, it should not happen, and probably you did something else wrong.
PointedEars
--
There are two possibilities: Either we are alone in the
universe or we are not. Both are equally terrifying.
-- Arthur C. Clarke
May 23 '06 #4

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

Similar topics

1
by: Follower | last post by:
Hi, I've run into an issue which seems to have been discussed previously on `python-dev` but only in context of Zope3: "Fun with 2.3 shutdown" -- Tim Peters...
5
by: Tim Morrison | last post by:
Is there any easy way to create a change script as illustrated below for all tables within a database? Right now I would have to create a seperate script for each table. I would like to be able...
1
by: cwdjrxyz | last post by:
I am now writing many new pages in xhtml 1.1. They are served as true xhtml by setting the mime type of the server to application/xhtml+xml for the .xhtml extension. Since IE6 and some earlier...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
1
by: Steve Richter | last post by:
have just installed the Microsoft script debugger for windows 2000: http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&displaylang=en ( notice the "this...
7
by: David Schwartz | last post by:
Does anyone know how I can call a function in a VB.NET DLL from Java script code? Thanks.
4
by: Kim | last post by:
Random image downloader for specified newsgroup. Hi I'm writing a small script that will download random images from a specified newsgroup. I've imported yenc into the script but I can't open the...
9
by: Jerim79 | last post by:
Here it is: <?php if($_SERVER=='POST'){ $Number=$_POST; $Email=$_POST; $Number2=0; $error=0;
1
by: anjanmaity | last post by:
Please help me if it is possible. I am working on a asp.net2.0(c#) project. I want that the admin section of my project will be run through internet whereas the frontend will be run in the intranet....
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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.