newPopUpdocumentgetElementByIdinputTextFielvalue =New Textentry firebug firefox js debugger says that
(2) your HTML is crap
2
what a crap, I was trying to do something very stupid huh? and had a fix so simple!
how do i make it so if i refresh my page, the drop down boxes contain the same selection
guess this kind of things comes with experience
you'll need to store the selected values somehow, then reapply them when the page loads
what data do i store from the select box
you could modify cookies, send messages to the server, or use Flash or Google Gears
the selectedIndex value
ShaunO`work: no, not (2), both
ah ok, so this does require javascript then
is there any way to debug JS in IE, or see what JS is being run? IE 6
`ie tools
Gah
Who actually *designed* mplayer?
designed?
'lo
yeah, it pretty much is
oh hihi Twey
Jan-: It is
they have about four different volume controls.
Jan-: But it's *good* code, and some seriously high-quality spit and Krazy Gloo too.
More if you encounter the pan and channels filters.
And none of them are interactive.
what do you mean by interactive?
well, I'm writing something that'll make it fade in sound.
So, I set volume to 0, then 1, then 2, etc.
That works fine.
The problem is you can only *set* volume once the file is loaded, so what I get at the moment is a blip of sound at full volume, then it snatches it back to 0 and does the fade in.
So, I can set -af volume=-200, which certainly mutes sound by default.
Hahaha
But the slave-mode set_volume command is a *different* volume command to the audio-filter volume command, so I can't change that in slave mode.
uBut the slave-mode set_volume command is a *different* volume command to the audio-filter volume command, so I can't change that in slave mode./u
Whoever designed this program is on CRACK COCAINE.
Heheh.
But at least they enjoyed themselves.
Jan-: You've spent so long on this now you probably could've rewritten mplayer
On the upside, if you need a feature, you just get half an hour's quality reading time with the man page.
And there *will* be an option called -veryspecificthingonlyyouandoneotherpersonintheworldeveruse.
lol
-vstoyaoopitweu
does anyone knows a script that do a search using ajax? to put it in a text input ?
to wit:
there is one in sugarcrm but it's very difficult to stole
-lavdopts
What on *earth* is a "lav-dopts?"
Toerkeium, There's one in rico and probably one in dojo too.
But I'm not sure about dojo.
I'm not so much writing it anymore as bug fixing.
This is a bug.
Rico has a demo with the yahoo search api as well.
I suspect Johnny User may have to deal with it.
what do you mean by "rico" ?
Toerkeium, You asked for a script, that the name of a toolkit containing said script.
ohh.. didn't know about it. gonna search, thank you
"-lavdopts vsimv=0:idct=0"
not only is there not a word in there, there's barely even any vowel sounds.
do you know what programming skills are needed to work with rico?
as java for dojo for example
You don't need to know java web hosting to use dojo.
ony javascript?
I suppose you could argue that it borrow some ideas though.
Jan-: the 'bug' option for that is even worse; you have to specify the flags as bits, but in decimal
You only need to know javascript to work with any javascript toolkit/library.
GWT has to go and be confusing but that isn't really a javascript toolkit in the conventional sense.
it's not; it's a Java toolkit that compiles to JS
I guess that toolkit is very different from a framework, which is what dojo and gwt are right?
*thing*
that's the T
have you tried Xajax? from php
and I don't think Dojo is a framework either
"The Dojo Toolkit", it calls itself
just heard it, probably someone using the wrong words
definitely
Dôjô actually
Twey, what does this mean:
mp_dxOverlayGeometry = '0:0';
I wanted to start working with "one", not sure yet which one to pick
Jan-: I'd guess the geometry of a DirectX overlay
how can i populate a dropdown list with data from and XML file
Jan-: But I've no idea what a DirectX overlay is.
DMjM to be exact
*probably* means "don't
Xajax seems to work pretty well, but it's only suitable for php
Yeah. I can't remember.
Dôjô, DMjM, Doujou, and Doudyou are different ways of Romanising the same word
It's easier for me to type ô than M
Jan-: it might mean offset by 0 in x and 0 in y
is usually used for ratios
all the examples i am finding are using .NET
Jan-: like the -geometry option
I think that's what it is.
Anchor the display to the top left corner.
(the directx video output module is as broken as a crystal goblet on the way down from the Empire State)
How do i select a value in a select box using javascript
use DOM
set selectedIndex
I have tried
its just not working
are you using IE?
yes
and firefoc
firefox
You're doing something wrong then because it works
(actually, IE has trouble if the select is display='none')
how can i get the amount of children in an XML host file
Can you supply me with an example
under a node
Wow, this is frustrating
document.Form1.state.selectedIndex=3; will that work?
Well, should it work
maybe, but I wouldn't rely on it
there are better wats to do it
document.forms['Form1'].elements['state'].selectedIndex = 3; would be better
document.forms['Form1'].elements['state'].selectedIndex = 3
curse you and your fast fingers
…looks like DOM to me
ahh i figured out why it is not working
Im not using numbers for value
im using state initials
AR
NY
etc
document.forms['Form1'].elements['state'].selectedIndex = AR
that is just not working
that will not ever work
Haha well thats great news
selectedIndex is a numeral
to get the value of it you have to perform another step
objRef = document.forms['Form1'].elements['state']; objRef.options[objRef.selectedIndex].value
but you can't set them that way
with letters
if you want to change it, you will need to change it based on the order
the number
for (var i = 0; i select.options.length; i++) { if (select.options[i].value == value) { select.selectedIndex = i; break; } }
hmm, so is it possible to do this without changing my state names to numbers in my select
like that
very nice
i would have set a var to sel.options; but thats just me
haha now to just try and adapt that to wha ti have
why a select box for state abbreviations, though? http://www.useit.com/alertbox/annoyances.html
thats because people are novices
i live in texas which equals tab, t, t, tab
can someone help me this javascript validation
I don't live in texas
I don't live in ANY of the united states
deltab where do i stick all that fancy stuff you have me before
gave*
document.forms['Form1'].elements['state'].options[1].value
?
document.forms['Form1'].elements['state'].options[i].value
sorry
i'm saying. any stat drop down box or country for that matter requires a few key presses
I've had to point out to people that you can use keys that way
and it doesn't always work
it only doesn't work when they are not sorted
Or if you use IE
in which case typing 'te' will switch from texas to something beginning with 'e'
can someone help me this validations
http://www.takashimaya-ny.com/product_detail.php?productid=16346
Im lost
some browsers let you enter a prefix, others require you to press the initial letter again to move to the next (and hope you don't have lots of options starting with the same letter)
I am a beginner and your throwing these loops at me like i know what im doing
is there anything better then microsoft script debuger for js debugging in IE
yes, everything
`ie tools
deltab, thx
Though 'better' could == 0.0000000000000000000001%
can you help me on my javascript validation
http://www.takashimaya-ny.com/product_detail.php?productid=16346
How do i use that loop delta
nyctaka ; pw : nyctaka
woosta, deltab, any recomendations
MSE is pretty good, unless you're Woosta
The paste 638111 has been copied to: http://erxz.com/pb/3824
hmm how do i know if i am woosta?
I hear that Visual Web Developer Express is a better version of the same thing
Easy: Are you the most elite god damned mother fucker in the world?
ummm, let me check
do you have a minute?
lol Woosta
select is the select element, value is the string to match
when you get a chance do you mind help me on this validation thing
or maybe someone can help me on this would be nice
nope guess not, i meet all the prereqs accept the damned part
except*
LOL
alex^_^: what's wrong with it?
are you on the pag?
im trying to do a validation on adding products to cart
when user click on "Add to Cart"
it needs to validate that user must enter more than 0 product
0 quantitiy
if not display a error message
i can't figure out how to check all of the input boxes
some products have 4 input box
some products have 1 or 2
are you with me ?
can you buy the cover without the envelope?
yes
you can buy either one
so you need to check that at least one thing has been chosen
so it has to be atlease 1 on the input boxes one of them
correct
you're using the name "orderform" more than once
One last question, is it possible to use a php variable in javascript?
=$state?
yes
PHP can generate javascript hosting code, yes
php can do everything js does but js cant do everything php host does?
Im looking for the other way around
no; php has access to server resources, javascript client resources
can I create a reference/pointer to another variable in javascript? (google isn't helping me here)
and vbscript is just pointless?
no
How do i call a php variable into JS then?
the closest is a pair of an object and the name of a property of that object
what do you mean?
var state = = js($state) ?;
from which php generates var state = "AK"; or whatever
which is then sent to the browser which executes it
i think thats backwards
i have a php variable
if you wanted some other code to change foo.bar, you could pass it foo and "bar"
i need to use it from within javascript
so you have php code output the value into javascript code
just as you have it output values into HTML code
ahh ok
echo out some javascript, gotcha
out some javascript, gotcha
haha thats was weird
how come this doesnt alert anything " alert(document.orderform.amount[16345].value); "
alex^_^: because that refers to element 16345 of document.orderform.amount
yah
but i have that on the input box
alex^_^: you should use document.forms['orderform'].elements['amount[16345]'].value
i see
so now how can i check all of them
no matter how many input boxes there
0) return true; } return false; }
function isSomethingChosen() {
var inputElements = document.forms['orderform'].getElementsByTagName('input');
for (var i = 0; i inputElements.length; i++) {
var input = inputElements[i];
0)
document.orderform.submit();
}
alert('Please Enter at lease one quantity');
}
"least"
and no capital E
alex^_^, use pastebin for that
alex^_^: the idea of it returning true or false is so that you can decide what to do about it outside the function
hm
how do i say if return true then submit the form?
if (somethingIsChosen()) cheer(); else boo();
one way would be to return it from the onsubmit handler
form onsubmit="return somethingIsChosen();"
i see
please don't use the submit method, since it means people without javascript may not be able to submit the form at all
oh damn
i just used that
instead use a submit button, possibly with onsubmit on the form to validate it before sending
ok let me try the other method
there are other ways to do this though; you could have the submit button disabled by script, with a message explaining why
but even if i do that
it still have a problem with the logic i think
right now even if i enter 1 quantitiy, it stills alert the error message, but it will submit the form though
that script doesnt work on firefox
in what way?
!books
http://developer.mozilla.org/en/docs/JavaScript
ok
ty
i have ajax form and it no work!! Heelp!
make it work without ajax
:P
anyone want to help me come up with some ideas for a small website that i'm starting? mostly design ideas and navigation ideas [no ajax]
Javascript CSS HTML. This hierarchy is mathematical and patent-free.
i have the css and html figured out, just wondering if anyone has some ideas on stuff i can do =p
lol
Remember, the lesser code, the fewer bugs.
The lower the server bills.
Eheh.
lol
hi
guys, do arrays know their size in javascript?
a.length
thanks
still around?
yes
tell me, when should we use var when initializing variables?
when you want the variable to be local to the scope in which you're declaring it
which is always
so it's like a convention then
I see
for instance in function f() { var a; } a is local to f, distinct from any variable a outside it
ok
I'm trying to figure out how to override a CSS class definition that was defined in a style sheet using javascript
can anyone point me in the right direction. i can't seem to find appropriate objects/methods for modifying this
a quick example would be great basically trying to do Element.style.display = "none"; to any HTML element with a class attribute equal to "formatting"
elements, and pick out the ones with their class attribute set to "formatting"
.className
thanks
tag??
can anyone recommend some good javascript books?
hey… does anyone know if there is any way around the manipulation of elements within an outside domain from were the script ran?
or is that kinda on lockdown
kinda doesn't make sense that you can change features of a new window that you open through javascript but you can
't do anything else to the DOM
unless its on the same domain
….
how do I change the vertical scroll position of a textarea? I want to jump to the top.
never mind, I got it
foo.scrollTop=0;
hi, how can i test some function if works, i have to make test on some other browser and i need to know if browser support it
hi
i having a problem with a page
i just make a photo gallery with javascript, and when i click over the thumbnail shows me the console error
but it does not appears any error, just show the blank console
and it works well
there is any way to stop that the console shows up?
it does not shows error messages either warnings
actually nothing, just a blank console
causes a ticket to submit. But how can I get the button (or more particularly: its value)
(of course, the action could be an onclick on ticket .. but I'm not convinced I want that
)
onclick on the button rather
I have a DIV on my page that contains some content, I want to add a print button that will print only what is in this DIV, si that possible via JS?
div.innerHTML ?
document.form name.button name.value
no
`forms // first problem with that
Accessing form elements via JavaScript: Don't use document.forms[index].elementName or document.formName.elementName. Use document.forms['formName'].elements['elementName'] or document.getElementById('formID').elements['elementName'] or document.getElementById('elementID')
every button has the same 'name' .. the one that's clicked is normally the one whose value is sent when you submit. However when you capture the submit, I'm not sure there's any way to retrieve the one that was clicked
For now I'm going with an onclick on the button setting a hidden field
so basically you wanted help on a subject you were familiar on just to boast?
hmm does onClick precede the actualy form submit?
my current form has no action etc, its submitted from onClick="form.submit()"
hm
onsubmit is not called
why ?
not at all .. I was wondering if any of the other experts that lie around these parts had fought this beast before
and yes, onclick of a submit button will happen before the onsubmit
does your form have a name="submit" in it?
it doesn't
should it ?
no
I'm not certain that onsubmit() is called before a manual form.submit()
You might have to do it manually
div onclick="var frm=document.forms['some_form']; frm.onsubmit(); frm.submit()"
yes, i did this
heh
hm, one more question
formBio = document.forms['formBio'];
doesn't works but in FF it does
forms[..] is the *name* attribute, not id
ohh
so it should be form name="formBio"
thanks
yup
np
yeah guys, you are more friendly than in ##c
i've got a javascript script i want to sort some 2d array by one of it's 2nd dimension element, and it just does not work.. any ideas how to solve it? http://javascript.pastebin.com/d1c11decd
`jseval: arr = [["1", "a"], ["2", "m"], ["3", "b"], ["4", "z"]]
arr = [["1", "a"], ["2", "m"], ["3", "b"], ["4", "z"]]
{ 0: { 0: 1, 1: a}, 1: { 0: 2, 1: m}, 2: { 0: 3, 1: b}, 3: { 0: 4, 1: z}}
arr = [["1", "a"], ["2", "m"], ["3", "b"], ["4", "z"]]; arr.sort(function(a,b){return a[1]b[1]}); arr;
{ 0: { 0: 1, 1: a}, 1: { 0: 2, 1: m}, 2: { 0: 3, 1: b}, 3: { 0: 4, 1: z}}
arr = [["1", "a"], ["2", "m"], ["3", "b"], ["4", "z"]]; barr=arr.sort(function(a,b){return a[1]b[1]}); barr
{ 0: { 0: 1, 1: a}, 1: { 0: 2, 1: m}, 2: { 0: 3, 1: b}, 3: { 0: 4, 1: z}}
Hey guys.
HI all. I have 2 objects , an image and a div, on a page and I want to add a button to print ONLY those 2 object, is that possible via JS?
You could use css
hey
link rel="stylesheet" href="pathtofile.css" media="print"
none;
});
{ 0: { 0: 1, 1: a}, 1: { 0: 3, 1: b}, 2: { 0: 2, 1: m}, 3: { 0: 4, 1: z}}
watch
newPopUp.document.getElementById("inputTextFiel").value ="New Textentry"; firebug (firefox js debugger) says that element "has no properties", what is wrong here?
uh, if an XHR is set to synchronous, I can access its responseXML after the request is executed without needing to screw with "onComplete" type event handlers, right?
it means that it couldn't find your "inputTextFiel" element
methinks you forgot a "d"
yup, wow, thanks that will solve all my problems
well i ve written it in both places false , so this code should work..
ah
input type="text" id="inputTextFiel" name="inputTextFiel" size="30"
simple ab does not work because it return true only if greater and false when equal or lower
you're using firebug, no? so write console.dirxml(newPopUp.document.getElementById("inputTextFiel")); to make sure it's returning the element
i ve did as u said, but nothin gets returned..
Right, which means it's not finding the element for whatever reason.
Hmmm
try console.dir(newPopUp.document);
to make sure it's accessing the DOM
it might not be
newPopUp.document doesnt work either, but only newPopUp works ..
hmmm
try to remove the .document
I'm not experienced with pop-ups, heh
as in… try newPopUp.getElementById()
Guys, is there a way to check the last line of a textareas' value with an if statement aginst a word like 'help' or 'info' and then add stuff to the textareas' value depending on what you typed in.
are you constantly checking while typing?
yup, yeah, i got it now. by the way, how do you split a long line of code in js?
yes, onKeyDown
CRLF? :p
Bheam, doesn't work here
it does in browser javascript
you probably can't cut a string without "+" though
\
afaik
alert ('\
foo \
bar \
');
Hi, anyone familiar with AJAX
I am new to AJAX an I am triing to get something done with jquery
is it only possible to load XML Pages, or can I load an HTML page too?
in dom browser i see that newPopUp.document is "null" !!
Yes, it is possible. jQuery is really great!
if you check when you press the enter key to do something when you have typed into the textarea, will that add a newline char?
anyway
thx Romes
Will the Click event fire even when a link is "activated" using the keyboard (and not the mouse)?
Yes
helo friends, i am using my function GetSwfVer(), but i have to check if this function exists, then use it, can i do that? because if it doesnt exists, the is a javascript error, thank you
if (typeof GetSwfVer == "function") { // Function GetSwfVer exists }
Maggi thaaaaaaaaaanx
you're welcome
woah
I left a lot of people hangin :O
lol
whoopsie D:
Array notation (as opposed to dot notation) when getting the function "happyopen" would this work with IE document['happyope' + 'n']() ?
(Irritatingly, I lack a machine to try it on.)
Hello everyone
Hey MACscr.
Im having a small issue with getting a value from a form. Very odd because my other variable being sent the exact same way, is working fine
Var outputid = document.getElementById('outputid').value;
See anything wrong with that?
window["myFunction"]();
That'd be fine and dandy, in some cases. In my case the function's called "open". So document["open"]() points to that impl of "open" while window['open']() uses that built-in function.
The casing of "var".
When the js runs, im getting the error in my console that the element has no properties, but i have no idea how that coudl be the case
sry, thats my irc client doing that
Thought so. Well, you are running Firebug, right?
yep
Then "Inspect" the HTML item you want to grab.
what kind of element is outputid?
Hidden input
give it another name or prefix it
I guess that's it, IE can't handle the document[] way?
MACscr: I would try the Firebug command-line, and do document.getElementById('outputid') and then click the resulting text.
Never tried that, thanks for the tip. I definitely dont know how to harness enough of the power of firebug yet
lol @ happyopen
nope, FF doesn't like it aswell
havn't tested in other browsers
also
awww, sorting of arrays does not work as intended in Opera.. It kinda sorts arrays, yes, but not as in IE.. http://7e14hz.googlepages.com/tmplg09sw.html
there's document.open
I'd just give it another name
hi to all!
Good enough. I'm grateful for your help.
anyone can suggest a js library to draw simple lines without using SVG?
when i am in the console of firebug and then at the bottom type in: document.getElementById('outputid'), then press enter. I get a result of null
lines for a chart?
it is case-sensitive. Try inspecting your source.
hi olleolleolle, i need to draw lines over image using mouse…
http://developer.mozilla.org/en/docs/DOM:document.open
OK, are they like an annotation box?
nope..he line it's just an effect..in the background the js code will calculate the distance between those points
i had a retard moment and was searching for an ID that i didnt even have set
I had name=, but not id=
myu script already do that…but i'd like to add a line between the 2 points
Thanks for the tip
Interestingly enough, the way it's written now, it works, but that's insane. Accident waiting to happen.
if (typeof myNs == "undefined") { var myNs = {}; } myNs.open = function() { // Do stuff here }; window["myNs.open"]();
alternative ^
Hehe, I was JUST trying to name my namespace well.
if (typeof myNs == "undefined") { var myNs = { open: function() { // Do stuff here } }; } window["myNs.open"]();
better
any idea?
Is this a toy you want to run in Firefox, or does it need to run everywhere? Canvas was made for this.
better to grant more compatibility
Then Canvas is out.
I dunno, you could resort to trying to draw small colored DIVs?
I have no idea how to make that thing perform at a rate anyone would like to play with.
ok thx
use a div element, height = distance between the two points, position = point one
works only with straight lines tho
http://purevision.be/sliders/test.html
works like a charm in FF
but style isn't added in Internet Explorer
doesn't IE support setAttribute?
Onnut^WorkZ: It has some problems with setAttribute(). (Requires DOM-style capitalization) - http://www.webdevout.net/browser-support-dom#support-domcore-element
was tinking about something like that
*thinking
an alternative for IE?
ele.style.property = "value";
is there a way to remove the predefined interfaces
so that i can use the setAttribute function on every attribute
Er .. no ..
i noticed
Set the style properly rather than as a string
i'll just change the whole script
You can use setAttribute for that
oops
ssorry, no you can't
questionInput.style.width='400px';
function setStyleFromString(el, sstr){ var pairs = sstr.split(/\s*;\s*/); for(var i = 0; i pairs.length; i++){ var pair = pairs[i].split(/\s*s*/); el.style[pair[0]] = pair[1] } }
ele.setAttribute("cssText", "properties", 0); works in IE
I'd just give it an ID or class and let CSS handle the rest
^^ Good info, Good insight
karma maggi insightful
OK
or if it's the only textarea, textarea {…}
`help
http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you/
Available Plugins: oeis jeval spell cpan shorten rt topic squeeze rbeval acronym change managementspeak reverse join translate bibleit core imdb insult tv help echo eval convert jseval mangle restart quit deparse part pyeval reload_plugins goobooblink heap_test rss
lol
ignore jsBot
hehe
dinner time
same problem with setAttribute('onclick',…);
fixing with element.onclick = function() { .. } ?
YES
thought so
:p
always set the event handlers to a function NOT a string
hu?
setAttribute takes two strings
The attribute and its value
Event handlers should not be set to strings, but to functiooooooooooons
(without all the extra 'o's!)
having .cellIndex issues under Opera… getting undefined… the cellObject is not..
I put the funk in function.
So element.onclick = function(){alert('foo')} is good practice
Chuck Norris puts the laughter in slaughter
I also put the pimp in pimple.
lol
awesome
cellIndex? cellObject?
document.getElementById(column).cellIndex;
Woosta
works fine under IE and Firefox…
cell object if you must
when i do, element.onclick = function() { anotherFunction( this ); };
i lose my reference to the element when accessing the "this" parameter
how can i fix that
quick silly question, if I prepend a variable definition with "var ", does that make it local or global? or forgot which
(1) element.onclick=function(){ doSomethingWith(element) }
(2) your next question will need this:
`closures @ Onnut^WorkZ
Onnut^WorkZ: closures: http://jibbering.com/faq/faq_notes/closures.html or http://blog.morrisjohns.com/javascript_closures_for_dummies
But that's about five minutes away
`js ref var @ proycon
Onnut^WorkZ: tried: row.onclick = Function('functionName("'+paramenter+'")'); ??
js ref var: Declares a variable, optionally initializing it to a value. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Referencetatements:var)
thanks
DON'T USE STRINGS AS FUNCTIONS
eval is evil
''ERROR: 30955: Can't locate object method "is" via package "evil" (perhaps you forgot to load "evil"?) at (eval 212) line 1.
lol
exactly
Just proved your point really huh?
I guess