Jump to content

jeffman

Members
  • Posts

    7,761
  • Joined

  • Last visited

Everything posted by jeffman

  1. >> Does "ul ul" represent the first fly-out? Yes. That's why its hidden. I assume the HTML structure nests the second UL in a list item that is a child of the first UL. .menu ul li:hover ul references the same list. When the cursor hovers over the list item, the CSS makes the list visible. Do you understand how descendent selectors work?
  2. Ask here. We're a friendly bunch. (I don't know if they have a forum or not.)
  3. If you want to access a document on the web, you need to know its address or follow a link to it. Most of the time, you just follow a link. Search engine bots do the same thing. The follow one link to another link to another to another. Eventually, they have a map of the whole web. But they can't access pages if nothing links to them. My personal web server is a good example. I've had the same server since the 1990s, so it's a real mess. A lot of my pages are experiments. I try out a new technique, and then I forget about it. The page just sits there. Nothing links to it, so Google does not know it exists. If I want Google Search to find that page, I need something to link to it. Usually, you will create links to your documents without thinking about it, so usually this is not something you have to think about.
  4. jeffman

    PHP-XML Error

    Try simplexml_load_string instead of simplexml_load_file new SimpleXMLElement will work also
  5. jeffman

    window.onload

    It's possible that you could mindlessly plug in a 90s-era 3rd-party library that also binds code to the onload event, in which case its code or your code will be overwritten. But that's not very likely. jQuery provides a very simple tool for this, BTW. The library handles all the if-else stuff internally. But for a simple script where you personally have complete control? It's hard to beat the old-fashioned way.
  6. You know, people really hate alerts. Have you considered another way to do the same thing? Would you like it if the user clicked the button and the href or link "magically" appeared somewhere in the form?
  7. Not only can it be done with just CSS, but it's better to do so in the off chance your client has JS disabled. Look at CSSPlay for some ideas. If you're not sure what you're looking at, ask. The menu basics are quite simple once you know what to look for.
  8. The point of that example is to show how AJAX works. W3Schools uses the Google API for its own search (not this board; the actual school). Try it. The top of the search results says "Powered by Google." My employer uses Google. It's very common because it works. What it cannot do is find pages that are not linked, so if you want a page to be returned as a search result, it must be reachable by a "chain" of links that goes all the way back to the home page.
  9. The most efficient thing is to make sure all your pages are linked together in some way and use Google's API to do the indexing and searching for you. Searching your site yourself takes time you might not have. I mean, if you have a lot if files, your search tool could easily time out. The alternative would be to create a cron job that looks for new files and indexes key words in some way, and then your search tool looks through the index instead of reading every file. Still, a big hassle.
  10. It's hard to guide you without knowing what you know and don't know. At a basic level, you will need to create a button group in HTML. Use CSS to style it, position it, and make it appear and disappear. Any tutorial that shows you how to make a drop-down menu can get you started on this. Processing the button data can happen in the browser or on the server. In the browser, you would use JS to capture the form's submit event and filter the button data. jQuery will simplify all that if you already know jQuery, but if you don't know jQuery, it would make the learning curve more steep. So at a minimum, learn how to: make an HTML button groupstyle the appearance of your button groupuse the CSS position property to take the button group out of the flow and place it below your inputwrite an event handler in JSbind an event handler to your form's submit event Since you're already submitting this to your server, some of the JS work could be done there, assuming you are handling the search with your own code.
  11. Glenvern should explain if the goal is to save the file on the server or on the client's desktop computer.
  12. True. It sort of looked like OP's CSS wants to do it that way. A better example would look like this:<div class="marked"> <p>Hello</p></div>
  13. .marked p corresponds to the nested <p> element in either of these HTML structures: <p class="marked"> <p>First descendent</p></p> <div class="marked"> <table> <tr> <td> <p>Arbitrary descendent</p> </td> </tr> </table></div>
  14. Yes. That is the point, and don't worry about tweaking it. It's all so basic that a half-way experienced developer could easily duplicate it (and I'm sure many have) without seeing the original.
  15. It can't be done with HTML and CSS. Most of it has to be done with JavaScript. Creating the new textarea is pretty easy. Some other parts are not very intuitive. If JavaScript is not your thing, this is not a good project to learn on.
  16. It's a scrolling issue. Load the page in a window that's too short for the content, such that you produce a scrollbar. Now try to scroll down using your arrow key. Doesn't work for me either (FF 21 OSX). I figure one of the 3rd-party scripts is doing something with focus, but at least one of them is minified, and I just can't bother. Sorry. You might be able to isolate the problem by not loading the external scripts. Do it one at a time until you find the bad guy.
  17. jeffman

    What is raw ?

    Raw data usually means it has not been processed in any way. For example. all the user data that comes in the $_POST array is in string format. It needs to be converted if you want to work with it as a float or something else, or you might need to filter it, sort it, combine it, etc.
  18. It seems to me you should change the orderby value, but I really don't know. You might do better asking a wordpress forum. People there do this stuff every day. I haven't tweaked my wordpress site in a few years.
  19. 1. Make each column a floating div. In CSS, define the width of each column in percents, so they add up to a total of 100%. Note that padding/margins will be added on to these percents, so it's best to apply spacing to internal elements, not to the columns themselves. 2. Use an include file. The tutorial I linked you to shows PHP, but any language supports this.
  20. I said from the beginning there were limitations. Small amounts of data can be stored in JSON format. Since localStorage is really just a string, you can store tabular data in csv format. XML is possibly a better option, since routines for accessing it are built into JS. These are not very robust solutions to many problems, but they do exist. I've only used localStorage as a place to back up data that a user is currently editing.
  21. Cookies (limited) or DOM storage. localStorage seems to work well.
  22. My own. I needed it before anyone else had invented one. I think.
  23. You can do a lot with web apps, and a lot of sites do. Serious data is best left on the server, since the same user can access it from multiple clients, and multiple users can access it too. A lot of temp data can be stored on a single client, so there are advantages there also, for certain types of applications. And you can certainly manipulate data in a browser. I've been doing browser-based spreadsheets for years. With the new canvas element, graphs and such also become possible on the browser, and new libraries are taking advantage of that. (You don't have to write your own graphing routines.) Serious image manipulation is still better handled on the server (things like PhotoShop filters, which are used to create Captcha-type images) but with more browser speed, that may change. I suspect there are limits (no pun) on the kinds of math JS can handle, but my own web uses have have never gone beyond algebraic stuff, so I don't really know. The other answer to your question is that up to 2% of clients have JS disabled, usually because of corporate policy, and some slightly larger percent use older browsers that can't access all the new goodies (notably canvas). But you can still do a lot with "mid-level" JS, and I suspect a lot of sites you visit use more of it than you realize.
  24. 1. You can put a click handler on any element, including and especially an ordinary button, though of course you should use good judgement about the user experience. 2. You don't have to put a submit element inside a form. But if you do, and you put a click handler on it, then you have to add a lot of other code to keep the default behavior from occurring. It's normally easier to trap the form's submit event instead. You'll usually want to do that anyway, since having the focus on a text input in a form means that hitting the enter/return key causes a submit event to trigger, and you might not want that to happen.
×
×
  • Create New...