Pre 2.0 Safari doesn't recognize .toFixed() and quietly dies in response. Since toFixed() is the *perfect* solution for this problem you can use prototyping to insert manual formatting in those cases where toFixed() is not supported.
if ( !Number.prototype.toFixed ) {...
showhide() toggles the contents of "state", a global variable. Not the same thing as toggling the display state of each specific layer. (If you try three layers the hide mechanism should work for the 1st and 3rd.)
To fix your function attach a state variable to each layer or use the display...
IE only, the JavaScript to extract the text of an HTML document into a string variable is as simple as --
var s = document.body.innerText;
This string can be passed through cgi to Perl for further processing. A quick test shows a cr/lf appended to the text of most individual HTML elements.
In times of yore, in the days before steamships, higher math functions were shunned because of their high cost of computation. A toggle using simple arithmetic:
function toggle( i ){
return ( 1 - i );
}
works fine as long as the parameter has been initialized as 1 or 0.
A deceptively un-simple little challenge. I thought it would be easy enough to make an "English major" optimization -- write a JavaScript solution that doesn't require an enormous amount of decoding to extract the algorithm. Self-documenting, sort of.
The English language rules for formulating...
The script that fails for Safari uses some IE-specific graphic effects --
slideshow1.style.filter="blendTrans(duration=2)";
slideshow1.style.filter="blendTrans(duration=crossFadeDuration1)";
slideshow1.filters.blendTrans.Apply();
Try commenting the effects out, see how Macs like it.
cloneNode() is the best I've come up with so far.
<script type="text/javascript">
function showTest() {
var oSpan = document.getElementById("nDash");
var oDiv = document.getElementById("testResponse");
oDiv.appendChild(document.createTextNode("This ( "));
oDiv.appendChild(...
Spin counter displays in JavaScript are do-able in the "extreme pain in the ass" sense of the word. If you're not concerned about modeling what's *really* happening inside the program put up an animated gif that looks like a working counter. Simple, reliable, will fool most viewers.
BTW, for...
If there is a server side process creating an activity log, why can't it figure out when the task is done?
Assuming the server side process isn't up to the task, how about piggy backing Notification Of Completeness onto whatever mechanism keeps the server log up to date?
Or, use the onUnload...
New to Perl, loving it. My approach to this problem was to use split() a couple of times, tidy up the pieces.
while(<LOG>) {
($vIP,$rfc931,$username,$timestamp,$tz,
$request,$uri,$protocol,$sc,$size) = split;
($x,$x,$x,$referrer,$x,$uaString) = split(/"/);
vIP is visitor IP addy, tz...
The onSubmit event built its alert() message before the global changed state. When the Submit event built its alert() message the global variable was True, but by the time the Submit message finally got to the top of the task queue the global state had changed. Such is asynchronous life...
This might work for you. Define Week 1 by plugging in the last day of that week then hand a date to WeekofYear() and get back a week number relative to Week 1.
var gWeekMs = 1000 * 60 * 60 * 24 * 7;
// initialize to Saturday 3 Jan 2004
var gWeekOneMs = Date.UTC(2004,0,3);
var gLastDay...
Try this --
var gSwitch = 1;
var agSrc = new Array("Inside01x.jpg","Outside01x.jpg");
function toggle(iSwitch) {
return (1 - iSwitch);
}
function showImage(oImg,iSwitch) {
oImg.src = agSrc[iSwitch];
}
function changeImage(oImg,iSwitch) {
gSwitch = toggle(iSwitch)...
An interesting challenge.
Tactical problem: the act11() function references "advan1". There is no "advan1".
Strategic problem: the direct reference to specific JPGs by mouseover/out looks like it will undo any switch toggling.
Perhaps something like this --
var gSwitch = 1;
var agSrc = new...
Dump the constant information into an array indexed by PlantType. When Title is required, ask the array. In JavaScript something like --
var aTitle = new Array();
aTitle[6] = "Cranes";
aTitle[7] = "Excavators";
aTitle[8] = "Dumpers";
aTitle[9] = "Telehandlers";
aTitle[10] = "Compressors"...
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.