Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

Rob Hunter

Ranch Hand
+ Follow
since Apr 09, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rob Hunter

The same server is being used for the main html page (generated by a server-side Perl script) and the content within an iframe (a call to another Perl script on the same server). I have a perl script being called in my iframe. The script works fine, I've tried it on it's own within the browser and it works within the iframe EXCEPT when the script calls a query on a MySQL database that is rather lengthy. In my case I search my records that have IDs containing "11" (returns like 1,000 records) and it works fine. If I search for "1" only it should return like 5,000+ but instead I get a "The Connection was reset" message and that sad face icon. It does not take the error message long to come back, within 2 seconds so I'm left wondering what is causing this to happen and how I can fix the issue? If I redirect the output from the Perl script on the server to a file the content is completely sent there -  ruling out an issue with the script or aborting because of number of records or something.
And the answer (or type of answer) I wasn't hoping for :-) Thank you for the response, I'll give it a try. I was hoping that it be a more straightforward
When pasting content into a textarea I want to immediately evaluate "all" of the content in the textarea after a paste (using the mouse or key shortcut). How can I accomplish this? Onchange is not immediate enough, I need it to happen immediately following the paste when the content has already gone into the textarea. How can I accomplish this? The onpaste appears to happen before the content gets placed in the textarea. Any help would be appreciated.
.... so the lines in the numbered DIV element line up with the lines of the textarea (like an IDE)
Hey Bear, I'm familiar with :-) I have two DIV elements, one has numbers listed in it and separated by break elements, and the other has a text area. I want the "lines" DIV element to display next to the textarea and have the textarea display entirely BUT I only want them to take up so much of the screen. I have a container DIV element that is set to a certain size and has scrollbars on it to allow scrolling. The textarea I have the scrollbars turned off because I don't want a nested set of scrollbars as well. The issue is when I type in the textarea the content goes off the textarea but the scrollbar for the container doesn't change. I can maneuver up and down the textarea with no issues using the arrow buttons on the keyboard but the scrolling area remains "fixed" at the size of the original content of the DIV elements when the page loaded. Is there a way to "update" the status of the parent DIV element without having to reload the page or similar?
I'm won't get too in depth (unless asked) but I have a few DIV tags which includes a textarea. The textarea basically fully displays (no scrollbars) within a DIV element. The DIV element does has scrollbars. If I start entering into the textarea the content of the textarea is pushed downwards, out of sight because the textarea does not have scrollbars. Can someone suggest a way for me to keep things the way they are (DIV element does the scrolling) but have the textarea expand as needed? Hopefully that makes sense. I'm kind of scrambling to find a solution (note: I am still trying to find the solution on my own as well).
I have a box displayed in my canvas object. The box is a solid square that is 20px off from the edge of the canvas on all sides. I have a label that runs along the top of the box, middle of the canvas - 1/2 the width of the text to center the label and basically the y-coordinate is set to 18. I'd like text to run vertically up the side of the box as well starting at y-coordinate (1/2 of the height - 1/2 of the width of the text) with x being something like 18 as well. I can't seem to figure out how to do this, vertically display text along the side of the box, going up along the side. Any help would be appreciated.
Thanks for the note Bear. So you're suggesting to use HTML5 and JavaScript to draw images and labels along with various graphs (i.e. box and whisker, etc..,)? I was leaning towards actually trying to replicate the code in Flash - you think that's on it's way out as well or has it already begun? Any info you can pass on would be greatly appreciated since I need to determine the next step to take to handle all of this.

Rob
3 years ago
I've heard that Chrome and all other major browsers plan to follow suit on removing Java plugins from use within their browsers. I have a number of applet classes I've developed that generate various shapes and associated labelling, diagrams that use jFreechart, etc.., and I was wondering what approach should I take to ensuring my code still works? Will there be some sort of workaround or a possible solution in the works to handle this or should I take an entirely different approach to doing what I'm already doing in my applets. If so, what are my options? Thanks again.

Rob
3 years ago
I have a select list that when chosen from passes a value to an AJAX script that looks up other values. These additional values are then put into another select list. The user then chooses a value from this dropdown and submits the page. If the user uses the browser's back button (IE) the dynamically populated select list has no values. How can I preserve the values in this select list?
Hey Bear,
Yes, it prints this in the first 2 lines of the perl script that is called :



The remaining xml content is well-formed as well. This all works when "running" the webpage after going directly to it. The issues seem to lie with if an user goes "Back" to the page and the onblur event gets hit for the lookup field. If on the page and entering values and leaving fields it seems to work regardless. Coming back to the page it doesn't appear to work. Thanks for the reply as well, appreciate it.

Rob
I'm running a javascript in IE 11 and it is failing. I try doing the following in code :

If I do this :

I get null.

Someone else running it on IE 11 is getting past this and mainObj prints as [object].

What should I be doing here? Should I somehow parse responseText instead? I don't want to start changing all the code referencing mainObj.
I've also tried using inline, block, and a few others as well - still no luck.
"Does not work" => the element the id belongs to doesn't appear.
I'm using the following in all browsers and it appears to work in all browsers


afterwards I try doing the following



but that does not work in Safari. Any ideas why it doesn't work in Safari while it works in the other browsers? Version 5.1 of Safari.