Jump to content

Pollux

Members
  • Posts

    102
  • Joined

  • Last visited

Everything posted by Pollux

  1. Try this: <% ' Retrieve directory from filesystem. Set FS = Server.CreateObject("Scripting.FileSystemObject") Set Dir = FS.GetFolder(Server.MapPath("/foldername")) ' Write out the name of each file in directory. For each fileItem in Dir.files Response.Write(fileItem.Name) Next%>
  2. If you're still talking about the HTML window (that window.open will give you) popups, then the answer's "sort of". The content of the window that is opened is simply another HTML document so you can put any onmouseovers you want within that - on images, tables etc. But you cant put an onmouseover on the actual window, because the window is part of the browser.
  3. That code does show you how to capture a right mouse click though. But instead of opening an alert, you need to call a function to perform the popup. If it's just a new html window you want to popup, then the function will need to contain a statement something like this: window.open("somepage.html", "windowname", "width=300, height=150"); Theres lots of other properties you can use as well as width and height. You can control whether toolbars, menubars and scrollbars are shown, set screen position etc. You'll be able to find a complete list easily with a quick search on google.If I've misunderstood what you're looking for as well, then try explaining again and we'll see if we can be more helpful.
  4. Pollux

    Fade-In

    I'm glad you approve
  5. Pollux

    Fade-In

    I've put the code into a slightly more usable format for you. Although it could still do with a bit of attention really. One thing in particular is missing. I've set the height property for the div to 100% (which is 100% of the window not the document), so if your document is longer than the window it is displayed on then the fade in will only work on the part which is initially visible. You can change this so it uses an absolute value, say "1000px" but thats not very nice since it means you'd need to set that on a per document basis. Really you need a script that calculates the document height dynamically. But thats up to you to find.The way in which the div is removed after the fade could also do with improvement, but it works at least. Give it a try anyway, and see if it meets your needs.You'll probably want to put this bit in an external js file: /* * Cover the page with a div and fade it in. */ function fadeDivIn(objId) { // Get the element. var obj = document.getElementById(objId); // Set style here so only executed by javascript enabled browsers. obj.style.width = "100%"; obj.style.height = "100%"; obj.style.top = "0px"; obj.style.right = "0px"; obj.style.backgroundColor = "#FFFFFF"; // Fade the div which covers the page. fade(objId, 100, 0); // Need to set display to none after fade effect to make the page selectable. // Not pretty to be dependent on time, probably better way of doing this. window.setTimeout("obj.style.display='none'", 1050); } /* * Calls setOpacity multiple times to create a smooth fade out/in effect. */ function fade(objId, startOpacity, endOpacity) { // Retrieve the element to fade. obj = document.getElementById(objId); // Don't continue if at endOpacity (base case). if (startOpacity != endOpacity){ // Decrement if fade out if (startOpacity > endOpacity) startOpacity -= 5; // Increment if fade in else startOpacity += 5; // Set the new opacity of the element. setOpacity(obj, startOpacity); // Timeout and then call recursively. window.setTimeout("fade('"+objId+"',"+startOpacity+","+endOpacity+")", 50); } } /* * Cross browser compatible function to change the opacity of a DOM element. */ function setOpacity(obj, opacity) { // This prevents an ugly flicker in FF when set to 100% opacity = (opacity == 100)?99.999:opacity; // For new mozilla browsers (official CSS3). obj.style.opacity = opacity/100; // For old mozilla browsers. obj.style.MozOpacity = opacity/100; // For IE. obj.style.filter = "alpha(opacity=" + opacity + ")"; // For KHTML browsers. obj.style.KhtmlOpacity = opacity/100; } Call the script once the page is loaded like this: <body onload="fadeDivIn('foreground');"> Put the div which will be faded in the body: <div id="foreground" style="position: absolute;"></div>
  6. Pollux

    Fade-In

    I've not tried this, so I'm not sure how well it would work, but it may be possible to create a cross browser version of the script based upon the opacity style that can be assigned to DOM elements.If you position a <div> over a page with a white background (or any other colour/image you might like) so it covers the whole page, and then onload you can call a script which will fade the opacity of that div from 100% to 0%.To get you started, here's a cross browser script I previously wrote to fade a DOM element. All you should need to do (I think!) is create the div with the background and then pass its id to the fade method: /* * Calls setOpacity multiple times to create a smooth fade out/in effect. */function fade(objId, startOpacity, endOpacity) { // Check element exists - avoid scripting errors. if (document.getElementById) { // Retrieve the element to fade. obj = document.getElementById(objId); // Don't continue if at endOpacity (base case). if (startOpacity != endOpacity){ // Decrement if fade out if (startOpacity > endOpacity) startOpacity -= 10; // Increment if fade in else startOpacity += 10; // Set the new opacity of the element. setOpacity(obj, startOpacity); // Timeout and then call recursively. window.setTimeout("fade('"+objId+"',"+startOpacity+","+endOpacity+")", 100); } }}/* * Cross browser compatible function to change the opacity of a DOM element. */function setOpacity(obj, opacity) { // This prevents an ugly flicker in FF when set to 100% opacity = (opacity == 100)?99.999:opacity; // For new mozilla browsers (official CSS3). obj.style.opacity = opacity/100; // For old mozilla browsers. obj.style.MozOpacity = opacity/100; // For IE. obj.style.filter = "alpha(opacity=" + opacity + ")"; // For KHTML browsers. obj.style.KhtmlOpacity = opacity/100;} Let me know if it works!
  7. Pollux

    a newbie question

    Not everything you're saying seems to make sense, is it the main page's margin's you're trying to set? If you could try and explain which part of your web page at http://www.gretethomsen.dk/grete06/gretet.htm is wrong and how you want it to look I think it will be easier to understand.
  8. If you're not actually submitting a form though, and instead are just looking to create a button which is effectively a hyperlink (ignoring the potential usability issues), then what you'd probably want to do is use a javascript onClick event that sets the location, like so: <input type="button" onclick="top.location = 'index.html';">
  9. Pollux

    Help me

    Comparison of light versions.Theres also a comparison of the features on the mysql site. Although obviously being on the mysql site there could be an element of bias. http://dev.mysql.com/tech-resources/features.htmlTheres also tons of reviews and other comparison articles around on the web, I'd get googling.
  10. To extract data from a database table rather than a textfile you need to create a connection to the database, query it using an SQL query string, and then use the recordset thats returned however you wish. You do all this using ADO, you may find the following article useful:ADO SQL QueryHopefully that covers what you needed to know!
  11. Try: <script type="text/javascript"><!--top.location.href=url;//--></script> Note also you should use the "type" attribute rather than "language" in your script tags now.
  12. To get a cross browser version of the same effect, look into using javascript's onmouseover event, then updating the div element's style using the DOM.
  13. Pollux

    Can I skip HTML?

    Nope, no compatibility problems since they'll all sit on the server side and spew out the (X)HTML which is read by the client browser. The php will generate the XHTML but won't really be aware or even care, what it means, it is just text to php. The XHTML will get processed at the client, by which point no php will remain.
  14. Without actually writing it for you, a start would be to use an onkeypress event which calls a function which does your processing.
  15. Pollux

    I cant run asp file

    No, I'm pretty sure you shouldn't have to install anything else, or set any classpaths. And ASP should run fine on PWS. You're right, that code should run fine, but I would still recommend you check friendly messages are turned off because you'll want all the information you can get about errors that occur.It could be something to do with the PWS settings, I don't have a copy of PWS or IIS on this machine so I can't have a look at them at the moment.I suggest you google for "ASP internal server error" and similar to look for causes, particularly on the microsoft support site.Heres one possible problem: http://support.microsoft.com/?scid=kb;en-u...3042&sid=global
  16. Pollux

    I cant run asp file

    Ah, are you using IE? If you are go to Tools > Options > Advanced then uncheck "Show friendly HTTP error messages".Now reload the page and I think it might give you an ASP error. I think theres just a fault in your code, but IE is helpfully hiding the details from you.
  17. Pollux

    MySQL limits

    If you don't set the MAX_ROWS option, the maximum size for a table in the latest version is 65,536TB (so, kinda unlikely to be a problem!) before v5.0.6 its 4GB. Although if your OS has a maximum file size lower than this, it will be limited at this. Your best bet is to look in the documentation for information about configuration.
  18. Theres no built in javascript function that I know of, but if you've got an array with the elements being the month names then writing your own will be trivial. function getMonthByName(numericMonth){ ...your array here... return yourMonthArray[numericMonth-1];} Where 'yourMonthArray' is the name of your array. The -1 is because javascript arrays start at 0, where as the months start at 1. All we're doing is returning the contents of the right element of the array based on the number passed in as a parameter.Just call the function as you would a built in function: getMonthByName(5); which should return "May".
  19. Pollux

    Toggel Display

    The style you have is overriding the style property you are dynamically setting, but you can just put style="display:none" as an attribute for each item and that should work. Or, alternatively you can set the style by a function called onLoad of the body. If you do this, you could keep an array of all the ids which need their style changing. It will then be very simple to write two functions, e.g. collapseAll() and expandAll(). Which just run through all the elements of the array and change the display style to 'none' and 'block' respectively.Call collapseAll() onLoad and expandAll() from your hyperlink.
  20. You'll be needing some server side code really to process the form and send the e-mails. Since you know VB the best choice for you would probably be ASP as you'll be able to do the coding in VBscript. If you get a good grounding in it, then theres plenty of tutorials around that will introduce you to sending e-mail using ASP.Obviously you can try the w3schools ASP forum if you need more help with this.
  21. Presuming you mean to display the actual tags rather than to format the text within the textarea using the tags, then simply use the HTML escape sequences for the greater than and less than signs. So you'd have something along the lines of: <textarea><script></textarea> Complete list of escape sequences.
  22. Pollux

    Can I skip HTML?

    As Mimika says, there isn't much difference between them so shifting from one to the other isn't all that difficult. However learning HTML can teach you practices which are considered by XHTML to be bad. Since everything is shifting towards the XML way of thinking its probably not such a bad idea to start with XHTML so you don't have to unlearn those bad practices later. Obviously if you're going to be working with someone elses HTML you might need to learn what all the deprecated HTML tags do too so you can understand it, but better to work that way around I would say.
  23. Pollux

    response.redirect

    Are you setting buffer to true at the very top of the document (above the html tag)? Response.Buffer = True You'll also probably need to call end on the Response object, after the redirect, so the response is actually downloaded to the client. Response.End If you're already doing both of those, what is the error you're receiving? Or is the redirection simply not occuring?
  24. Pollux

    I cant run asp file

    I'm not 100% certain of the differences between PWS and IIS but if the test1.asp file is directly inside wwwroot, I would expect the address to be http://localhost/test1.asp. Or is the file within a directory called 'MyWeb'?Also, when you try with the HTML file are you viewing it through the server, by going to, say, http://localhost/MyWeb/test.html?
  25. I'm sure theres a number of different ways you could do this. The first idea that jumps to mind is to create a div which contains the question and form elements which you want to optionally display. Give this div an id attribute and set its style so display="none" to make it invisible. Then write a javascript function which is called onchange of the form element it is dependent upon. This function will need to check the answer to that question by retrieving the value and comparing it to your expected result. Based on whether that answer was correct or not, you'll need to dynamically change the div's style so display="block" to make the div visible. var elem = "divId";document.getElementById(elem).style.display="block"; Once you've got it working, you'll probably want to make it slightly more generic so you can reuse the same JS function to make other new questions appear. Probably by passing in the id of the div to display as a parameter to the function when it's called.Hopefully that's at least slightly helpful! But say if you need any of it in more detail.
×
×
  • Create New...