Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. What is on line 21 and the surrounding lines of page2.php?
  2. The error says that the function is getting a string and it requires a resource. Output the value that you're sending to the function to see why it's a string. Please put your code In a code block. Just wrap it in [ code] tags.
  3. Put the class on the <audio> element, not on the <source> element. <audio controls autoplay class="c1"> <source src="2jc.mp3" type="audio/mpeg"> Sorry your browser does not support our audio at 2jc. </audio> You're using the wrong selector. There's no <embed> element on the page. There's no need for CDATA tags, this isn't XML. /* CSS layout 2jc */ .c1 { width: 692px; height:155px; background-image:url('perfume-logo.jpg'); visibility:hidden; outline-color:fuchsia; background-position:center; } Setting visibility to hidden will make the whole thing invisible, even background image, you should put the visual styles on some other elements in the page.
  4. That's the problem with using absolute positioning. If you want the image behind the text, set a background-image with CSS.
  5. All browsers support cookies, the problem is whether the user allows the browser to save cookies or not.
  6. I would turn off the WYSIWYG editor when building pages.
  7. It's the same issue, show your updated HTML.
  8. I would avoid input type="number" if you want that much flexibility. Just use type="text" instead.
  9. Your button is wrapped in a <p> element, so there is no sibling element to it. If you remove the <p> tags it will work. That's the wrong place to use a <p> tag, <p> is meant to represent a paragraph, if you want margins on the button add them with CSS.
  10. The code works in the W3Schools example, so your code must be in a context where something is not working. I need to see the full context to know what's not working. It sounds like the element does not have a nextElementSibling, so your HTML structure might be incorrect.
  11. This should work: SELECT Name, MAX(ID), RandomStuff FROM table GROUP BY Name With this code, you will not be able to know exactly which of the duplicated rows the rest of the data comes from. If you actually want to specify which row you want you're going to need a more complicated query.
  12. I see, you were referring to a particular notation. To me, an exponent is one of the operands of exponentiation. The second argument of Math.pow() is an exponent. I've done some tests and Javascript parses exponents properly with parseFloat(), whether positive or negative. Make sure there are no spaces between the "e" and the numbers that follow.
  13. There aren't exponents in Ohm's law. Can you show an example of what you're trying to do?
  14. Your layout technique is really bad. This doesn't have to do with aside, this is just what happens when you try to position things with pixel values and negative margins. To allow blocks to be next to each other, use the CSS float property. Do not set the width of elements in pixels, don't use tables for your navigation menu. Be aware that borders add on to the width of the element, so that will affect our layout as well.
  15. I can't tell for sure why it's being rejected without seeing server logs. It might be a size restriction on the files. You could try breaking it into multiple files with about 500 jobs each.
  16. You'll need to store the content of all your HTML pages in a database and index them by keywords and such. Then, when the user does a search, pull out URLs based on the keywords typed in by the user. It's not a simple system to implement. If you just want to search for words on the same page, you might as well let the browser do the work, people can press Control+F to find things.
  17. I think you should be aware that even today different monitors display the same colors differently. It's not something a web developer should worry about, you will never get your page to look exactly the same on different computers. Some screens show richer colors, some screens have a warmer tint, some screens have a smaller amount of colors. There are many color standards out there already outside of sRGB. Screen hardware changes all the time, we went from CRT to LCD to LED and OLED. There are even screens with yellow pixels these days. Web standards have not changed to adapt to it. The web is not going to be affected by another change. Browsers do the work of converting from color codes on the web to values that the screen can use.
  18. You can send mail with the PHP mail() function. If you don't want to do that you'll need to do complicated socket connections with an external SMTP server. There are some mail libraries out there that do that for you, I think one of them is called PHPMailer.
  19. I think perhaps this task may be beyond your current capabilities and you need spend a bit longer learning Javascript with more basic tasks. There are many mistakes in your code that a proper understanding of how Javascript works would solve. You don't understand what the code is doing, but you're trying to put the pieces together anyway. To make things easier, please put your code in a Code block so that it's readable. It would be in your best interest to move all the CSS and Javascript to external files so all the code isn't jumbled up in one place. One issue you might encounter is that some browsers block AJAX on the local computer, also requests done on the local computer have an HTTP status of 0 instead of 200. If you want to test on your local filesystem, use Firefox (which will not block the AJAX requests) and check for status 0 instead of 200 when the readystatechange event is fired. I'll answer your questions, but I don't have the time to point out all the mistakes in your code and indicate how to solve each one individually. Javascript and AJAX are not mutually exclusive.because AJAX is a part of Javascript. A Javascript object, called XMLHttpRequest, sends a request to the server, when the server responds a "readystatechanged" event is fired. You can read more about events in the Javascript tutorial. When the event is fired, the responseText property of the XMLHttpRequest object contains what was given by the server. The code I was providing did the screen size detection and calculations on the client side, which is preferable. There's no reason why the server should have to do the calculations, if it did you would have to make an HTTP request for every resize event which could overload the server AJAX is just the technology that requests data from the server, it doesn't do anything else, everything else is either Javascript or PHP. You can add the content directly to the body element, you just have to set the innerHTML property of document.body
  20. I don't expect any new color standards to affect the web for at least ten years. 16 million colors is more than enough for the web. Extra color depth might help give a slightly clearer image for videogames, movies and scientific simulations, but is not really necessary for the web.
  21. Unfortunately, without more information I can't help you. Perhaps you should ask the person who provided the documentation about it.
  22. Javascript uses the same token for addition as for concatenation. If any of the two arguments being added is a string the operation will be concatenation rather than addition. Values taken from form inputs are always strings, so additions between them will result in concatenation. A string value can be converted to a number using the Number() function.
  23. What are you talking about?
  24. This would work. You don't need to wrap it in a closure and assign it to a variable. truth01 = new TargetImages(); truth01.idTag = "tru01"; truth01.x = 0; truth01.y = 40; truth01.width = 64; truth01.height = 64; truth01.speedX = 2; truth01.speedY = 0; truth01.tripsCnt = 0; truth01.tripsMax = 2; truth01.visible = true; truth01.directionX = 1; // function TargetImages() { this.nameTag = 'tru01' this.x = 0; this.y = 0; this.width = 32; this.height = 32; this.speedX = 4; this.speedY = 0; this.tripsCnt = 0; this.tripsMax = 2; this.visible = true; this.directionX = 1; this.update = function() { ctx.drawImage(targetImgs[targetImgsCnt], this.x, this.y, this.width, this.height); this.x = this.x + (this.speedX * this.directionX); // always = +1 or -1 idTag = this.idTag; if (this.idTag == "truth01") { this.speedX = 0; truth01.tripsCnt = 0; lies01.speedX = 3; idTag = "lies01"; this.visible = false; lies01.visible = true; } } }
×
×
  • Create New...