We have a small javascript snippet which runs as part of our ebay item descriptions. The snippet requires the ebay item id.
In testing I found that there is a variable, ebayItemId, which seems suitable. However, if a user navigates directly to the item page (e.g. direct link) without navigating through other ebay pages first then the variable is not present.
How do I access the item id, or should I look to reading it from the DOM?
To elaborate a bit on the ebayItemId variable. I tested by opening a new private browser and navigating directly to the item's page. Interestingly it works as long as the item's page isn't the very first ebay page to be loaded--even with a forced full reload (Ctrl-F5).
Are you using the classic Ebay API? if so, I think you should check the documentation, there are lots of interesting functions you can use:
http://developer.ebay.com/DevZone/finding/CallRef/index.html