Graphs

1

1066

I've created a wizzy Javascript function embedded within PL/SQL that
generates html bar charts. I would like to know if it is possible to get the
javascript function to write another javascript function (embedded in
PL/SQL) so I can do mouseover and display the values?
 
K

kaeli

I've created a wizzy Javascript function embedded within PL/SQL that
generates html bar charts. I would like to know if it is possible to get the
javascript function to write another javascript function (embedded in
PL/SQL) so I can do mouseover and display the values?

That would highly depend on the way it was written and when it runs on
the client.

If it runs after the page loads, you know the names or ids of the
mouseover elements, and you know your users' browsers support
dynamically adding events, yes, it can be done.

But...why?

If you have the script on the page when the client needs it, you can
just add the mouseover code right to the html. Maybe you want it so
anyone can include it, I suppose...but if that were the case, your
script wouldn't know the ids of the elements to add the event handler
to.

Hrm. Need more info.

--
 
1

1066

What i'm saying is I can't seem to get the script on the page
The technical structure is as follows:

Pg1 - Form to gather request

Pg2 (hidden) - PL/SQL gathers data and submits it in another form to
graphing package.

Pg3 - onLoad event on inital graphing page calls Javascript function "Draw
Graph"
Javscript function writes html and unfortunately seems to ignore the other 2
functions (mouse over, etc) to be loaded. Is this because a new 'document'
is being written?

This has led me to ask if I can get the javascript to write another 2
javascript functions.
 
K

kaeli

Pg3 - onLoad event on inital graphing page calls Javascript function "Draw
Graph"
Javscript function writes html and unfortunately seems to ignore the other 2
functions (mouse over, etc) to be loaded. Is this because a new 'document'
is being written?

Only if you're using the archaic (but necessary if supporting NN4)
document.write function. Document.write will wipe out the document.

Are you?

Do you need to? That is, do you know your users? If so, do they use NN4
or can you say they use NN6+/IE5+?
If you need to, you'd have to modify the document.write so it writes to
a layer instead of to the document root. That way, it'll wipe out the
"document" in that layer, which would have been blank anyhow.
If you don't need to, get that out of there and move to either using
innerHTML or document.createElement/appendchild DOM functions.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top