Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. You'll have to explain it. Nothing is obvious, it only seems that way to an experienced person. I only see one thing wrong with it: It gives the user the ability to make the program break by overwriting important variables. A simple solution is to only give the user access to a particular object. // At the beginning of the programvar globals = {};// Elsewhere in the programvar input=document.getElementById("input");globals[input.value] = "hello world";
  2. I see. I haven't ever used 000webhost. I'm just pointing out that a lot of free web hosts allow domain names to be attached.
  3. Personally, I'd keep away from GoDaddy. They have their priorities backwards. They spend way too much money on advertising.
  4. Lots of free hosts allow you to attach a domain name to your website, I did that for a while. You have to check the information about your webhost to find out if it can be done and how. For example: 000webhost has the information here: http://www.000webhost.com/free-domain-hosting
  5. You can use else if to have exclusively one condition or the other. if(count == 1) {} else if(count == 2) {}
  6. This probably has something to do with nested arrays. Check the value of $Rm_Avail before putting it into the database.
  7. I tested with and without square brackets. The square brackets seem to be required to receive an array on the server. It's working fine for me. This is my <select> element: <select class="form-dropdown" style="width:150px" id="input_12" name="q12_pleaseSpecify12[]" multiple="multiple"> This is what I have on the server print_r($_POST['q12_pleaseSpecify12']);
  8. I tested your code and $Rm_Avail does have a value. There must be something else. Try seeing what's in the entire POST array. print_r($_POST);
  9. Use the removeChild(), appendChild() and insertBefore() methods to move the nodes around.
  10. Because you haven't defined the function until after calling it. Create the color() function before the for() loop.
  11. What's wrong is the &. It thinks it's an HTML entity. Your document is probably using the XHTML doctype. In HTML it's valid to have loose ampersands. Use an HTML entity to encode the & and you won't get any more warnings. <a href="someref?param1=123&param2=xyz"> Yes, the URL will continue to work properly because the entity is parsed before the URL is used.
  12. Yes, you can, but you'll have to ask your service provider to give your home a fixed IP address, then use that as a nameserver for the domain. You'll also have to configure your router to direct all incoming traffic through port 80 to go to your computer, so you'll need a fixed internal IP as well. Disadvantages are: the page will be very slow to load for visitors and you'll probably reach your service plan's bandwidth cap pretty quickly depending on how popular your website becomes. Your computer also becomes more vulnerable to security threats.
  13. The image being rotated is actually a long strip of images in one image file( http://www.atticweb.nl/photos/sprite.png ). The element it is contained within has a fixed width and height, the background position tells it which part of the image is visible (this technique is called CSS sprites). Javascript is being used to calculate which frame of the strip to show based on the position of the mouse relative to the element. There's some math involved based on the number of frames, the mouse X position, the image's X position and the image's width. This isn't done using CSS 3 transforms because the rotation you're seeing is not actually a transform, it's simply a set pre-rendered images, and the images are of a 3D model which CSS can't control.
  14. You'll have to show all your code, or at least the parts where $pageTitle is being printed. Make sure that the order and scope are correct.
  15. It's been a while since I last worked with XSL but this is probably similar to what you want: <xsl:choose> <xsl:when test="MyID='DC19DAKHN'"> <MyID>MN019015J</MyID> </xsl:when> <xsl:when test="MyID='DC19D0000'"> <MyID>MN019015J</MyID> </xsl:when> <xsl:otherwise> <MyID><xsl:value-of select="MyID"/></MyID> </xsl:otherwise></xsl:choose>
  16. It seems like you don't have experience with event handlers. Here's a page explaining it: http://www.w3schools.com/js/js_htmldom_eventlistener.asp What you would do is this var counter = 0;var video = document.getElementById("Video1");video.addEventListener("ended", count, false);function count() { counter++; if(counter == 6) { video.loop = false; video.pause(); }}
  17. There's no problem with using extra variables, code readability is important so if that helps you it's good. There is a problem with forgetting to declare variables with the var keyword because it will actually have an effect on the program that's running.
  18. I seem to have forgotten to put the link to the list of events in my previous post. Here's a list of event listeners for the player: https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events This is a list of properties and methods that the player uses: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement No loops are necessary, the counter is a global variable that updates each time the ended event occurs. Use an if() condition to set the loop property to false and call the pause() method.
  19. There probably are other selectors in the document interfering. Without seeing all the code I won't be able to know. Check for any other rules setting the color of a <td> or <th> element, or a rule changing the color of a different element that's inside a table cell.
  20. You can use double-quotes, just be sure to escape them with " You could break the string into pieces to make it more readable. var prompt_div = "<div id='genderCheck'>";prompt_div += "<h4>First of all, select your gender:</h4>";prompt_div += "<input type='radio' name='gender' value='male' onClick='userprompt("male","");'> Male";prompt_div += "<input type='radio' name='gender' value='female' onClick='userprompt("female");'> Female";prompt_div += "</div>";prompt_div += "<div id='ageCheck'>";prompt_div += "<h4>Now a bit more..</h4>";prompt_div += "<input type='radio' name='age' value='adult' onClick='userprompt("","adult");'> Adult";prompt_div += "<input type='radio' name='age' value='child' onClick='userprompt("","child");'> Child";prompt_div += "</div>";prompt_div += "<div id='textPrompt'>";prompt_div += "<h4>Great! Now, go ahead and type a response to your fellow classmates:</h4>";prompt_div += "<textarea id='userResponse'>Type here...</textarea>";prompt_div += "<button type='button' onClick='submitResponse();'>Enter</button>";prompt_div += "</div>"; Usually, rather than making Javascript to write all this, it's already on the page and you just use CSS and Javascript to make it appear or disappear.
  21. If you know which condition is the one which makes them appear or not you can put the class on the image using PHP: <img src="file.jpg" alt="image" <?php if($image_is_hidden) { echo 'class="hidden-image"'; } ?>> Change $image_is_hidden for whatever the condition is which hides the image.
  22. You can use CSS to hide images. If they have a class name already you can select them by the class: HTML: <img src="..." alt="image" class="hidden-image"> CSS: .hidden-image { display: none; }
  23. You can use Javascript to interface with the video object. Here's a list of events available on the <audio> and <video> elements When the "ended" event fires you can add 1 to a counter. If the "loop" property is set to true it will automatically return to the beginning when it finished. When the counter reaches 6 you can set the "loop" property to false and call the video's pause() method.
  24. The fact that this is an <object> a complicated subject. I don't see a filename or MIME type there either so I don't know what type of file it is or what kind of plug-in it uses. Have you checked to see that it works in modern browsers? Modern browsers are dropping support for plug-ins (except Flash for the moment) in favor of HTML 5. You should try the <video> element. It has all kinds of controls and it's a web standard meaning it will work the same on all browsers.
  25. Your quotation marks are cancelling each other out. onclick='userprompt('male','');' Change some of the single-quotes for double-quotes
×
×
  • Create New...