Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. They use complex algorithms to detect insecure sites. If you have forms on your site, make sure they don't look identical to login forms of major websites. If you have ads on your site, you might want to give up on the ad company, as it might have a bad reputation.
  2. You probably should run this on a server. Local AJAX requests are blocked by some browsers for security reasons. If your code is not xhttp.open("GET", "news.xml", true); but rather xhttp.open("GET", "http://example.com/news.xml", true); then this is not permitted, you can only access files on your site's domain name. There's only one way to load files from example.com with AJAX, and that's by configuring the example.com server to send an Access-Control-Allow-Origin HTTP header.
  3. Why am I answering your question? Because you said this: You absolutely should be using stylesheets and, if actually coded properly, they will work the same on all browsers and devices. No browsers or devices randomly ignore certain CSS rules (especially rules from CSS1 such as text-align). If the stylesheets are not working the same on all devices you must have done something wrong. If you've been coding since 20 years before I was born you must be at least 60 years old and have been pretty rich back in the day when computers only belonged to large companies and really rich people. The web has changed a lot in the last 15 years, you have to be actively learning all the time, the programming you learned thirty years ago bears no significance on how much you know today.
  4. The first thing to do in order to make the mobile device render a page properly to to add a meta viewport tag in the header. After you've done that, you can use CSS media queries to change styles for pages larger or smaller than particular sizes. You can look these things up in a search engine. If some of your CSS is not working on some devices, then perhaps it's because your CSS is not valid. Make sure to put units on all your values and that there is no space between the number and the unit. Be sure to separate CSS rules with semi-colons. Without seeing the page itself I can't be sure what might be causing the issues.
  5. Not really. It's not the same having to edit the menu in one file as in 20 of them.
  6. His request was to put an HTML menu onto all the pages of his site, while only having to update the menu in one place and have the changes reflected everywhere else. Your solution is overkill for the task at hand and does not give the person the opportunity to name the links differently than the files they link to. Here's the list of links: menu.html <div id="nav"> <ul> <li><a href="../index.html">Home Page</a></li> <li><a href="../aboutartist.html">About the Artist</a></li> <li><a href="../all-art.html">Gallery</a></li> </ul> <h2>Anthology</h2> <ul> <li><a href="achildcries.html">A Child Cries</a></li> <li><a href="addedupon.html">Added Upon</a></li> <li><a href="brokenflowers.html">Broken Flowers</a></li> <li><a href="deadlovers.html">Dead Lovers</a></li> <li><a href="dreamchaser.html">Dream Chaser</a></li> <li><a href="ebb.html">Ebb</a></li> <li><a href="eyes.html">Eyes</a></li> <li><a href="inthedark.html">In The Dark Recesses of Our Soul</a></li> <li><a href="luna.html">Luna</a></li> <li><a href="myancientpictographs.html">My Ancient Pictographs</a></li> <li><a href="raindrop.html">Rain Drop on the Back Porch Railing</a></li> <li><a href="restlessthenight.html">Restless The Night</a></li> <li><a href="summer.html">Summer</a></li> <li><a href="tameroftheuniverse.html">Tamer of the Universe</a></li> <li><a href="thankyouchild.html">Thank You Child</a></li> <li><a href="theburning.html">The Burning</a></li> <li><a href="unopenedbooks.html">Unopened Books</a></li> <li><a href="whereangelstread.html">Where Angels Tread</a></li> </ul> </div> Here's all the code you need to put this list of links onto any page: <?php include 'menu.html'; ?> The pages of the site will need to be converted to PHP, and the links should be made relative to the site root (such as /index.php or /poems/unopenedbooks.php )
  7. If you use PHP, just have the HTML in one file, you don't need any special code. The include() function will show the HTML on the page without anything else needed.
  8. It's either in the Apache documentation or the PHP documentation.
  9. Systems like these are done on the server with a language like PHP. Often a Content Management System is used, like Wordpress. With plain PHP you can use the include statement to load the same code on multiple pages.
  10. Two of the most common reasons this might happen are either PHP throwing errors or the htaccess file having a mistake.
  11. You should understand by now how loops work, you probably can figure it out on your own. Here's a version with nested loops. var times = 4; // Display the sequence four times var highestValue = 5; // Show numbers between 0 and 5 for(counter = 0; counter < times; counter++) { for(var num = 0; num <= highestValue; num++) { console.log(num); } }
  12. Javascript does a lot of type juggling when using the == comparison operator. Both null and undefined evaluate to false when evaluated as boolean. If you want to differentiate between null and undefined, use the === strict comparison operator, which also takes data types into account.
  13. The plus sign is to operate with numbers. If you want to join the strings together, use the concatenation operator, which is a dot. You can concatenate a literal string with a space in it to add a space between the other strings. echo $string1 . ' ' . $string2; An alternative way is to use double-quoted strings: echo "$string1 $string2";
  14. Having it continue indefinitely would crash the browser, you should put a limit on how many times it displays a number. The way to do it without nested loops would be like this: var amount = 20; // Show 20 numbers var highestValue = 5; // Show numbers between 0 and 5 for(var num = 0, counter = 0; counter < amount; counter++, num++) { if(num > highestValue) { num = 0; } console.log(num); }
  15. That's been around since long before HTML 5. The difference between <button> and <input type="button"> is that you're allowed to put elements inside the <button> tag. For example: <button type="button">Click <strong>here</strong></button> The same with <input type="submit"> and <button type="submit">.
  16. It depends on what the host does with your files after your account is disabled, you could send them an e-mail asking about it. For future reference, you should always have a copy of your website's files on your own computer.
  17. I did some investigation on this a while ago. By adding an empty onunload event on the page the browser is forced to reload the page rather than load it from cache. http://stackoverflow.com/questions/9071838/force-reload-refresh-when-pressing-the-back-button#answer-30345009
  18. A global function is a function that's in the global scope. A built in function is one that the browser provides without you having to declare it. Most built in functions are global.
  19. If you've gone through the tutorial in order you must have seen the Operators section.
  20. Ingolme

    set cookies..

    There is a section in the PHP tutorial regarding cookies.
  21. MOst of us don't use XML based technologies, but I think you can use the <xsl:choose> to determine which output element to use for this. Something like this: <xsl:choose> <xsl:when test="HierCD='003'"> <MCA><xsl:value-of select="CntlAcctNbr" /></MCA> </xsl:when> <xsl:otherwise> <xsl:when test="HierCD='004'"> <BCA><xsl:value-of select="CntlAcctNbr" /></BCA> </xsl:when> <xsl:otherwise> <xsl:if test="HierCD='005'"> <LCA><xsl:value-of select="CntlAcctNbr" /></LCA> </xsl:if> </xsl:otherwise> </xsl:otherwise> </xsl:choose> I haven't used XSL in years, so I might have gotten the syntax wrong, but the concept should be clear. Since XSL is not a complete programming language and does not have variables, I don't think there is any way to keep track of which HierCD values have already been used. You probably need to use a real programming language and a DOM library to process the XML in that case.
  22. The first caret refers to this: http://www.w3schools.com/jsref/jsref_regexp_ncaret.asp The second caret refers to this: http://www.w3schools.com/jsref/jsref_regexp_not_0-9.asp
  23. Ingolme

    please delete

    I don't think you're on the right forum. We do web development here.
  24. This: div#button_win button { -webkit-appearance: none; } But those buttons seem redundant, just put the onclick handlers on the <img> tags themselves and remove the buttons.
  25. If statements can be nested because any code is allowed within an if statement, even another if statement. Else statements always follow an if statement. The fact that it is inside another if statement in your code is just due to how the code is designed. Properly indenting code is important so that you can know which if statement the else belongs to.
×
×
  • Create New...