• Content count

  • Joined

  • Last visited

Community Reputation

134 Neutral

About EvilCrap

  • Rank
    Advanced Member
  1. [web] componentized html

    Yes, this is what I want to do I guess. Earlier I had my mind wrapped around the document.write.
  2. Whats the best way to go about creating html/javascript components? Ive thought to do this: <iframe id="ifcomponent1"></iframe> <script language="javascript"> component1= new Component( "ifcomponent1", params ); </script> where we create an iframe, and then let the component write out its contents to it. however, it would be cooler to do something like this: <script language="javascript> component1 = new Component( params ); </script> where the component will write out its own iframe and then its components. The problem here though is that the page would refresh and start some strange recursion. How are html/javascript components normally done?
  3. [web] document.open

    getElementsByTagName("body")[0].innerHTML works great.
  4. Ok, the problem was not with the window/opener code, that is just fine. The problem is that a few lines earlier, I load and make use of an xml document. I guess that sometimes the document doesnt load properly or in time, and then an error occurs a short time later, after the pssc.html onload is called. When I remove the XML code, or specifically, when i stop setting the window title to a value from the xml file, the unspecified error seems to go away. It could also make sense that it works from file, as disk access is a lot quicker than the network. I've adjusted my xml checking code, and everything is working again.
  5. I'm getting this unspecified error, which seems to happen maybe 40% or 50% of the time when Im fetching my pages from the server, but this doesnt seem to happen when I'm fetching them from file. Ive tracked down the error, it happens just after an onload event, and just before a timer event, set in the onload event. The error occurs during the browser's do-events time I beleive, but I dont think I've corrupted any memory or used up the stack space. And again, this happens maybe 50% of the time, so I can have errorless streaks, or I can have streaks of errors! My webpage only works in IE because I use screenTop/left property. I've written some code that concerns me, and could possibly be the source of the problem: ... window.pssc_getX=function(){ return x;} win.open( "pssc.html", winid, attributes ); ... then in pssc.html.onload: if( window.opener.pssc_getX != undefined ) x = window.opener.pssc_getX(); moveTo( x, y); setTimeout( finishLoad, 200 ); //an empty function ... end of function, error happens between here and finishLoad() Does anyone have experience with getting unspecified errors when using the window and window.opener like this? I've tried using MS Script debugger, which was really disfucntional, but breaks on a line that is normally not executed when the error occurs. Is what I'm doing with window/opener a hack, or is it desinged to be used this way?
  6. document.open seems to erase all of the current html. Is there a way to fetch the html before an open, so that I can write it back out with other stuff? For instance, I would like to preserve style definitions in the header, and various inputs in the body, but I would like to write out additional inputs.
  7. Is there a method to get a window or popups x and y position, relative to either the screen or a parent window? I imagine this is some non-portable html element, which one?
  8. cin only seems writable when its doing a block.
  9. No, I have Java program and a C++ program. The Java program writes to the C++ program's cin, and reads the cout and cerr. I am able to read the Java input if i do cin, get, or peek, but these block, and I want non-block. For some reason, readsome returns zero all the time, and in_avail() also returns zero, while cin and such do not. I am looking for a way to poll std::cin and not block.
  10. I need to test std::cin to see if its ready to be read, without blocking, how do I do this? cin.peek doesnt work, as it blocks. for example: if( stream_has_chars ){ char c=0; c =std::cin.get(); if( c == 'q' ){ break; } } Is there a bit of code that works as stream_has_chars? cin is being sent data by another program writting to the stream.
  11. A guy asks how to add strings, do you really think hes going to be able to get boost to work? Id think that stringstream is the easiest most robust choice vs the C routines.
  12. each compiler that ive worked on has supported ellipses (...) in the catch statement, and as a function parameter. So your answer is no, this is not microsoft specific.
  13. port device class

    fstream does a good job.
  14. Im going to have lots of popups, slideshows, on a multimonitor system.
  15. The problem was specifically on ie, even though all of the anti popup stuff seemed to be disabled. Ie seems to limit popups to events, and only one popup per event, subsequent popups were not created. Its possible that the version I was using just wasnt patched up. The code that warhammerdude posted would run fine on mozilla though. It turns out that this isnt much of a problem though.