Ive created a list of radio buttons that all have the same name and the first one is checked This works ok in
there are about 32 mouseover functions, and all but three work perfectly
notice the input type is button, not submit, so it will not cause the form action to trigger
the three that don't work are exactly the same as the others
so I don't have the slightest idea why it is that they don't work
any clues?
due to a wierd opera css style with text-indent and input
so… button type="button"
then its explicit that its not a submit
because submit is the default button type so you have to have that even though it looks redundant
hi all
does anyone know how javascript determines if /foo/ is a regular expression or a division operator?
get any errors on your JS console when those functions are supposed to fire?
er.. what kind of program would have a console?
I'm using Coda to edit the JS/HTML
firefox has a javascript host console
hmm
and you can get one for IE i'm sure
You still up?
alright
I checked out the error console
but the error makes similarly little sense
it says
document.emp1 has no properties
but emp1 isn't called by the function
emp6 is
so…
what the heck?
then the problem lies outside that function.
does internet explorer recognize location.reload?
well
here's the function that's causing problems
function getscript() {
document.emp6.src = script.src; return true;
}
I double checked that script.src is the right image and that the image doesn't have any errors
so I'm really at a complete loss
If you want to reference an element in your document, use document.getElementById('the_image_id').
hmm
so, for instance
how would I get the id of this:
script = new Image(1024,850);
script.src = "Images/nle/script.png";
Then you refer to it using the variable name script.
I was refering to your emp6 code.
is there a possibility to go through an array without using an index? that's why i have an associative array, which i need to go through.
err
I should probably mention that I'm completely new to javascript ~_~
hmm how is it determined what button in a form is perssed when pressing enter in a text field?
and does that invoke onClick?
i need to do something with every element of that array, which is an associative one.
so i can't use a loop-index?
use the for(var p in object) { … } statement.
I know screen.height, but is there a way to detect the actual browser window height?
how do i get the viewport dimensions of the browser?
any ideas on when jquery 1.14 will be out?
1.13 breaks metadata plugin
hi guys
how can I create array of inputs ?
like document.createElement('INPUT');
but it shoud be array
~_~
screw JS
?
these functions don't work for no reason at all
out of 32 nearly identical functions (only difference is the image hosting being called) 3 just don't work
of course
because computers do things randomly without any logic
apparently
check the source
it's all there
it's never that the programmer doesn't understand what's happenig
http://celluloid.sourceforge.net/Screenshots.html
okay, allow me to illustrate
this function:
rubber = new Image(1024,850);
rubber.src = "Images/nle/rubber.png";
works
this
oh
shit
lol
that's not the function at all
function getrubber() {
document.emp6.src = rubber.src; return true;
}
ok
first
this function works
function getscript() {
document.emp6.src = script.src; return true;
}
doesn't
see any difference?
stop using the enter key as punctuation
secondly
`paste
Paste links, not code: http://erxz.com/pb/ http://pastebin.parentnode.org/ http://paste.css-standards.org/
but you just used the enter key as punctuation yourself
irony is lost on you
anyway, you lose a lot of points for using global variables
tell me which ones don't work
getscript() getpreview() and getfilters()
I checked the images
they're fine
whats the difference between document and window width?
those 3 mouseovers work for me
…
they do?
yeah
uhh
let me try in a different browser then…
I'm pretty confident that if you weren't using global variables (especially with such generic names) then you wouldn't have these problems
I'm really new to JS, it's just something I got off some tutorial
bit stupid to come in here shouting that it's all javascript's fault that your code won't work, then
bbit stupid to come in here shouting that it's all javascript's fault that your code won't work, then/b
hi
well, did you see anything wrong with the functions?
yes
you're using variables that aren't initialised in the same scope
How do you get information about a particular pixel in an image? I know in ff you can draw the image to a canvas then use getImageData. Is there an equivalent method for ie?
those three don't work for me in Camino or Shiira (Gecko and WebKit)
if(instance==null){synchronized (instance){if instance ==null; instance = new Locator(); } } …………. Don't you people think the second "instance == null;" statement is unnecessary ?
synchronized(lock) *
this is javascript, not java.
heh
once again sorry guys
if you have function foo(arg){ code } do you _have_ to pass arg to foo()? is so, is there a way to make it optional?
s/is/if/
You don't have to pass args to foo
unassiged arguments will have undefined value.
thnx
`defaults
`default
All parameters in a javascript function are optional. Any you don't pass into the function are set to javascript's 'undefined' value. Check for param===undefined if you want to set a default value.
also, you can pass extra arguments to a function if you want
is there a way of telling if an element is currently visible to the user, being that its located somewhere on the page not under any other element also within the users current scrolled range?
inside a function you have access to a collection called `arguments` which contains *all* arguments that were passed in
can i do getElementById(variable)? it doesn't seem to be working
getElementById("foo")
its a variable though called blah
blaargh, anyone using jquery multifileupload plugin?
Oki, then it should work like you described…
hello, I have a link a href="" onclick="popup(); return true;"/a. When I click this, in FF, the popup shows and the page doesn't do anything, and this is ok. But in IE, when I click the link, the popup shows but the page, goes to index.html
any ideea why this happens ?
how do you declare a string variable?
`js string
`string
hi
does it make sense to detach a handler for an event when a page is being closed?
if yes, how do I do this in a cross-browser way?
is there some type of onclose event where I can trigger this "cleaning up" sequence?
onunload
how did you attach the handler?
var s;
it's a link; the click event causes the link to be followed, unless it's cancelled
the return true should've cancel it right ?
no, that allows it
return false
aha, thanks
remember it by thinking of returning the result of confirm("Do this?")
deltab, I attached the handler using "obj.event = Fn"
then the reverse is obj.event = null;
I'm working with msie6.0, I could also do this with attachEvent. it probably has a corresponding detachEvent
deltab, does this have any advantages?
yes, though other browsers may not have attachEvent/detachEvent and 'this' won't refer to the element receiving the event
deltab, the other browser probably have addeventonlistener or something. I'd rather do it the cross-browser way.
deltab, I don't understand your second point about "this" sorry.
deltab, could you please explain?
for example element.onclick = function () { this.firstChild.checked = true; } can work because 'this' means the element clicked on
do you mean to say that "this" is a msie only object? I have used this earlier on firefox, and it's cross-compatibl.
but if you attach the handler some other way, 'this' will refer to the window
I'm not using anonymous functions.
it doesn't matter whether they have names or not
Is onunload portable?
I mean w3c approved?
http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.3
ah, that's great.
deltab, I have put all the (relevant) elements in arrays.
should I just run a for-loop on all of them to register the onunload event?
"The onunload event occurs when the user agent removes a document from a window or frame. This attribute may be used with BODY and FRAMESET elements."
ah.
bot json
js ref json
js ref
deltab, thanks a lot.
I can't seem to find one of those guides telling me how to emulate non-a:hover in MSIE 6.
With JavaScript.
I have found this via Google before, but not today.
Any tips?
focus ? onblur ?
…
Talking about table rows switching colors when you hover them.
I should have kept the code I spent a lot of time with before.
doable with a css trick I think.
http://css.maxdesign.com.au/listamatic/
css goodness.
I don't see how that is possible since MSIE 6 only knows about a:hover.
That URL is irrelevant.
… , fetch the object, tr_obj.onmouseover = function () {this.style.backgroundColor = "#f00"} ?
Hello
Catnip96_, get the shiznit?
How can I get the css hover oroperty using js?
Sounds like BobTheMighty has the same problems as me.
google?
Google is overloaded with info and giving hard time
Yes. I cannot find anything of value with that crap engine.
Its not crap but it has this weakness
is there a regular expression list anywhere for javascript functions?
Catnip96_, did you get my proposal for your problem?
Sorry… I did not understand that.
This must work without any modification of the HTML.
So it must auto-detect any table, and then do its thing with the trs.
so?
Your line of pseudo-code frankly makes no sense whatsoever to me. :$
you can just go fetch the object with document.getElementsByTagName … etc.
change the style of the tr dynamically for an onmouseover event.
Hmm.
Is it that simple?
No looping and stuff like that?
probably not, but it's a start.
go experiment with the thingy already.
css / javascript hosting makes for a deadly combo.
I hate MSIE 6.
btw, you can combine behaviours by associating a class with a certain behaviour and specifying the classes of the element with element style="class1 class2 class3" /
Is that even possible to get the HOVER properties using JS?
Yes, it is.
But I cannot for my life find the articles now.
I am desperately trying to find them on Google.
I've found it before, and implemented it.
Uhhh… same here its driving me mad
If you find one, please tell me.
I remember it had two simple loops and a simple assignment.
Bound any other propertie, porn and lots of menues
Found*
Any luck?
"dramman" at 71.6.194.243 pasted "wierd problems with inheritance" (23 lines) at http://erxz.com/pb/3924
when I step through the call to the constructor of the subclass, none of the object are shown in firebug (nor available to js)
example code plz.
5 lines up ^
see http://phrogz.net/JS/Classes/OOPinJS2.html or http://phrogz.net/JS/Classes/OOPinJS.html
I've created a list of radio buttons that all have the same name, and the first one is checked. This works ok in Firefox but in IE I can't select any radio button. When I click on it it just stays unchecked. What am I doing wrong?
anyone?
ah, thanks
csaba, example code plz.
You mean that shape.redraw is undefined?
"csaba" at 71.6.194.243 pasted "radio button doesn't work" (8 lines) at http://erxz.com/pb/3925
which of the properties vanishes?
all properties?
seems strange if you loose the actual objects (shape and line)
any idea why it won't work on IE?
all properties are there, from both base class and sub class, but _no_ functions are there
ball properties are there, from both base class and sub class, but _no_ functions are there/b