Archive for the ‘Webdevelopment’ Category

Available

Thursday, July 31st, 2008

The last three years I have been busy  graduating and working on some interesting projects.  Allthough these are very interesting I have decided to make myself available for design and webdevelopment projects again.  Something that I have done the years before.   So if you believe you can use my help designing or developing something  (Especially if it involves website design, website review, HTML, CSS, JavaScript or PHP)  don’t hesitate to contact me to discuss your project.

Weird JavaScript/Browser quirks

Tuesday, March 4th, 2008

The use of JavaScript has evolved over the years.  In the early days we would address a form element using:  myform.elementname .      Nowadays we prefer to use myform.elements['elementname'].   A related problem I ran into and only solved yesterday was, why    myform.submit();  was not working. Google presents the answer as the first result: www.thescripts.com/forum/thread542837.html for the query form.submit does not work.

Because my button was named “submit”    myform.submit refers to the button instead of the function.

Today I encountered a similar but harder problem.    Imagine this form:

<form id=”f1″ action=”go.php” onsubmit=”return ajaxSubmit(this);”><input type=”hidden” name=”action” value=”something” /> ….</form>

So I use  document.getElementById(”f1″).getAttribute(”action”);   to get the action and submit using AJAX.   Which works perfectly well in Firefox… and not in IE…

Apparently  IE does not really get you the action attribute but simply  object.action…. which in turn is the input element instead of the action attribute, similar to the first problem.  Unfortunately I can’t come up with a way to fix the script, so I had to replace the HTML all over the place.  (removing the action named input element by defining the action as action=”do.php?action=something”).