laziness, impatience, and hubris | |
PerlMonks |
Re^6: send windowmessage from cgi back to form that called the cgiby tultalk (Monk) |
on Mar 15, 2017 at 12:51 UTC ( [id://1184692]=note: print w/replies, xml ) | Need Help?? |
Ok. "and Gad it takes me time to work out the bugs in this stuff. "what do you mean ME kemosabe" " Us for a lesser portion. My problems have been massive. You say: "I still think you do want to do things onload to get your alert box" I still don't understand what you are implying. There is nothing to call to be put in the iframe on the parent page onload event. The database queries have not been run at that point so no results. Obvious thanks to you guys. Your comment "ok for starters add this above "function onMessage" There is no message event because I can't figure out how to send a message back to the form from perl. So I don't understand what you are trying to demonstrate. The calls through cgi to update the tables and return data sets work fine. They are all disabled so the calls will only return message with out actual execution of the database queries. As I started out, my fundamental problem is sending a wm to the form triggering a call to get the result message and show it in the iframe as demonstrated by clicking the test button. I hate things like polling but I can see no other way than starting a polling loop checking the value of a global variable set in the script when the original function call to do the database stuff finishes. When the variable (flag) is set the polling picks it up and calls the function to load the results into the iframe. I have looked at various "watch" examples that don't work and others that use a listener but all seem invoving sending a message to the window. Also looked at module for embedding javascript into perl but gave up. Simple polling loop started when original cgi command sent to script seems the way to go. I don't understand this statement: Aparently not, it just replaced the main page it seems. Are you saying that when you tested it live it just replaced the page with a new page and not put the result in the iframe
In Section
Seekers of Perl Wisdom
|
|