468,483 Members | 2,514 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,483 developers. It's quick & easy.

Calling function from within function display

I have a function that displays a list extracted from a table using
document.write. In the displayed list I want to have a link that will
call the same function but display the list in reverse.

Click HERE to reverse
A
B
C

When HERE is clicked the page will redisplay as

Click HERE to reverse
C
B
A

One of the function's parameters will tell it the sequence to display.
My question is what is the best way to code the link? Clicking on HERE
will call a function.

I've tried <a href="javascript: xxx(xxx)">HERE</a> but it doesn't work.

--
Dennis M. Marks
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #1
3 1478
In article <24*************************@dcsi.net>, Dennis M. Marks
<de******@dcsi.net> wrote:
I have a function that displays a list extracted from a table using
document.write. In the displayed list I want to have a link that will
call the same function but display the list in reverse.

Click HERE to reverse
A
B
C

When HERE is clicked the page will redisplay as

Click HERE to reverse
C
B
A

One of the function's parameters will tell it the sequence to display.
My question is what is the best way to code the link? Clicking on HERE
will call a function.

I've tried <a href="javascript: xxx(xxx)">HERE</a> but it doesn't work.


I have found what I think is the problem and I need to know if there is
a solution. The generated page is in an iFrame. Can a link in an iFrame
call a function in the parent page?

The page http://www.dcs-chico.com/~denmarks/amtrak.html will show the
structure of the page but the new code is not there yet. The link will
appear above the stations displayed in the right iFrame and will cause
them to be redisplayed in reverse.

--
Dennis M. Marks
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #2
Yes of course a child frame can call a method in its parent or even in a
sibling frame. Just reference the window name that contains the desired
method.

In your case your call would simply be:

parent.xxx();

regards
Mike
"Dennis M. Marks" <de******@dcsi.net> wrote in message
news:241220031759316418%de******@dcsi.net...
In article <241220031743559107%de******@dcsi.net>, Dennis M. Marks
<de******@dcsi.net> wrote:
I have a function that displays a list extracted from a table using
document.write. In the displayed list I want to have a link that will
call the same function but display the list in reverse.

Click HERE to reverse
A
B
C

When HERE is clicked the page will redisplay as

Click HERE to reverse
C
B
A

One of the function's parameters will tell it the sequence to display.
My question is what is the best way to code the link? Clicking on HERE
will call a function.

I've tried <a href="javascript: xxx(xxx)">HERE</a> but it doesn't work.


I have found what I think is the problem and I need to know if there is
a solution. The generated page is in an iFrame. Can a link in an iFrame
call a function in the parent page?

The page http://www.dcs-chico.com/~denmarks/amtrak.html will show the
structure of the page but the new code is not there yet. The link will
appear above the stations displayed in the right iFrame and will cause
them to be redisplayed in reverse.

--
Dennis M. Marks
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Jul 20 '05 #3
Dennis M. Marks wrote:
I've tried <a href="javascript: xxx(xxx)">HERE</a> but it doesn't work.


Besides of the iFrame issue, please read the FAQ about `javascript:'
URIs and <3F**************@PointedEars.de> about "doesn't work".
PointedEars
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by John J | last post: by
3 posts views Thread by Glenn C. Rhoads | last post: by
21 posts views Thread by Joakim Hove | last post: by
4 posts views Thread by Martin Feuersteiner | last post: by
13 posts views Thread by ukrbend | last post: by
1 post views Thread by evanburen | last post: by
2 posts views Thread by Joerg Battermann | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.