Everything posted by Sitesupplier
-
Tiny problem with onload
Rather than use the archaic inline scripting, opt for the more friendly code: HTML: <html> <head><title>Title</title></head> <body> <!-- body --> </body> </html> <script type="text/javascript"> if(window.addEventListener) { window.addEventListener("load", initialise, false); } else { window.attachEvent("onload", initialise); } function initialise() { func1(); func2(); funct3(); // etc., etc. } </script>
-
Code for a fundraising thermometer
I've knocked up a quick example of how a thermometer might work. It moves up and down with the UP and DOWN arrows and works off a percentage of 100. Assuming that your 100% (your fund goal) digit is going to be known, you could simply find the percent of 100 that your current funds are on and plug that into the Javascript code when the page loads. Obviously you'd remove the key press functionality as well. This could be done with AJAX or simply echoing the value from PHP into the Javascript variable. I tested this in the top 5 browsers (latest versions only) and it works in each. http://www.sitesuppl...amples/jelly46/
-
PHP in HTML, want to add DATE/TIME
Just a quick note: your $date variable isn't even being used here. This script will work exactly the same if you remove PHP line 1 because you're just echoing the date function return value. Not sure what use it is at this point, but the timestamp is the number of seconds since 1-1-1970 so is pretty irrelevant to the current data if you just want to echo it out.
-
Problems with javascript in IE
I can't, but I can give you a little tip. It would be extremely useful to you as a developer to learn to debug your code. All browsers come with a Javascript console/debugger, and familiarising yourself with it is vital to your programming advancement. Knowing what is going wrong, what line is causing the error, which function is in question or which object has returned that NULL value can help you scale down the possible problems and home in on your error. Ctrl + Shift + C in Chrome and Firefox, F12 in MSIE and Alt + Shift + I for Safari. Can't remember what the shortcut is for Opera, but you need to download "Dragonfly", the Opera Javascript console.
-
backlinks strategy
The natural way is the best way and it certainly isn't out of the question even in highly competitive niches. Search engines are gearing more towards high-quality, feature rich content more than ever and the old saying "content is king" is more relevant now than ever. What better way to have regular visitors sharing, liking, following and discussing your content, than great content? The real question is not how to build backlinks, but how to increase exposure so that your backlinks build themselves. Think about it this way: a backlink is seen by a search engine as a sharing, or liking, of content. The whole idea of a backlink is that it gives a user the ability to navigate to your web page. Backlinks exist so that human beings may share content with one another, not for search engines. The Google algorithms are designed around this fact; Google follows users, users don't follow Google. With this in mind, it's important to realise that the only reason backlinks are important is because they give a very accurate estimation to a search engine algorithm the general perception of a piece of content's quality. In other words, the more backlinks a community is giving you, the more said community must think your content is good. So, again with this in mind, the question is not how to build links yourself, but how to increase your exposure so your links build themselves. There's no single answer, no magic bullet and no one-size fits all answer. Techniques range from link exchange, social networking, paid links, forum signatures, real life advertising, but most will only get you so far. Some really great techniques include: Guest posting on other peoples' blogs to prove your worth Interviewing - either being interviewed or interviewing someone with a reputation (this might not be free) Social networking is very important, building relationships via FB, Twitter, Google+, etc. Multimedia networking, i.e., YouTube videos, etc. Competitions, where you give something away for free - always attracts people Sponsoring others that are related to you (normally not free) Editing Wiki-style pages with citations to your website Flyers and business cards develop word-of-mouth promotion Local listings, online listings and directories There are so many ways to increase your exposure so I won't post much more than this, but really my opinion is to not focus so much on manually creating all your links and have other do it for you, the way it was meant to be.
-
Why is Internet Explorer still targeted.
Of course Internet Explorer are not up to speed when it comes to standards-compliance, but as a developer it is your job to make sure you understand the strengths and weaknesses of the browser in question. While Internet Explorer has a bad reputation, it certainly isn't as bad as many believe believe and/or claim. Internet Explorer has brought some good creations with it, despite lacking support. For example the "contentEditable" <div> was a Microsoft IE innovation which has now been adopted by all browsers. You must also be aware that the older versions of Internet Explorer are still used by a large number of people, and those older versions have support for non-standard attributes. For example: function test(event) { console.log(event.target.id); } This code will not work in older MSIE versions because it is the standards-compliant method, to support MSIE < 9, you'd need to use: console.log((event.target || event.srcElement).id); This is just to demonstrate that MSIE does do everything, it has just done it its own way for much of the time. My belief is that they once owned the Web, so had no real requirement to follow the standards so rigorously because they were the only player. Another reason to support MSIE is that many people are still using the browser. The Opera browser, according to Opera's own FAQ, is used by 275 million users. Being such a minor browser should put into perspective just how many people are still using MSIE; and that is why you must maintain support for it.