JK Web Studio is a small web design studio, specializing in efficient and user friendly solutions.

Contact us at info@jkwebstudio.com

Archive for July, 2009

Easy way to get single value out of db

Thursday, July 30th, 2009

my $query = “SELECT COUNT(*) AS ‘c’ FROM db.table”;
my $value = $dbh->selectrow_array($query);

Photo Links

Thursday, July 23rd, 2009

http://www.studiolighting.net/homemade-light-box-for-product-photography/

http://digital-photography-school.com/forum/tutorials/28864-magnifying-glass-macro.html

innerHTML on P fails

Wednesday, July 22nd, 2009

From http://channel9.msdn.com/Wiki/InternetExplorerProgrammingBugs/

innerHTML on P fails

Using innerHTML to insert new content into a p tag seems to fail consistently in 6.0.2900.2180.xpsp.050301-1521 on XP SP2. I have a repro case located at http://www.blowery.org/test/innerhtmlandp.html for your enjoyment. Just click on the link and you’ll see IE bomb out. I’ve also seen it silently fail, but I’m yet to come up with a repro case for that.

If you use a div instead of a p, innerHTML works as expected.

This behavior is by design
according to http://msdn.microsoft.com/workshop/author/dyncontent/content.asp

“Can’t put invalid HTML in the document: You cannot assign a string to innerHTML or outerHTML that contains invalid HTML. For example, trying to replace the content of the p element with another p will fail. A p element can only contain text and inline elements. However, replacing the entire p element with another p would work just fine.”

In your repro case you insert

into exististing

. Unfortunately similar mistakes break AJAX updaters on IE. — woid

Objects and JavaScript in IE8

Tuesday, July 21st, 2009

Quick observation in IE8. If you have a form element with id=”myId”, myId is available directly through JavaScript as an object.

<input type=”text” id=”myId” value=”some value” />

<script>
alert(myId.value);
</script>

55 E 87 St, New York, NY 10128

Thursday, July 16th, 2009

<script type=”text/javascript”><!–
pshark_pop_propkey=25100;
pshark_pop_width=480;
pshark_pop_height=360;
pshark_pop_type=”overview”;
pshark_pop_tabs=”overview,photo,map,listings”;
pshark_pop_title=”55 E 87 St, New York, NY 10128″;
//–></script>
<script type=”text/javascript” src=”http://propertyshark.com/api/pop.js”></script>

The text is supposed to be inline
, but is it really?

And what about this
, i’m not sure

Multiple classes in IE6

Tuesday, July 7th, 2009

Multiple Classes in IE

WAMP Setup

Tuesday, July 7th, 2009

Download and install the WampServer software.

Open up your HOSTS file. A typical place to look for it is in C:\Windows\System32\drivers\etc. If you are using Vista, make sure to open the file as administrator. Add IP address followed by host name. Example:

127.0.0.1 localjkwebstudio.com

Save HOSTS file

Open httpd.conf. Add the following code:

NameVirtualHost *

<Directory “C:/path/to/document/root”>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory “C:/path/to/files/outside/root/”>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *>
DocumentRoot “C:\path\to\document\root”
ServerName localjkwebstudio.com
Alias /img/ C:/path/to/files/outside/root/
</VirtualHost>

Restart server