• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Wylbur

  • Rank
  1. Hi, I suppose that you know that Angular version 2 is out? Is a new section being created for it? If so, when would it be ready to go online? Have you looked at "Aurelia"? http://aurelia.io/ Are there any plans to add a section for that? Inquiring minds want to know.
  2. Hi Dsones OK - now I see. From what I can determine, it looks as if height and min-height will override each other, using whichever is the largest. In furtherance of my experiment, I switched to span, with display : block. It doesn't look like there is any difference from div. Please correct me if I am wrong. I've also switched to 'em' for size specifications. From all of this, I don't see the point of the example that I referenced within my original post, and what it is intended to demonstrate: http://www.w3schools..._dim_max-height This is the state of my code at this point: <!DOCTYPE html> <html> <head> <style> .group:after { content: ""; display: table; clear: both; } .container_tag { min-height : 28em; height : 24em; max-height : 38em; min-width : 30em; max-width : 57em; background-color: lightgreen; foreground-color: black; margin : 20px; border : solid; clear : both; display : block; } </style> </head> <body> <span class='container_tag group'> <h2>Set the max-width of an element</h2> <p>This div element has a height of 100px and a max-width of 500px:</p> :::------------------------------------this is some text : 1------------------------------:::<br/> :::------------------------------------this is some text : 2------------------------------:::<br/> :::------------------------------------this is some text : 3------------------------------:::<br/> :::------------------------------------this is some text : 4------------------------------:::<br/> :::------------------------------------this is some text : 5------------------------------:::<br/> :::------------------------------------this is some text : 6------------------------------:::<br/> :::------------------------------------this is some text : 7------------------------------:::<br/> </span> </body> </html> If there is nothing more to investigate, then I'll leave it at that. THANK YOU for your responses!
  3. Hi Dsones, THANKS for the response! I took out the inner div. The outer (only) div still does not resize vertically when I shorten the window/browser. The only thing that will increase the height of the div is to increase the value of min-height, as changing max-height doesn't seem to have any effect. Am I correct in stating that max-height doesn't do anything to div? What effect (purpose) does max-height have?
  4. Hi D Sones Thanks for the response. I've been experimenting with this, and I cannot get the height to behave in the same way as the width when I reduce the size of the window/browser. (The modified code is inserted below. I now have two "div" tags, with one nested inside the other.) To be more explicit: When I reduce the width of the window/browser, the boxes for the "div" tags narrow as well, to the point that the min-width is reached (which is expected). When I reduce the height of the window/browser, the height of the boxes do not change at all. How would I get the same behavior for height as I do with width? <!DOCTYPE html> <html> <head> <style> .outer_div { /* height : 400px; */ min-height : 400px; max-height : 700px; min-width : 300px; max-width : 900px; margin : 20px; border : solid; } .inner_div { /* height: 220px; */ min-height: 220px; max-height: 280px; min-width: 400px; max-width: 700px; background-color: powderblue; foreground-color: black; border : solid; margin : 20px; /* clear : both; */ } </style> </head> <body> <div class='outer_div'> <h2>Set the max-width of an element</h2> <p>This div element has a height of 100px and a max-width of 500px:</p> <div class='inner_div'> :::------------------------------------this is some text : 1------------------------------:::<br/> :::------------------------------------this is some text : 2------------------------------:::<br/> :::------------------------------------this is some text : 3------------------------------:::<br/> :::------------------------------------this is some text : 4------------------------------:::<br/> :::------------------------------------this is some text : 5------------------------------:::<br/> :::------------------------------------this is some text : 6------------------------------:::<br/> :::------------------------------------this is some text : 7------------------------------:::<br/> </div> </div> </body> </html> Thanks!
  5. Hi All; The height element does not seem to be working as expected for the following example: http://www.w3schools.com/css/tryit.asp?filename=trycss_dim_max-height When I resize the window/browser, the div element does not change in height. I made a few changes to the code, adding a "border" to show the box better: <!DOCTYPE html> <html> <head> <style> div { max-height: 600px; min-height: 200px; background-color: powderblue; border : solid; } </style> </head> <body> <h2>Set the max-height and min-height of an element</h2> <p>Resize the browser window to see the effect.</p> <div>This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</div> </body> </html> Any ideas as to what the issue is? ... or am I missing something here? Thanks!
  6. Basically, if I could determine when the back and forward buttons were clicked (with Javascript) I'd probably have what I need to resolve my issue. It would be nice if there were "onbackbutton" and "onforwardbutton" event handlers, but I've yet to find anything that would fill those roles. I'm hoping that someone might give me a clue on something that I've overlooked. I see that there's a "window.onpopstate" event, but it doesn't seem to be doing anything for me as of yet. I'm going to keep playing with it.
  7. A button click event handler. (This is generated by a server-side button control.)
  8. Hi Dave; I've seen those. The first one applies to server-side functionality. The problem is that, when the back button is pressed, it does not trigger a postback event, so whatever server-side code there is won't be executed. The second one looked good at first, but it only applies to AJAX/Updatepanel/asynchronous postbacks. It threw an exception when I tried it on a just plain synchronous postback. THANKS for the response!
  9. Hi;I'm developing a web app in ASP.NET that loads controlsdynamically on a page (depending upon user responses).Handling the back button has been giving me fits.Apparently, there is no handler for that.(If I'm wrong about that, then PLEASE correct me.)What I want to do is to trigger a postback on the back button.(This must be done. There are no alternatives.)I'm trying to detect the "back button state" to accomplish this.The first thing I tried was to keep a running count ofrequest/response cycles and comparing it to window.history.length.If the two are different, then it might be assumed that the backbutton had been clicked.That didn't work. On the first back button click, both countsincreased, remaining equal.My next idea was to write Javascript code to a label that willset a boolean to true if a postback has occurred.In my Page_Load handler, I have the following: this.lblJavaScript.EnableViewState = false; this.lblJavaScript.InnerText = "postback_made = true;";This is the tag for the element: <span class="CI12_test" id="lblJavaScript" name="lblJavaScript" runat="server"></span>(This tag is positioned above the form and within the body.)In the function that handles the onload event in Javascript,I have the following: var js_code = document.getElementById("lblJavaScript").innerHTML; var ev = window.eval (js_code); document.getElementById("lblJavaScript").innerHTML = "postback_made = false;"The problem that I'm having is that, when the back button is clicked,the "lblJavaScript" element is reset to its original value("postback_made = true;"). I tried moving the code for clearing the switch into a function thathandles the "onbeforeunload(e)" event.That didn't work.(FYI: The "onbeforeunload" event fires every time, whether on a postbackor back button click.)Apparently, the values for the elements within the DOM are being cachedand reloaded on a back button event.Since I'm not quite the biggest idiot in the world, I decided that thenext thing to do would be to shut off caching. I added the following code to my Page_Load event handler: if (!IsPostBack) { Response.Buffer = true; Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1441; }That does nothing.I added the following code to my Page_Load event handler:Response.Cache.SetCacheability(HttpCacheability.NoCache);Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));Response.Cache.SetNoStore();When I clicked on the back button, I was left with "Webpage has expired".I added the following meta tags near the top of the page:<meta http-equiv="Cache-Control" content="no-cache"/><meta http-equiv="Pragma" content="no-cache"/><meta http-equiv="Expires" content="0"/>That did nothing.So the question is: How would someone determine if the page beingloaded is due to a postback or a back button click?Alternatively, how would someone force a postback on a back button click?Any advice on this would be greatly appreciated.
  10. Hi Guy; This could very possibly work, but, unless I'm mistaken, I'd need something in the wayof a server to send the response. As things stand now, there is no server involvement.THANK YOU for the response!!!
  11. Not-so-great if it doesn't work on the first go-round, or if I need to put in a call tothe "alert" method in order to get it to work every time. That doesn't really help me, as the "setTimeout" method works asynchronously, so the objectthat needs to be instantiated from the class defined within the dynamically loaded codeis still null when it gets used later in the code. I cannot utilize the object from withinmethods called later in the execution sequence from the timed method set from the"setTimeout" method (so that isn't a viable option in case you were thinking along those lines). ... unless I'm being dense (again) and not thinking of something that most smart people wouldthink of.Otherwise, I'm still in want of a "wait" method that will halt execution until the objectis (actually) instantiated.THANK YOU for the response!!! ... and say "HI" to Deirdre for me.
  12. Ah - thank you for setting me straight on that. That's what I was thinking. That would not be possible under the set of circumstances that I'm operating with. I was thinking the same thing (but it wasn't working right as I made a mistake with the catch partbefore you set me straight).I had to fiddle with it a bit before I got the click handler to execute without blowing up.I have now reached the point to where I am getting a legitimate error message - again - on theinitial page request (then it works fine after that). I've set a counter variable to zero, thenincremented it with a for-loop on the try-catch structure.It loops through 0x0008fff0 iterations before giving an error message (and takes a while in doing it).The click handler now looks like this: var sumthin = null; var ld_cntr = 0; var stop_val = 0x0008fff0; load_js_code_from_file ("file:///C:\\Javascript\\Sum_code.js");//alert ("loaded"); for (; ld_cntr < stop_val; ld_cntr++) { try { sumthin = new x_class (); ld_cntr = stop_val; } catch (e) { } } if (ld_cntr == stop_val) alert ("error"); As before, if I uncomment the alert method at the first of the handler,it works just fine. If I don't, then it issues the alert on the conditional("if (ld_cntr == stop_val)").THANK YOU for the response!!!
  13. Hi Guy; That's a good question, and one that I have asked myself.Since I made the initial post, I tried appending the script node tothe children of the head tag, and that didn't work either - I got thesame behavior as before (it fails on the first call, but works finewith every call thereafter).I then tried the "insertBefore" method to make it the first script nodein the head tag, but I got the same result.This is the current state of the insertion method, with what had beentried before commented out:function load_js_code_from_file (js_code_file){ // var parent_ref = document.getElementById ("theForm1"); var parent_ref = document.getElementsByTagName("head")[0]; var new_js_node = document.createElement ("script"); new_js_node.setAttribute ("language", "javascript"); new_js_node.setAttribute ("src", js_code_file); // parent_ref appendChild (new_js_node); if (parent_ref firstChild) parent_ref.insertBefore (new_js_node, parent_ref.firstChild); else alert ("parent_ref.firstChild is NULL!"); // alert ("js_code_file::" + js_code_file + "::"); js_code_is_loaded = true;} I'm getting the same behavior from both the appendChild methodand the insertBefore method: It doesn't work the first time(on the initial page request), but it does every time afterwards,unless I put in a call to the alert method (and it works every timewhen I do that).I'll tell you something else that's odd. When I try to catchthe thrown exception, it doesn't work at all: var sumthin; load_js_code_from_file ("file:///C:\\Javascript\\Sum_code.js"); // alert ("js code loaded"); try { sumthin = new x_class (); } catch { alert ("Somethin went wrong!"); } As I mentioned in my initial post: When I put in calls to the alert method,it works every time (the initial page request inclusive). I'm guessing thatthe alert method gives something the time it needs to get done whateverit is that it needs to get done before the object is instantiated.THANK YOU for the response!!!
  14. Hi all;I'm trying to dynamically load javascript from a file with a click handler.The code is for a class function.I'm instantiating an instance of the class from the click handler.It doesn't work the first time I call the "constructor" function,but it does work the second time.If I put in a call to the "alert" method, it works the first time (and every time).From this, it would be logical to conclude that the code being loadedisn't being given time enough to load and be implanted within the DOMstructure for the page before it's called.How can I get the click handler to wait for the code to get established?What follows is the code for the method that inserts the tag to loadthe java script: function load_js_code_from_file (js_code_file){ var form_ref = document.getElementById ("theForm1"); var new_js_node = document.createElement ("script"); new_js_node.setAttribute ("language", "javascript"); new_js_node.setAttribute ("src", js_code_file); form_ref.appendChild (new_js_node); // alert ("js_code_file::" + js_code_file + "::"); return true;} This is the click handler: load_js_code_from_file ("file:///C:\\Javascript\\Sum_code.js"); // alert ("js code loaded"); var sumthin = new x_class (); THANKS!
  15. Hi all;Problem solved.Thanks for reading.