This was a frustrating little thing and took me longer than it should so I thought I’d share it with you so if you or your coder/programmer had to do the same thing you wouldn’t waste the time and effort that I did.
I needed to get the original size of some images on a Web page but I didn’t have control over the page so couldn’t guarantee that all images were the actual size.
To get the height and width displayed, potentially scaled, sizes of images use this code:
var imageHeight = document.getElementById("ImageName").height;
var imageWidth = document.getElementById("ImageName").width;
But, if you need to guarantee that you get the actual image height and width then the above code won’t work.
After a bunch of messing around I created this function that worked, at least in all the cases I tried (do you own testing):
var heightAndWidth = null;
var imageToCheck = document.getElementById(imageID);
if ((null != imageToCheck) &&
(null != imageToCheck.height) &&
(null != imageToCheck.width))
while (! imageToCheck.complete)
if (typeof imageToCheck.naturalWidth == "undefined")
newImage = new Image();
newImage.src = imageToCheck.src;
while (! newImage.complete)
heightAndWidth = [ newImage.width,
heightAndWidth = [ newImage.width,
This should save you some time if you need to get this information.
Please note that if you could all use a load event instead of the loop but I didn’t because it appears that the loop is very fast (instantaneous) even on large images, I assume that it’s because the Web browser has already cached it and doesn’t have to download it; but this method is more “old school” although it works on the 5 Web browsers I tried it on.
Click here to download a file with the above code in it.
Last year I wrote a blog post about how to get affiliates to promote your squeeze pages, Easy Way to Get Affiliates to Promote Your Squeeze Page — see http://fromthedeskofdavid.com/blog/tips/affiliates-promote-squeeze-page.
It was a popular post and I received a lot of e-mail about it thanking me and asking questions.
Recently I was asked for some help by Fendi on how to make it work with a different format for the affiliate ID.
The way I had originally set it up the affiliate ID had to be in this format: http://YourDomain.com/?[YourCode]=[AffiliateID]
Some examples of the affiliate ID portion would be:
- hop=theboss123 (ClickBank)
This worked great and covered a lot of ground but Fendi wanted to know if it could work with this format: http://YourDomain.com/?[AffiliateID].
Continue reading Easy Way to Get Affiliates to Promote Your Squeeze Page, Part 2
Last time we started looking at how to build a Web site – see http://dahsu.com/wM3WXG9 — including the main ways to get it built.
The last option we looked at was building the site yourself. We’re going to look at how to do that in more depth.
Before we get started let’s do a quick review…
To build a Web site you need to have a domain name (1&1) and a Web hosting account (Blue Host and HostGator links).
You also need software to be able to design and create the Web pages that are part of your Web site; I recommended KompoZer – it’s HTML editor freeware.
After you have that here is what you do…
Continue reading How to Build a Web Site, Part 2
Web pages are the basic form of communication for the World Wide Web.
Every Web site is made up of Web pages, so everyone who wants to market online needs Web pages; without cash-sucking, profit-pulling Web pages you’ll soon be out of business.
I get a lot of questions about Web pages and how to make your own free website.
So I’m going to do a short series on how to make your own website, one Web page at a time.
It will be for people who don’t know how to create a Web site or who have a Web site and want to be able to make changes to it without have the trouble and expense of hiring someone to do it.
It will be kept simple and basic and afterwards you should be able to get regular sales pages and Web sites done including formatting text, adding pictures and other graphics, and having links to other Web pages (like a shopping cart!); you’ll be making your own website in no time.
If you’ve checked at how much it cost to create a Web site you’ll see people charging less than $100, many charging thousands of dollars and, for large complex sites, it could cost you hundreds of thousands of dollars or more; I’ve charged close to $100,000 for complex, custom-made Web applications.
So being able to make your own free website can save you a lot of money, particularly for new online business owners or those still struggling.
If you want to have a Web site there are 4 main ways to get one:
Continue reading How to Build a Web Site
Are Twitter lists good for anything?
That’s a question lots of people, including myself, ask.
Some people say no, what do you say?
To answer that question I decided to put on my thinking cap, do some research and see if there are any good ways to use the list feature in Twitter.
The good news is, I found lots of ways how using lists would make my life and Twitter better, here is my list my top 5 ways:
Continue reading What Good are Twitter Lists? My 5 Best Uses for Twitter Lists
There still seems to be a lot of misunderstanding about Google’s “duplicate content penalty”; so much so that I felt the need to help clear the confusion.
For Internet Marketers there are a lot of good reasons to have duplicate, or mostly duplicate, content.
There are articles to publish at the social media and content sharing sites in support of a specific marketing campaign.
There are sales and squeeze pages that are targeted to different audiences.
There are even content in different languages.
But there is this fear of Google penalizing you for duplicate content, maybe even going so far as removing your Web pages from their search results.
Simply, that is untrue.
Why do I say that?
Continue reading There is NO Google Duplicate Content Penalty
Think your Google Gmail is safe? Think again!
Yet another flaw in Gmail was recently revealed by security researcher Vicente Aguilera Díaz, who has found previous flaws in Gmail. He found a back door allowing bad guys to repeatedly guess Gmail passwords.
According to his new alert, Google lets anyone with a Gmail account guess another Gmail user’s password 100 times every two hours, or 1,200 times per day.
No “captcha” keeps hackers from guessing passwords and, worst of all, this is per account so if a hacker controls 10 Gmail accounts that’s 12,000 guesses a day, 100 accounts, 120,000 guesses a day, etc.
Gmail accounts cost nothing and it would be easy for a hacker to control a lot more than 100 accounts, I’m sure most control tens of thousands of accounts, if not more.
Then, with a simple software program, a password cracker bot, it would be very easy to “harvest” the password from thousands of Gmail accounts, giving the person complete control over your account and access to all your personal mail and information.
While Google requires the bare minimum for a secure password, 8 characters, they put no other security measures and you could create extremely weak passwords list “aaaaaaaa” or “password”; a lot of people actually do use those.
Fortunately, there is a simple way for you to protect yourself from this problem.
Continue reading Gmail Passwords are Easy to Steal – How to Make a Strong Password