Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. In order to learn AJAX it's recommended that you study PHP first. You won't be able to understand what's happening if you don't know PHP. What you're asking about is a query string. It's used to send information to the server. PHP handles it using $_GET, $_POST and $_REQUEST variables. Read about it here: http://www.w3schools.com/php/php_forms.asp $_REQUEST has data from GET, POST and COOKIE requests, which means people could use it to send data to your site in a way you didn't want them to, so I don't recommend using $_REQUEST.
  2. If all the files are under the same domain name then it should work without any problem.
  3. You can control it with CSS without any problem. You'll have to make a real element if you want to use Javascript on it.
  4. Just a side note: I've never actually needed to use those events in all the years I've been working with Javascript, however they would be useful if I was building a complex web application. Here's a secret: We developers don't memorize every feature of the language, we learn the syntax and structure of the language but don't go on to read about every single detail of it. I know how to handle events, but I haven't memorized every kind of event there is and what to use it for. My knowledge of how events work makes learning a new type of event really easy for me. There probably isn't a good reason for you to learn about the message event at the moment, the only thing that you have to learn is that there exists an interface to communicate between different windows (which uses the message event) and that you can look that up if you ever encounter a situation that needs it. In response to your question: Yes, I can help you make your script work when you try things in Javascript.
  5. Ingolme

    HELP PLEASE!

    Yes, responsive designs are done with just HTML and CSS. I replied with a bit more detail in the other thread.
  6. Bootstrap is built on CSS, but I actually encourage not using a framework until you know how to make responsive designs without one. Responsive design is only done with CSS and HTML. It's about using the CSS in a way to make it look right on many different screen sizes. Look up "media queries" which are a fundamental CSS feature that makes responsive designs work.
  7. W3Schools isn't perfect. If the way they explain things doesn't work for you you can look at other websites. My knowledge comes from a large variety of sources. The switch statement looks at a variable and compares it to any values you want it to. The value can be anything: a literal value ("red", 5 and true are literal values), a variable or even a function name. Here are some examples of how to use the switch() statement. The second example shows a situation where switch() is easier to use than a series of if() statements. var color = "blue";var singleDigit = 5;switch(color) { case "red": alert("Red was the chosen color"); break; case "green": alert("Green was the chosen color"); break; case "blue": alert("Blue was the chosen color"); break;}switch(singleDigit) { case 0: case 2: case 4: case 6: case 8: alert("The number is even"); break; case 1: case 3: case 5: case 7: case 9: alert("The number is odd"); break;}
  8. You will have to learn about URL rewriting.
  9. I'm just saying that onmessage is not an HTML attribute, the message event only works on the Javascript window object. Update: window events can be put on the <body> element. But understanding what the "message" event does requires some intermediate knowledge of Javascript. If the event is not working there has to be something wrong with the Javascript. Event listener examples don't use HTML attributes for their event listeners because it's a bad practice. If you're still only learning HTML then wait until you begin Javascript before trying to learn events.
  10. What you have to do is use Javascript to listen to an event and then change the visibility of the elements using element.style.display = "none" or element,.style.display = "" (empty string to revert to the default state) This is not a PHP task because you want the page to change without having to reload it.
  11. This page explains Web Messaging: https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage The message event belongs to the Javascript window object: window.addEventListener("message", receiveMessage, false); Here's the documentation on how and why to use addEventListener for events: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener
  12. Events are Javascript. If you really want to learn events you have to know Javascript. If you want to see how they work many of them only make sense in the context of a script, which is why the examples are all Javascript. For example, the "message" event cannot be applied to an HTML element, it's applied to Javascript web sockets and server-sent events which have no HTML involved in them. The "storage" event only makes sense in the context of Javascript's sessionStorage and localStorage objects, there's absolutely no relation with HTML there.
  13. The actual Javascript code needs to be between <script> tags. Your other <script> tags are in the wrong order: jQuery-UI has to be loaded after the jQuery library.
  14. Two things: XMLHTTP requests don't work on the local filesystem for some browsers for security reasons. The second thing is that you cannot request a file that´s on a different domain name unless the server has been programmed to send a particular header in the response. Here's a page explaining about cross-domain requests: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
  15. You can find information about all Javascript events at the Mozilla Developer Network: https://developer.mozilla.org/en-US/docs/Web/Events Many events are only intended to work with Javascript. Event attributes inside the HTML, while not officially deprecated, shouldn't be used because it makes maintaining websites really difficult. It's important to separate content from behavior.
  16. These are the date formats that MySQL accepts: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-literals.html My recommendation is not to use date or datetime fields. Use an INT field and store a UNIX timestamp. They're easy to operate with and you can choose whichever output format you like.
  17. Ingolme

    Php compiler

    I just tested that code and there are no errors. Here it is: http://mysmashing1.codepad.org/DjSMv8u4
  18. http://www.google.com/webmasters/ Whatever you find here is what Google allows you to change in their directory. Google updates frequently, so if you fixed your pages it won't be too long before it indexes your site properly again.
  19. It's a programming problem that involves math. It's really complicated for somebody who is not experienced in programming. We have access to the width of the screen using the offsetWidth of the body element. We have the position of the left side of the box and width of the box using offsetLeft and offsetWidth of that element. These values are numbers with which we can operate mathematically. We determine where the center of the box is by adding half the width to its current left position. Using a mousedown event we attach a mousemove event to the document. The mousemove event would be removed after the mouse button is released. The mousemove event will make the box move using the mouse's current and previous position, then it will compare the position of the box with the edges of the screen. If the position of the box is less than a certain amount from the edges of the screen (maybe 200 pixels) we call a function that makes the box move out of the screen. That function would use a setTimeout or setInterval to animate the box moving. Easing of the movement would have to be done by changing the distance moved on each animation frame in proportion to the distance which can be done mathematically in many ways. When the box is out of the screen its position tells us which side it left from, so we move it to the opposite side of the screen and use the same animation techniques to get it back to the center.
  20. I don't understand your question. I don't know the definition of the terms "paging" and "listBox".
  21. If you have any questions you can ask them on the forums. When answering questions I need time to do research and find the right resources to explain concepts, it's not something I could do in a real-time conversation.
  22. By putting the AJAX request inside the setTimeout() the request does not begin until two seconds, after that it could take any amount of time to get a response from the server. It could even take four or ten seconds. You haven't fully described the problem to me yet, you just are telling me what tools you tried to use, you might be using the wrong tools. If I understood correctly, you have a <ul> element on the page and in each list item there is a URL you want to send an AJAX request to. Your current jQuery selector is loooking at absolutely every <li> element on the page, even ones that don't belong to the list, so you should give your list an ID so that other lists on the page don't interfere: $('ul#urls li') Responses (in jQuery) are dealt with in the success function, there is no other way. Can you explain specifically what doesn't work when you use it?
  23. It depends on what you expect display: inline to do on the <aside> element. display: inline might not be the right solution to the problem you're trying to solve,
  24. Ingolme

    Php compiler

    What code were you putting in there that didn't work? Arrays are working there for me.
  25. But why do you want to send a new AJAX request for every <li> element?
×
×
  • Create New...