Aleksandar • Vacić

iOS bits and pieces

WCH 2

After the last post, I knew that only IE/Win had any benefit from this script. This way I was able to streamline the script and completely remove the dependency on other scripts. It’s not even needed to do anything on the page load. I also removed the support for IE 5.0 and concentrated on iFrame technique. And it’s a lot smaller: 4.65kB, heavily commented.

Script now has only three functions. WCH_Hider() does all the browser checks and creates the hiding iFrame. WCH_HideWndCtrl() is placing the hider below the layer that needs to go over windowed controls. WCH_ShowWndCtrl is removing the hider.

For those of you wondering what this is all about…read this entry that will explain the problem at hand. Now, on to version 2. I will still explain every part of the script, as I think that this version should be used in the future - it’s much smaller, faster, independent…simply better.

Going X

The transition continues - the website is now based on XHTML Transitional. This was a natural transition. All the hard work was done in the redesign few months ago. CSS based design was the major change, with all the scripts recoded to only use DOM stuff.

At that time, I did not have a satisfying solution for form validation, and there was no time to work on it. I was under pressure to deliver high speed web site and thus no time for trying stuff out.

After the launch, I had plenty of time. Along came the form styling tests, as well as validation ones. I believe that this way of validating is the best of the breed. Script have no impact what-so-ever on the HTML (apart from the field naming convention), thus being the least intrusive. It also works best for ASP.NET pages, as the developer doesn’t have to worry about client-side code emission (VS.NET users will know what I mean).

Another major change is the way Flash is used. Even after redesign, Flash was written using invalid markup. It did not influence page validity as the code was written using Javascript, but I did not like anyway. This is the valid markup now used:

1
2
3
4
5
6
7
8
9
<object type="application/x-shockwave-flash" width="660" height="75"
codebase="http://download.macromedia.com/pub/shockwave/<span class="code-break">»</span>
cabs/flash/swflash.cab#version=6,0,0,0"
data="http://SITE_ADDRESS/file.swf" standby="Loading Flash....">
<param name="menu" value="false" />
<param name="quality" value="best" />
<param name="movie" value="file.swf" />
... alternative content (i.e. img)
</object>

I have more plans for the future. Right now, there are still some server-side decisions regarding what to display to the browsers. And don’t like that at all.

SSL fix for IE

I today encountered a problem with Internet Explorer (oh, well, I know). I used ADxMenu on the page that was under SSL. Page loads fine. Then, I hover the menu actuator, which brings up the famous dialog:

This page contains both secure and non secure items.

Do you want to display the non secure items?

There was nothing wrong with the menu, but with WCH script. If you remember, it creates iFrame element on the fly and places it below the menu.

Well, if you don’t have the src specified for the iFrame, IE treats it as unsecure item, hence the dialog. Solution is simple, as usual (once you find out what is the problem):

1
2
oHiderContainer.insertAdjacentHTML("afterBegin",
   '<iframe <strong>src="/inc/e.html"</strong> id=...></iframe>');

Rest of the line stays the same. This e.html is a simple empty file already present in the project. Use anything you want.