Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. Um, I think you're on the right track. I would only suggest using an array to store your file names and then use the Date object to determine which file to display: var files = new Array();files[0] = "January2_100x76.gif";files[1] = "February2_100x76.gif";// etc...files[11] = "December2_100x76.gif";var month = new Date().getMonth();// I'm not familiar with "document.graphics[0]" but...document.graphics[0].src = files[month];
  2. I've found that the answer to that is no. I'm a .NET developer and had to write a little block of code to fetch the text file and then parse it to get the data I needed which I then wrote to the screen. I then used AJAX to get that data from my server.C#:string data = String.Empty;Uri url = new Uri("http://www.somewebsite.com/somefile.txt"); using (System.Net.WebClient client = new System.Net.WebClient()){ data = client.DownloadString(url);}// parsing went here...Response.Clear();Response.ContentType = "text/plain";Response.Write(data);
  3. jesh

    Scroll Bar in IE

    Try adding this in the head section: <style type="text/css">body { overflow: auto; }</style> EDIT: hmm, weird, I didn't see the post directly above this one when I wrote my response. The overflow: auto will get rid of the scrollbar in IE. Try this:body { overflow-y: scroll; overflow-x: hidden; }
  4. OK, how about this? <html><head><style type="text/css">body { margin: 0px; padding-bottom: 60px; }#Main { height: 100%; overflow: auto; background-color: #c00; }#Bottom { height: 60px; width: 100%; background-color: #0cc; position: absolute; bottom: 0px; }.Content { margin: 6px 12px; }</style></head><body><div id="Main"> <div class="Content">Main Content Goes Here</div></div><div id="Bottom"> <div class="Content">Bottom Content Goes Here</div></div></body></html>
  5. How about something like this: <html><head><style type="text/css">#Main { height: 90%; overflow: auto; background-color: #c00;}#Bottom { height: 10%; background-color: #0cc; }</style></head><body> <div id="Main">Main Content</div> <div id="Bottom">Bottom</div></body></html> The major flaw with this though would be the percentages used for the heights. This makes the bottom section grow/shrink depending on the size of the browser window. Benefit is that the main section scrolls while the bottom section stays put.
  6. That's correct and I totally agree. Technology, namely clean sources of running water, allowed our ancestors the ability to clean themselves and their surroundings which drove away the rats, which drove away the fleas, which lessened the risk of the BLACK DEATH. heh.Many of the diseases that had ravaged our ancestors are minor inconveniences for us today, party because of technology, partly through our own ability to become immune to them. Other diseases our ancestors didn't have to worry about because they weren't introduced until modern times because of the polution that is the byproduct of the production of technology (dioxins, trans fats, radioactive waste, etc). Others because we are lazy (because we rely on technology) and others yet because we are depressed and turn to smoking, drinking, etc. because, I believe, we have been separated from direct contact with humans and the earth because we rely on technology.This is fun.
  7. Technology has made it so that I can sit here, in this climate controlled office, listening to my digital music, typing on this plastic keyboard, communicating with you across an entire continent in total comfort and not have to worry about whether or not a wildfire, drought, or tornado is going to wipe out my garden/farm. It has also, however, made me (and I am guessing you) completely reliant on its existence. What happens if (when?) some catasrophe befalls our infrastructure and we lose power, transporation, water? Once the corner store runs out of bottled water, where are we going to get the water that we need to drink?Granted, technology can purify water so that it is drinkable, but the reason that we need that technology to purify our water is because of technology. It's still a curse in my book. And so, then, will end our primary source of plastics.
  8. Just to throw in an anarcho-primitivist viewpoint, the reason you aren't able to spend time with your family is because of advances like computers. The more technology that is introduced with the promise of making our lives easier and of making tasks take less time to accomplish, the more we are expected to stuff into our days, the more busy we become, the less lesiure time we have. Then there's all of the polution and waste generated because of technology (massive amounts of water to produce electricity, aluminum, silicon; all of the plastic, metal, etc being thrown into the landfills as more and more newer and "better" technology comes out).I count it as a curse. But, here I sit writing code all day - loving (almost) every minute of it.
  9. Hmm, I believe I ran into a similar problem with C# and ASP.NET. I needed to get data from a site which I needed to be logged into but the cookie wasn't being saved when I logged in. I believe the way I solved this was to use my server side script (rather than a frame) to log in to the other site and, using .NET's classes, was then able to get the cookie from the response and store that in some session/cache object. Then, whenever I sent a request to that server, I included the cookie in with the request.Perhaps this will work for you and maybe one of the PHP experts here can show you some sample code.
  10. You'll want to use the System.IO.File class. This link should help:http://msdn2.microsoft.com/en-gb/library/system.io.file.aspx
  11. If that's the case, something like this could work:protected void Page_Load(object sender, EventArgs e){ int num; string imagePath = String.Empty; if(Request["num"] != null) { int.TryParse(Request["num"], out num); } switch(num) { case 1: // num was equal to 1 imagePath = "somevalue.jpg"; break; case 2: // num was equal to 2 imagePath = "someothervalue.jpg"; break; case 0: default: imagePath = "default.jpg"; break; } // if you had <img id="myImage" runat="server" alt="" /> // in your page, you could use this to set the src. myImage.Src = imagePath;}
  12. Uggh. That one has never made any sense to me. You can use <link /> and <meta /> but not <script />.
  13. I remember seeing a hack somewhere that involved hiding the file input in a layer behind other form elements and then using javascript to make it act like a file input.The problem is that it currently isn't possible to style the file input element.Here's a link that might explain the hack for you: http://www.quirksmode.org/dom/inputfile.html
  14. jesh

    xhtml pre tag

    I assume you mean "\r" and "\n" rather than "/r" and "/n". You might also want to try "\r\n".You'd want to do that on your preview page. Rather than set the contents of your div tag to the value of your "content" string, set it to the value of the "content" string with the newlines converted.
  15. Hmm. Thanks for the feedback. I think I'll just have to use a server-side solution.
  16. I found a text file on the internet that displays the rainfall by hour for my neighborhood (it's been RAINING here in Portland) and it got me thinking about using that data for something.The problem is that it is just formatted text and is not an XML file and I have absolutely no control over the format or contents of this file.Now, I know that using ASP.NET, PHP, ASP, (insert your favorite server side solution here...) I can easily process that text file on my server and return it to my page in a way that I can use it. But I'd rather not go down that route yet.Anybody have any idea if it is possible to convert the contents of "somefile.txt" (publicly available on the internet, not on a client) to a string variable using only javascript?
  17. jesh

    xhtml pre tag

    If you want to display the text in a div, you'll have to use some string method to replace all of the "\n"s with "<br />"s. In javascript, it'd look something like this: document.getElementById("fc_content").innerHTML = content.replace("\n", "<br />");
  18. In javascript, you'd do something like this: var inputs = document.getElementsByTagName("input");var count = inputs.length;var input;for(var i = 0; i < count; i++){ input = inputs[i]; if(input.type == "text") { // do what you need with the text box here }}
  19. jesh

    Confusing SQL query

    Isn't that what I said?
  20. You could put something like this in the head: <style type="text/css">body { font-weight: bold; }</style>
  21. I would suggest putting your texts into an array and then using the modulus operator and setInterval() or setTimeout(), you can cycle through the elements in the array. On mouseover, you can clear the timout/interval (clearInterval(), clearTimeout()) so that it'll stop cycling and then on mouseout, you can start the interval again.
  22. What is the code for your wipegraffitiwall() function?And what happens if you just visit ./includes/graffiti.php?painttext=&adminreset=1&userwallwiped=1?
  23. Since you aren't actually POSTing any code to your PHP page, you might try using GET instead. Try changing your code from: xmlHttp.open("POST", url , true)xmlHttp.send(null) to: xmlHttp.open("GET", url , true);xmlHttp.send("");
  24. jesh

    Starting A Website

    Nice quote!I generally start by mapping out the entire site on paper - trying to get as much of the requirements spec'd out before I write a single line of code. Then, looking at the map, I start on the section(s) which has the least amount of dependencies. For example, if I'm making a site which requires users to log into an account in order to use the site, just about every page will depend on that user account. So, I would start by making the create/edit user forms and a login page before I move on to pages that require the user to be logged in.
×
×
  • Create New...