Here's how I implemented a javascript-based login page:
function imgError()
{ alert('Sorry, that is not correct.'); :-(
document.enter.password.value='';
}
function imgLoad() { window.location=this.password+'.html'; }); :-)
function tryit()
{ var I = new Image(1,1)
I.onerror=imgError...
I went one better than that... I defined a .write() method on the String.prototype object. You can see it at http://www.uuclb.org/Calendar.html (you'll find my navigable calendar component there too!).
Function writeFn(doc)
{
if(!doc)doc=document;
doc.write(this);
return (this);
}...
I have already implemented a javascript navbar component (among many, many others). You can see it at http://www.uuclb.org/Calendar.html in the horizontal orientation. (you'll find my navigable calendar component there too!)
Basically, you create an array -- just .split() a String -- and tack...
Use the Date object's .valueOf() function which returns the milliseconds elapsed since the base date.
(today.valueOf()-registered.valueOf())/(1000*60*60*24)
Once you have the millisecond difference between dates, convert it to days. Then you can Math.round() it if you want.
I've already created a navigable calendar component (in JavaScript) which accounts for the week-of-month. Take a look at http://www.angelfire.com/ca/redwards/Calendar.html and notice how easily you can select the "2nd Sunday" or "last Tuesday"
As you navigate the calendar...
Help! Help! I've created a solid cross-browser navigable calendar (http://www.angelfire.com/ca/redwards/Calendar.html), but the first button won't display in Netscape 4.7 !!?!
Everything else still works, but the Su (Sunday) button doesn't appear in Netscape 4.7 --- but I have tested it...
Thanks! Feel free to re- File|Save As... from http://www.angelfire.com/ca/redwards/Calendar.html onto your own system and play around with it. Let me know if you like it...
"Richard...
I have discovered that huge complex pages can be rendered by javascript, if invoked by a single .write() statement.
Consider my navigable cross-browser calendar component at http://www.angelfire.com/ca/redwards/Calendar.html
Once the supporting 26K dynamicHTML3.js library is cached, only (new...
I have revised my calendar component http://www.angelfire.com/ca/redwards/Calendar.html to include next/prev day/month/year. From your browser, you can do File|Save As... to play with it yourself. The relevant code is
(new Date()).calendar().write()
NEVERSLEEP: Per your suggestion, I added a "Today" button. I added prev/next day/month/year buttons too.
Take a look... http://www.angelfire.com/ca/redwards/Calendar.html
If you resave http://www.angelfire.com/ca/redwards/Calendar.html to your local file system, I think you'll find that it works (ENTER included) for all browsers (including IE6). I made two significant changes to dynamicHTML3.js
After .form(name) I inserted...
In your browser, save http://angelfire.com/ca/redwards/Calendar.html to your own local file system. Then if you are bold enough to edit dynamicHTML3.js, look for function calendarFn (this builds the calendar). At the bottom of this function, after the .form(name) I have inserted...
wullie: Thank you for your input (no pun intended). If I am not mistaken, the update I have on http://www.angelfire.com/ca/redwards/Calendar.html works under IE/NS/Op 4/5/6 [except for Op4] !!
I look forward to designing more sophisticated pages/sites using clientlets.
Actually, I deliberately avoided using the form's action... Here's why:
Older browsers may lose track of which anchor you're at, upon submitting the form. That may mean that you jump up to the top of the page, even if you didn't want to.
Actually, you (NEVERSLEEP) found a IE6-specific bug... Try it from http://www.angelfire.com/ca/redwards/Calendar.html and let me know if it works for you...
(I inserted a ".onblur(newWeek)" into it).
In your f.html file, insert ".source()" just before the ".write()" and view it in the browser. That'll show you what the browser is attempting to render.
BTW: Why do you say not to use onchange? I use that to update the calendar during navigation.
Try this change:
Point your browser to "http://home1.gte.net/uuclb/dynamicHTML3.js" and download it onto your desktop.
Modify the f.html file to read...
<script language=JavaScript src=file:///C:/Documents%20and%20Settings/Administrator/Desktop/dynamicHTML3.js>;</script>
<script...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.