Archive

Archive for the ‘Javascript’ Category

Hiding UniqueIds in css class names

January 27th, 2009 No comments

I always have a unique id in my databases for each row. When passing this to objects for javascript to manipulate I add it to the class string as ‘id_1′ so I can easily retrieve it later. The GetIds function below returns an array with the id pulled out. It also handles multiple ids in the format of ‘id_name_1′ so we can do something like ‘block id_1 id_Page_1′

Read more…

Categories: Javascript Tags:

Check if an image exits.

January 26th, 2009 Comments off

Javascript can be used to check if an image exist. An AJAX call cannot be used, because cross-site calls are not supported. However, the javascript Image object can be used for this purpose.

var img = new Image();
 
 <a href="http://www.fruitbatscode.com/javascript/check-if-an-image-exits#more-4" class="more-link">Read more...</a>
Categories: Javascript Tags: