Jump to content

Ingolme

Moderator
  • Posts

    14,897
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by Ingolme

  1. No, it wouldn't work. Read your code line by line and try to execute it in your head.
  2. CSS can't do it. It's really complicated. You have to create a set of elements in Javascript that look like a scrollbar where you handle all the mouse and keyboard events and tell the content what to do.
  3. Ingolme

    hide image url

    output started at /home/content/31/9408631/html/index.php:91You should check that nothing has been sent to the client already. Headers should be the very first thing you send to the client. You should give a local file path, not one with the http protocol, to the readfile() function.For example: readfile('pics/3.jpg');
  4. There is no problem with assignments in conditions. Netbeans is just warning you in case you did it accidentally. (A lot of threads on this forum would be avoided if more editors did that)
  5. I don't have enough information. Like I mentioned before I'm just trying to make guesses as to what your problem is. You need to make an accurate english description of what you want done.
  6. I'm getting a lot of 404 errors in the error console. You should check that your file paths are all correct. Remember that they're case sensitive. And be sure you actually have uploaded all the images.
  7. You need Javascript for that.If you don't know any Javascript, look at the W3Schools tutorial and pay special attention to the section about event handlers.
  8. That should work. What happens when you use that code?
  9. And which is that? There is only one way to do it, there aren't many ways it could go wrong.
  10. With this code, all you're doing is setting a property called "onclick" to a string of value "test()" What you need is to actually reference the function. Since it is a reference and not an execution, it must not have parenthesis. document.getElementById(divID).onclick= test;
  11. I think the DOM is a better object-oriented way. You could look up PHP's DOMDocument library.
  12. PHP's equivalent is regular expressions. They're more costly than ordinary operations and require some new learning. There probably is a better way to design your system.
  13. https://developer.mozilla.org/en-US/docs/HTML_in_XMLHttpRequestOnly supported in Chrome, Firefox and versions 10 or above of Internet Explorer. The responseXML property, otherwise, requires a perfectly formatted XML document.
  14. Anybody who knows a bit of Javascript can get around Javascript "security"
  15. The "div" part is only needed if there are other elements with class="img" that should behave differently. It's the developer's choice to add these things, they may have been planning to use the class name on other elements. You're right, images are already inline. Technically inline-blocks because they have a width and height. Unless another selector is causing the image to become a block there's no point in telling it to be inline. The difference between a:hover img and img:hover is just the element that is being hovered on. It may be like that by custom. Internet Explorer 6 used to only support :hover on <a> elements.
  16. It cannot be done with HTML or CSS or Javascript. You need to program a login or password protected system using a server-side language.
  17. Specifying a doctype wouldn't work, as images are supposed to have the gap below them in standard browsers.I'm not sure how much CSS will work but you could add this to your <img> elements: <img style="vertical-align: middle;" src=" ... "> HTML e-mails don't support a lot of CSS. Using old-school techniques is more likely to look the way it's intended
  18. Images are inline elements. They always have a small horizontal gap under them. Does your document have a <!DOCTYPE> ? If it does, removing it will most likely fix the problem.
  19. Ingolme

    Plz Help..

    Put all the code that should execute when the button is clicked into the click event handler. That is the function that runs when the button is clicked. document.write() will clear the whole page before writing so it's preferable that you change the page in a different way, for example setting the innerHTML of an element.
  20. You're not closing your if() block before starting the else block. "else" should be written in lowercase.Be sure to indent your code to see the structure. if(condition) { // Code} else { // Alternative code} You should have something inside your for() loops as well. for( ... ) { // Code to be repeated}
  21. Ingolme

    Plz Help..

    Javascript runs as soon as it is loaded. The moment you load the document, the result for ans(a) is not 1 because "a" is not defined so your if() block is ignored When you click the button, you execute the ans() function for 10. It will execute the alert statement and then do nothing else because that's all it was told to do.
  22. No code in a website should be able to cause such a problem in the browser, if that really was the case people would be exploiting it. So don't worry about your code.
  23. If the start is less than the end, the increment needs to be positive. You can use a while() or for() loop. Generally the for() loop is more convenient. [Read about for loops]The increment is the amount that you add to the iterator ( $i ) on each iteration. (The word "iteration" refers to each time the loop is repeated)
  24. Even if you give a file a .php extension you can still load it as a Javascript file using the <script> tag. Just to ensure it's interpretted correctly you can send a javascript mime type header. <?phpheader('Content-type: text/javascript');?> In the HTML file:<script src="file.php"></script>
  25. Actually, you shouldn't need to restrict any loop. A loop can count upwards or downwards. You just need to make sure that the increment value has the right sign.
×
×
  • Create New...