Forum Moderators: open
In other words which of the two following is the best way to do it:
(1) <a href="http://www.example.com/widget1/widget1.jpg">
(2) <a href="http://www.example.com/widget1/widget1.htm">
Remember that in the latter case the htm page will only contain a picture, nothing more, except for unique meta data(title, keywords, description)
Thank you!
[edited by: tedster at 9:26 pm (utc) on Nov. 28, 2007]
[edit reason] switch to example.com - it will never be owned [/edit]
I was not planning to use javascript in any case.
The first <a>, links to a simple .jpg file, that opens inside the web browser (it is not an html page). The second <a>, links to an html page containing a jpeg photo. Which of the two do you believe is the best way for the search engine spiders to crawl?
To answer the question, it really depends on whether you need "extra data" with the image, which it sounds like you do (title tag, description, etc.) If you want to caption or add a head to the picture, use HTML. If not, just the image.
The "short story" on how to use JS and keep it accessible: you create a link, and in any function that opens your new window, you return false. This is what prevents the link from moving the page to the href URL. If javascript is disabled, it ignores the entire command and uses the link.
<a href="image_page.html" onClick="return newWin('image_page.html',400,600);" target="new window">Enlarge</a>
The function "newWin" returns false. Note the last two parameters, width and height - one of the things about JS is you can specify a window width and height when opening a new window, allowing you to customize it to your image size.
I am probably going to enlarge them as new unique .htm pages, in order to increase the number of my site 's pages.
On the other hand i have noticed that pictures that open as just .jpg files(without any title, description etc - not htm)rank good in google image search.
What is your opinion?
I am probably going to enlarge them as new unique .htm pages, in order to increase the number of my site 's pages.
Using either lytebox or the simpler method posted by rocknbill will do just that. The addition of the JS is just a nice little bonus for those that have JS enbaled, it provides for easier navigation. For seach engines or people with JS disabled they get the normal page because they still have a regular href link to follow.
So if you want this page to be indexed, I'd add product description text and other content as well as breadcrumbing or other navigations that will allow the user to know where they are in the site and to give them navigation to allow them to get back to the other parts of the site.