Troy III 272 Posting Pro

There's no JS built in method named "compact" in Array object or any other js Object for that matter.
What does it mean anyway?

What should >>array.compact<< do with it, to your understanding ?

Troy III 272 Posting Pro

You've installed Firefox after IE9. You need to reinstall it.

Troy III 272 Posting Pro

amount += parseFloat($(this).metadata().amount);

I think, the true solution is a:

amount += parseFloat($(this).metadata().amount).toFixed(2);

This makes sure you get: [2.50] kind of values.

Troy III 272 Posting Pro

No, there's no such problem on IE9.

Troy III 272 Posting Pro

can anybody explain to me what is the point of having a sleep function in JS, or in any other language for that matter?

Troy III 272 Posting Pro

Fx decided not to support mp3.
but an 'ogg vorbis' copy might work.

Troy III 272 Posting Pro

First
you need to disconnect the "ball" image from the document flow: using absolute positioning.

Troy III 272 Posting Pro
            <img onclick="changeImage(this,'/folder/images/23.jpg');
                                src="/folder/images/23_thumb.jpg" alt="">
            <a href="theurl">
                <span>this is it</span>
                <h3>This is it</h3>
                <p class="caption">lorem ipsum...</p>
            </a>
Troy III 272 Posting Pro

I suggest you study this code at http://www.daniweb.com/web-development/web-design-html-and-css/code/226127/pure-css-image-gallery-with-mouse-click-swap and see what you come up with.

pick the updated (html5 & back.comp.) code from the last post to play with. May give you some advanced ideas on how to.

Troy III 272 Posting Pro

This is easily done on IE using the FSO (file system object) locally.

For Firefox you should look into XPCOM for which there are some libs like jslib and io.js that can be used.

Troy III 272 Posting Pro

Hi, I have a very simple question but one which creates a lot of bother!!
In Notepad (and even notepad++) when I open an html file and after editing try to save it, it says..'the process cannot access the file because it is being used by another process' and follows up with a 'SAVE AS' box. This happens even though the html file is not open in any browser! Any solutions or tricks are welcome!

you are invoking the page you are editing from the file explorer
deselect it before trying to save your changes.

Troy III 272 Posting Pro

you can simplify this

function interpret(){ var a=null; a=document.forms["input"]["box"].value; if(a==null) { alert("Enter some text"); return false; } else { alert(a); return true; }}

with

function interpret(a){
    a=document.forms['input']['box'].value;
    if(+a==0)
        alert('enter some text');
        else alert(a);
};
Troy III 272 Posting Pro

you can use text property instead of innerHTML and avoid [slow] string manipulation through js. like in:

for (var idx=0; idx<preElements.length; idx++) {
      preElements[idx].innerText=
      preElements[idx].textContent= //firefox
      preElements[idx].innerHTML ;
}
Troy III 272 Posting Pro

IE sucks so bad!

is not a discussion.

thank you

Troy III 272 Posting Pro

No sun, I'm not a zealot,
and that was not asking a question
that was you declaring your zealotry.

If you hate IE it's your lack of knowledge on this browser side and something you'll have to deal with yourself.

And on contrary, IE is the first browser in history who started supporting standards.
That was until standards body got cluttered by Netscape losers who took "standards" as a weapon of war and went completely south -that is, against the coder (and friendly coding); against IE; and against already established standards soon after Netscape went sold to AOL. IE 4 was fully standards compliant which also offered some extras which are possible only after 14 years of w3c jerking around that is -wagging war against the best browser in existence. Mind me saying.

Everything done afterwards, came as a result of hundreds of hours of thinking on how to make existing standard IE versions non-compliant with perpetually revised standards. Which also included defecting from common sense and the standard itself, just so you can say IE is non-compliant because for instance: " 'name' attribute is a part of standard which IE doesn't support", no matter the fact that the name attribute was completely abandoned / deprecated by the same standards in exchange for the newly introduced ID attribute according to which: name and id are to be treated as one and the same, and to be supported only for backward compatibility until pages using name would faze …

Troy III 272 Posting Pro

no no no
I never said it's not a 'method' , I said not a DOM Method. And it's not.
Options are not HTML Elements - they are Controls.
It doesn't matter if they are invoked by markup or if this markup can be read from the mirroring DOM.

Further, -no, It's not a bugg.
And no, its not fixing it. -It's complying to a prevalent wrong concept on the matter.

Troy III 272 Posting Pro

That's some of the dumbest reinventions I've ever seen!
Moreover it's against the core principles of web coding.

Have you ever heard of CSS?
i.e.:
visibility: hidden / visible;
or
display: none / block / inline-block;
etc?

Evermore, w3schools are teaching you wrong HTML(5),
Because in HTML(n) you don't have to write: <p hidden="hidden"> because it is a Boolean!

You can write <p hidden="bananas"> for that matter and it will work.

The proper HTML syntax is: <p hidden> and it will suffice.

And how about <p disabled> or <a href=" " disabled>
"All non IE browsers suck!"
or should I say: you suck too for not knowing that content presentation is a css matter.

|-|x commented: If you don't want to help, don't post. -1
Troy III 272 Posting Pro

Illustratively, and in a real world:

it's as if you're trying to insert a matchbox in a stick, instead of the other way around; which is sane and you just might succeed in doing so.

In virtual world 'physical properties' of 'things' are not that rigid. But there are reasons you shouldn't do it.

One of the reasons is that an anchor / link element -is an inline element, (marker), -while div's are block elements, (containers)

and
because you don't have to wrap a div in it for it to be able to link you to some other content

and
especially not, -to make it an anchor element (so that a proper link could navigate you [directly] to that div content)

and
most importantly it adds confusion to the DOM Tree mirror.

Troy III 272 Posting Pro

you didn't have to write all this code to load objects via xml; Apache commons digester is a library for OXM (object xml mapping). we don't want to reinvent the wheel now do we.

I think we do,
Crockford already did, (think JSON).

Troy III 272 Posting Pro

RE: 'most creative functionality' ... is it:
- creative uses of math functions
- new software utility for users
- improving the qualification and the productivity of the users ... or what

RE: 'most elegant code' .. is it:
- created with class & style
- what are the criteria to eveluate the code as being elegant or not, and how 'most' is applied to this
- if a code is clean, simple and easy to understand ... on paper, and 'tragedy in three acts' on a computer ... is it still elegant

RE: 'most efficient algorithm'
- where is the metrics to measure this efficiency - speed/running time; 'space' memory used in its operation; performance per watt/total energy used ... or something else

... and BTW what is the hardware platform.
If a code runs on i7 without problems ... and 'not igniting' on a Laptop Celeron, what are we doing.

RE: I don't dare to ask where is the Task
If the task was one and the same to all competitors (like for example 'how to land the financial system back on Earth') the code might be compared more easily.

Let's see...
1 most creative
2 most elegant
3 most efficient

Empirically, these three notions are interchangable...
all are interdependant, but the third one is somehow the master of them all.

You can't write an efficient code without it being elegant, nor can …

Troy III 272 Posting Pro

that's only what you believe. It doesn't mean you know it.

Troy III 272 Posting Pro

According to the latest moves,
it is Chrome who is besting Firefox, while IE is keeping its own.

Firefox has fallen to 20% while Chrome has risen to 20% of the market share.
Three months ago it was about (24% fx) by (16% Ch) ratio

Meaning...
Chrome is gaining exclusively from Firefox market share.

Troy III 272 Posting Pro

the guy at webbugtrack can't tell a sheep from a goat.
His title says: "bug 274 - DOM Methods on Select Lists don't work in IE"
First: The innerHTML is not a DOM method!
Second: Options are not HTML Elements they are Controls.

Troy III 272 Posting Pro

here is a working demo without jquery, which doesn't use javascript either!
And see what you cam make of it...
http://www.daniweb.com/web-development/web-design-html-and-css/code/226127/pure-css-image-gallery-with-mouse-click-swap
ps: use dhe updated code from the last post.

Troy III 272 Posting Pro

You don't have to memorize it, (that's not how we learn), you read and let things that matter stick by themselves and create yourself a memory overview on the matter so that each time you have a task or a matter to resolve you will know where to look and what to look for. You become familiar with the matter and resources, the rest is experience and of course natural borne talent.

Troy III 272 Posting Pro

"Only Firefox 3.6 is fully compatible with our site, says eBay"

I think that what (thee amateur) coder really meant to say is:
- I've managed to write a site that fully works only on a single browser...,
- that is: only about "20%" of visitors will be able to decode my coding dialect.

Troy III 272 Posting Pro

OK Here is some explaining of it:

var image1=new Image() //creating a DOM Image Element
image1.src="Sunset.jpg" //assigning the source & preloading the image file(s)...

var step=1 // creating a globally accessible counter variable;

if(!document.images) // checking for images coll., existence; duck-converting the find into Boolean (true / false)

return; // canceling the function if find turns false

document.images.slide.src=eval("image"+step+".src") // feeding the slide src attribute with the preloaded image loc., in steps.

if(step<5) step++ //checking if step var hasn't exceeded the max num., of images & incrementing by 1.

else step=1 //otherwise reset to starting value

setTimeout("slideit()","1500") // setting the timer of this function call

slideit() // initiating, actual function call

without spoiling the idea of the given approach completely, I would've rephrased it this way:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>
<img src="blue hills.jpg" name=slide width=350 height=300>

<script>
    onload=slideit;

    var src="sunset.jpg, winter.jpg, blue hills.jpg, turf.jpg, white.jpg".split(", "), images=[], step=0;
        for(x in src)images[x]=new Image, images[x].src=src[x];

    function slideit(){
            if(!document.images)return;
        document.images.slide.src=images[step].src;
            if(step<4)step++;
            else step=0;
        setTimeout(slideit,1500);
        }

    </script>
</body>
</html>
Troy III 272 Posting Pro

you can start with DOM 1 by reading this first : http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/DOM.pdf
but to actually learn something you need to visit MSDN and MDN

Troy III 272 Posting Pro

well, not in my case :), especially when it comes to js + css animations, IE versions are light years ahead.
So to back this up - here is a code I wrote for IE4 (if I'm not mistaken); - Yes, it's that old...
It weights less than 1KB and yes it was worth of about 1MB flash of a full-screen reso.bck than.
Yet again, other browsers can't play it as smooth as IE's always did, not even the most up to date editions.
I'm not using IE fade effect, because a decade ago, no other browser could do that, that's why this code uses color fade simulation.

So here it is, - anyone can try it and test on his own:

<!DOCTYPE html>
<html>
<head>
<meta name=Author content="b.b. Troy III p.a.e.">
<title>intro</title>
<style>
#cnt{position:absolute;left:-100%;width:300%;text-align:center}
body,html{margin:0;background:black;overflow:hidden}
</style>
</head>
<body>
<div id=cnt><i><div id=ctr></div></i></div>
<script>
onload=start;
var ctr=document.getElementById("ctr"),r=255,g=88,b=64,i=1,j=0,msg=new Array("KEEP&nbsp;","WALKING","SEARCHING","TRUSTING","Learning To Make Choices For The Future..."),E=ctr.style;
function H(){E.lineHeight=document.documentElement.clientHeight+"px"}
function start(T){
        T=setTimeout('start()',30);
    if(r>0){
        j+=3; r-=4; g-=2; b-=1; ctr.innerHTML=msg[0]+msg[i];
        E.color='rgb('+r+','+g+','+b+')'; E.fontSize=j+'px'}
    else if(i<3){
        i++; r=255; g=88; b=64; j=0}
    else{
        E.color="rgb(255,88,64)"; E.fontSize="16pt"; E.letterSpacing="3pt";
        ctr.innerHTML=msg[4]; clearTimeout(T)}
    }
onresize=H;
H(); 
</script>
</body>
</html>
Troy III 272 Posting Pro

right now ?
listening to:
http://www.soundcat.ch/radio.php?cat=alternative
[ you'll beable to download the ones you like and of course skip what you don't like ]
enjoy ...
!/while in Beta/

Troy III 272 Posting Pro

I want to access a remote VB application(located on server) on a client machine via HTML web page.
Is it possible?

Is there any other way?
Actually initially they wanted an VB application to see punch details.Now they want to integrate it on local intranet so that user can launch the application by a hyperlink.

of course you can
anything can be launched from a hyperlink, for more integration and probably using web code as an interface of your vb app you can use HTA extension on a html document.
ps.:
search at MSDN for HTA applictions ...

Troy III 272 Posting Pro

HTML5 update

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name=Author content="b.b. Troy III p.a.e.">
<title>Image Gallery</title>
    <style>
    *
            {
            margin: 0;
            padding:0;
            border: 0;
            font-family: 'Trebuchet MS', Helvetica, sans-serif;
            }

    body
            {   
            background: white;
            width: 774px;
            margin: 5px auto;
            }

    .gallery
            {
            position: relative;
            height: 100%;
            width: 100%;
            margin: 4px 0 4px 0px;
            left: 2px;
            background: url('http://www.layoutstar.com/images/allbackgrounds/bgs/artistic/artistic_background_01.gif') no-repeat 73% 48%;
            }

    .thumb span
            {
            position: absolute;
            top: 1px;
            left: 218px;
            border: outset 1px #f0f9ff;
            visibility: hidden;
            text-decoration: none;
            color: black;
            padding: 30px;
            }

    .n1:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/dry-drought-arid-dirt.jpg')
            }

    .n2:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/Sun-Valley-golf-course.jpg')
            }

    .n3:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/close-up-colorful-iris.jpg')
            }

    .n4:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/stress-fish-blender.jpg')
            }

    .n5:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/paragliding-valley-sport.jpg')
            }

    .n6:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/hurricane-space-earth-horizontal.jpg')
            }

    .n7:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/world-globe-in-oyster-beach.jpg')
            }

    .n8:focus span
            {
            background: url('http://www.billfrymire.com/gallery/webJpgs/periodic-table-chemistry-science.jpg')
            }

    .thumb:focus span
            {
            visibility: visible;
            background-repeat: no-repeat;
            background-position: center 30%;
            background-color: #f9f9fa;
            }
    .thumb:focus img
            {
            border: 1px #666 solid
            }

    a,a img
            {
            height: 102px;
            width: 102px;
            }

    span img
            {
            visibility: hidden;
            width: 490px;
            height: 320px;
            display: block;
            }

    h1
            {
            padding: 30px 20px 30px 15px;
            background-color: #444;
            color: #f0f9ff;
            padding-left: 20px;
            }

    h1 i
            {
            color: #aaff44;
            }

    b.o,b.m,b.x,b.i
            {
            display: block; background: #444; padding-top: 1px;
            }

    b.o
            {
        margin: 0px 5px;
            }

    b.m
            {
            margin: 0px 3px;
            }

    b.x
            {
            margin: 0px 2px;
            }

    b.i
            {
            margin: 0px 1px; padding-top:2px;
            }

    h2, h2 span
            {
            overflow: …
Troy III 272 Posting Pro

WebKit FIX-ED
...found a cure.:

       <div class="gallery">
       <a class="thumb n1" href="#" tabindex=0>
       ...
       </div>

add a tabindex=0 to all thumbs of the gallery

Troy III 272 Posting Pro

your Monitor is geting old...
time to replace it.
ps there's nothing wrong in the given screenshot

Troy III 272 Posting Pro

(the code you've sent is not javascript)
all methods are functions, properties may also be functions. In case of length, -it's not a property, it's a value which (in in turn, and in fact) is a result of (an internally) self-triggered function.

Troy III 272 Posting Pro

yes, I've noticed that...
regretfully, webkit newcomers who happen to know nothing about web browser traditional behavior have introduced an unexpected bug.
the links are wrongly losing focus on the mouse-up fraction event, although the tabbing is still intact, there's nothing much I can do against wrong implementations on the browser side.
thank you

Troy III 272 Posting Pro

yes, of course
you have my permission.

Troy III 272 Posting Pro

I think that what you are looking for is in fact The DOM API.

Troy III 272 Posting Pro

So does it solve your problem or not?!

Troy III 272 Posting Pro

Hello

I'm trying to generate a JSON file with the JSON.Stringify, but, the quotes that are generated by my code o are not compliant with the json format. It's generating smart quotes to the left like (“object”:“pair”) instead of ("object":"pair")

Does anybody knows how to solve this? I've searched dozens of articles but none was clear or worked

That's not possible, json doesn't do smart quoting.

Troy III 272 Posting Pro

it takes years of experience to write simple code.

Troy III 272 Posting Pro

How about:

var d=[];

    d[1] = [2,17,18,19,20];
    d[2] = [2,18,19,20];
    d[3] = [2,18,21,19,20];
    d[4] = [2];
    d[5] = [2,18,19,20];
    d[6] = [2,18,21,19,20]; 
    //etc..

alert(d[value][0])

will this do what you are aiming for?

Troy III 272 Posting Pro

I'm not being able to understand what would "jQuery Object" mean exactly, since I don't use it. But...

I suppose that when referenced upon - these jq., dom objects - are somehow wrapped by it enabling you to use few or more extra methods not available on DOM api, - than the quickest run about might be by setting its "display" property to 'none' and perhaps give it an ID before appending it to the document so you can create a jQ handle for it with a conventional jQuery call as with any other element.

It's a workaround, but might serve you well until some other more direct route is found.
This is, of course - in case that the code from above didn't work for you.

Troy III 272 Posting Pro

Javascript .style= overides CSS Hover?

Exactly! That's what it should do. -Its an expected standard behavior.

Troy III 272 Posting Pro

you said

That's OK if you don't care about people still using older pre HTML5 browsers. For many developers, that's still an isssue.

And I said:

<!doctype html>
will enforce the standards mode even on Explorer 4.0
which renders your point, pointless.

I also added that

All browsers will stick to their highest release level of suported standards in case of a proper html doctype which is:
<!doctype html>.

And also made clear that:

After this is set, all you need to do, is give alternate instructions suported by release versions you aim to support.

So, what is the part you are having problems to understand?

Troy III 272 Posting Pro

Perhaps you know more than I do in this busines
but one thing I know is that <!doctype html>
will enforce the standards mode even on Explorer 4.0
-but you never even saw an IE4 browser let alone code for it, so how would you otherwise get to know these details anyway

Troy III 272 Posting Pro

what javascript fonts?

Troy III 272 Posting Pro

That's the whole point -There are no older browsers.
All browsers will stick to their highest release level of suported standards in case of a proper html doctype which is:
<!doctype html>.
After this is set, all you need to do, is give alternate instructions suported by release versions, you aim to support.

Troy III 272 Posting Pro

<!doctype html> fixes it - I already tested it.

Troy III 272 Posting Pro

<!doctype html>

That's the only html standard.
The thing you are using is an old w3c crap trying to befriend xhtml parsers which in fact was never used and most of the time didn't exist.