Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. Is this for a .NET website? If so, maybe you could create a PageHandlerFactory to handle all of your requests. Something like this:using System;using System.Web;using System.Web.UI;public class MyPageHandlerFactory : PageHandlerFactory{ public MyPageHandlerFactory() { } public override IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated) { if(context.Request.Url.AbsolutePath.EndsWith(".aspx")) { // return the default page handler return base.GetHandler(context, requestType, url, pathTranslated); } else { // return your forbidden handler return new ForbiddenRequestHandler(); } }} And an HttpHandler: using System;using System.Web;public class ForbiddenRequestHandler : IHttpHandler{ public ForbiddenRequestHandler() { } public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { context.Response.Redirect("403.aspx"); }} And then add this to your Web.config file: <system.web> <httpHandlers> <add verb="*" path="*" type="MyPageHandlerFactory" /> </httpHandlers></system.web>
  2. Your CSS isn't valid. Try this instead: <head><style type="text/css">.TableLayout { width: 100%; height: 50px; }</style></head><body> <table class="TableLayout"> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </table></body> Notice that it is "head" rather than "header" and the properties and values in the CSS are separated by colons rather than equals signs. Additionally, you shouldn't put any quotes in the CSS.
  3. AAAHH IE!I just found this, it might help: http://www-128.ibm.com/developerworks/web/...ry/wa-ie2mozgd/
  4. Instead of writing an almost identical function for each img, you might try writing two functions instead. If all of your image paths end in "_1" for "off" and "_2" for on, you can do this: function handleMouseOver(obj){ var src = obj.src; if( src.indexOf("_1") > -1 ) { obj.src = src.replace("_1", "_2"); }}function handleMouseOut(obj){ var src = obj.src; if( src.indexOf("_2") > -1 ) { obj.src = src.replace("_2", "_1"); }} Then, to call the functions, you can do this: <img src="theimagepath_1.gif" onmouseover="handleMouseOver(this);" onmouseout="handleMouseOut(this);" /> Check out the HTML DOM if those functions aren't making sense. Also, if you wanted, since those two function are themselves so similar, you could combine them into a single function, but I'll leave that up to you.
  5. Bummer. I hadn't thought of that.
  6. @aspnetguy - Would this also work? var iframe = document.getElementById("theIFrameID");var code = iframe.document.body.innerHTML;
  7. http://www.w3schools.com/htmldom/prop_classname.asp
  8. In the first code, your display function looks like this (four parameters): function displaydesc(which, descriptionarray, catagoryarray, container) But when you call the function in the select, you call it like this (three parameters): onChange="displaydesc(document.form1.select1, thetext1, 'textcontainer1')" You should probably change it to this: onChange="displaydesc(document.form1.select1, thetext1, catagory1, 'textcontainer1')" Just FYI, these two pieces of code are the same: <select name="select1" onchange="someFunction(document.form1.select1);"> <select name="select1" onchange="someFunction(this);">
  9. Additional to what has already been said, if you want to have a site that can handle as much traffic as youtube.com, you're going to need to have servers spread all over the world. Folks accessing the site from the western half of North America might access a server in California while those accessing the site in Germany may need to connect to a server in Italy or something. If you only have one cluster of servers, the farther the users are away from the servers, the slower the connection is going to be for those users.
  10. jesh

    Whoa...

    HA! I seemed to have left it at home this morning. Maybe I'll get it at lunch. Thanks for the link!
  11. jesh

    Whoa...

    Do you have a link that supports that? I'd be interested in reading it. I was under the impression that electromagnetism (i.e. light) travels at 3 x 10^8 m/s and nothing can travel faster than that. That is, unless you are entering the realm of quantum physics where things travel around all willy-nilly.
  12. Hmm, so I ran a little test and came up with this: <html><head><script type="text/javascript">function TestClass(){ var date = new Date(); this.getDate = function() { return date; }}var myTest;var display;function runTest(){ myTest = new TestClass(); display = document.getElementById("display"); display.innerHTML = myTest.getDate() + "<br />"; setTimeout("delayTest();", 10000);}function delayTest(){ myTest.date = new Date(); display.innerHTML += myTest.getDate() + "<br />"; display.innerHTML += myTest.date;}window.onload = runTest;</script></head><body><div id="display"></div></body></html> Because I set up the "date" member with var, you can't access it outside of the class (TestClass). So, the only way you can get at that member is by calling the getDate method. However, when I called myTest.date = new Date();, a new public member was created called "date" and the new Date is stored in it. As you can see by the test, the "myTest.getDate()" method returns the untouched property while the "myTest.date" returns the newly created public property.When I run this code, it displays (after ten seconds) the following: Wed Dec 06 2006 13:51:23 GMT-0800 (Pacific Standard Time)Wed Dec 06 2006 13:51:23 GMT-0800 (Pacific Standard Time)Wed Dec 06 2006 13:51:33 GMT-0800 (Pacific Standard Time) It could be a start.
  13. jesh

    Lines

    Is the element itself deprecated or just the "presentation attributes"?http://www.w3schools.com/tags/tag_hr.asp says:
  14. You're on the right track for opening a new window. I would only add the following: var props = "toolbar=no,location=no,directories=no,status=no,menubar=no,";props += "scrollbars=no,resizable=no,copyhistory=no,width=50,height=50";var wnd = window.open('', 'myImage', props); This way, you'll have a reference to the window object in the "wnd" variable.You'll need to use the HTML DOM for the rest of it. The next step would be to get at the document object for the new window so that you can write contents to the new window: var doc = wnd.document;doc.open("text/html", "replace");doc.write("<html><body style='margin: 0px;'><img src='" + theImagePath + "' id='theImage' /></body></html>");doc.close(); Then you'll get at the image object in that document to see what size it is: var img = doc.getElementById("theImage");var width = img.width;var height = img.height; And finally, you can use the resizeTo method of the window object to resize your popup window: wnd.resizeTo(width, height);
  15. jesh

    Lines

    <hr />s work well but I sometimes have a hard time using CSS to make them look how I want them to look. So, sometimes, I use this instead:<div style="height: 1px; overflow: hidden; background-color: #000000;"></div>
  16. I've never used AJAX like what you have so I can't say if there's something in this code that fails. However, I've always had great luck using it like this:var page_request;function ajaxinclude(url){//var page_request = false; // moved this to a global....page_request.onreadystatechange = handleRequest;page_request.open('GET', url, false); //get page synchronously page_request.send(""); // note "" rather than null}function handleRequest(){ if(page_request.readyState == 4) { if(page_request.status == 200) { document.write(page_request.responseText); } }}
  17. jesh

    vb.net with access

    I see two possible explanations. The first would be your connection string. Are you able to retrieve data from the database using that connection string? I'm not sure about VB, but in C# "\n" is the special character for a newline. Maybe the "\N" in "\Nwind.mdb" is causing the problem.More likely, however, it's because of your query. There is no space between the first set of parentheses and the VALUES keyword. The query is coming out like: INSERT INTO Categories (CategoryID,CategoryName,Description)values(... Where it probably ought to be: INSERT INTO Categories (CategoryID,CategoryName,Description) values (...
  18. jesh

    BG \ Div problem

    The first thing I would recommend is that you don't use numbers as the ids for your elements. Use something like this instead: <div id="d1">(contents here)</div> <div id="d2">(contents here) </div><div id="d3">(contents here)</div> Also, if you are using url() in the CSS, try doing it without quote-marks: background-image: url(image1.ext);
  19. jesh

    Body:

    Really, it's color, not font-color. Check out this page: http://www.w3schools.com/css/css_text.aspThis is the correct way to do it:h1 { font-size: 29px; color: red; }
  20. That's just the way my version of Visual Studio (2005) created the master page. Just like any website, you don't need to use XHTML.
  21. @justsomeguy - Nice looking array!Maybe you could add a mountain range. ...................................***................*****...............*****...............*****................***..........................^..................^^^.................^^.................^^.................^^.................^^^.................^^............~~....^......~.....~~~~.........~~~...~~~~~~........~~~~~~~~~~~~.........~~~~~~.~~~~..........~~~~...~~.......................
  22. Can you use a switch? DropDownList subList;switch(DropDown1.SelectedValue){ case "A": subList = DropDownA; break; case "B": subList = DropDownB; break; case "C": subList = DropDownC; break; // more options...}string optionValue = subList.SelectedValue;
  23. jesh

    Hover tag problems

    First, try changing a.menulink:hovor to a.menulink:hover.
  24. jesh

    Whoa...

    Yeah, it's hard to grasp. If a spaceship is crusing along at 99% of the speed of light and the captain turns on some headlights (or fires a laser), the light being emitted from those headlights (or the giant laser) would move away from the spaceship at the spead of light. Meanwhile, an observer watching this whole thing take place on a moon below would see the beam of light from the headlights traveling away from the spaceship also at the speed of light (rather than 1.99 times the speed of light).The difference in the two situations is how distance and time are measured. The observer on the planet would record much more time having elapsed than the captain in the spaceship.
  25. Any luck with this yet? The only thing I can think of is to use your first query to return multiple rows: Inv# Con# ItemID Yr Price Price Level PL Desc Flat Price31 51 Item1 249.99 18 Price Level 18 219.9931 51 Item1 249.99 19 Price Level 19 199.9931 51 Item1 249.99 20 Price Level 20 189.9931 51 Item1 249.99 21 Price Level 21 159.99 And then, if you are using .NET, generate a DataTable with the appropriate columns and then iterate through all of the records and populate your DataTable. DataTable rawData = new DataTable(); // this is the one holding your dataDataTable table = new DataTable();table.Columns.Add("Inv#", typeof(int));table.Columns.Add("Con#", typeof(int));table.Columns.Add("ItemID");table.Columns.Add("Yr Price", typeof(float));string rowname;foreach(DataRow row in rawData.Rows){ rowname = "PL " + row["Price Level"].toString() + " Price"; if(!table.Columns.Contains(rowname)) { table.Columns.Add(rowname, typeof(float)); }} Once you have all the columns, you can populate the DataTable with your data.A bit more overhead than having a single query, but it'd work. I'd be interested if you find out how to write the query.
×
×
  • Create New...