hi i use scriptaculous autocompleter I make it scrolling using overflowauto Onfortunally if I have a long list
objElement.offsetHeight
should work imo
imo here jquery is what you want too there exist $(document).ready(function() {}; which is executed immediatly when domtree is loaded
hey everyone
is there a channel for lightwindow ?
or should i go to scriptaculous ?
jquery will kill javascript
:P
=/
way to nick alert me
sorry
for this i would try the event DOMContentLoaded. It doesn't work
so it wouldn't work with jquery either
Byan lol
is there a way to get normal error messages from IE6 ?
what is a good way to check if a key exists within an array?
if(array[key]){ /* it exists */ } could work, not sure
^
define 'normal' ?
if(key in array) works
mrkaps - normal : not only line number and character , but with file name too
for start
there's a firebug lite script that you can include for IE which will give you some extended info
but IE is setup to be used with a realtime attatched debugger
ie. Microsoft's Script Debugger app
that doesn't work
(pretty sure its still a free download)
as
what doesnt work?
huh? idk i started typing as my friend on the phone decided to confuse me -.-
lol ok
you can also download the web development portion of visual studio express, and use that to debug with IE, which will let you step through the script in realtime, add var watches, good stuff
http://msdn.microsoft.com/vstudio/express/
(free)
andrew_, stepping throught would be nice .. but , i get error at line 1500-something , and with no filename
hi all. can i affect newly opened tab in firefox ? if i have opened that tab and i have link to it
how can you open a page in a new tab? .
i bet it would be a long way to step through whole scriptaculous/prototype/lightwindow
nice =P
ehh
window.open do this. if firefox configured to open new window in tabs
oh
var blahblshfaslfsadfas=window.open(………); ?
aha
the firebug lite script might give you filename without stepping through
ie's script error reporting was designed around a stepthrough debugger, so if youre used to firefox's error reporting, then you'll prolly consider it limited. sadly theres nothing that im aware of to extend that
moin
mo
does the canvas tag support text?
canvas tag?
Yea
is there a foreac() in javascript? I need to loop through an associative array
yeah foreach (var key in myarr) { }
for (foo in bar) {} should work to
i dont think foreach is that well supported
there's no assoc. array in javaScript
just use objects
Ripley's believe it or not
var foo = {key : 'value', key : 'value',}
hi. i use scriptaculous autocompleter. I make it scrolling using overflow:auto. Onfortunally if I have a long list that I dismiss and make another long list without reloading, the div remains on the position inside the overflow area. So how can I reset that overflow area?
what is something like var myArr = new Array(); var myArr["something"] = "some data";
hi all
it's wrong
why?
because arrays have indexes, not keys
that's why they're arrays
ok what you call what I posted?
it's a way of abusing an array because it's also an object
abusing an array?
you should just use "var myHash = {}; myHash['something'] = 'some data';"
where is that documented, google doesn't return much
it's just an object
I wouldn't call it a hash tho
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Literals#Object_Literals
true, that's kind of misleading too
indeeds
associative-array best fits the description
well, i think hash maps is a better term for js objects in general
well, i think hash maps is a better term for js objects in general
bbiab
"hash maps" denotes implementatoin. ASsociative ARray does not.
…. why did I type that using PAscal CAsing? o.O
but the implementation is pretty transparent..
anyway, it doesn't really matter much what we call it, as long as we know how it works
hello!!
anyone here uses scriptaculos?
I have created a Sortable element and I get the sequence
hello
and then I later compare the sequence to the one I saved
I have used an alert and they are equal
so say I have some db info and I need to return multiple rows in an array. var myArr = new Array(); myArr[0] = new Object(); myArr.field1 = "hello"; myArr.field2 = "some more data";
but when I do a == it gives me false
anyone know why?
is thisi right? form name=formname action=blaha name=name href=# onclick="document.forms.formname.submit()"/form
nevermind
I am comparing objects
Acs, why aren't you using " around all your fields?
your could use this.form.submit() instead…
this.form.submits returns: this.form has no properties
Hello, I am learning the Ajax stuff. Can you test my work? http://jouts.net/GuessJouts.html
bha
no
too lazy to move my mouse ver your link :p
over
hi all
try to think it might be pr0n, you won't be lazy anymore
:P
Yns, yo man
is there any good method for debugging in javascript except firebug/firefox error console?
myArr[0].field1 = 'hello';
Yns the good ol' alert() debugging
Yns, try{ /* your code*/}catch(e){alert('an error happened! ' + e)}
VistaBear, thanks man.
why does it say this.form has no properties? the form has been defined
Thanks for the "boobs", no more players? http://jouts.net
dunno, PY1NB
is that in the form action? use just "this"
this.submit is not a function
show the line
Is this valid JS? "} catch( e if e == "RanklogEntryParseError" ){ " ?`
torarne2, no
hi csaba
SimpleSample here. Remember me?
brainy^: why would someone write that? is it part of another standard or language?
hi again
torarne2, i think only mozilla supports this
where were you? show the line this.submit
ok, thanks
torarne2, part of JS 1.5
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Referencetatements:try…catch#Conditional_catch_clauses
now can I loop through my new hash somehow, or whatever you want to call it
someone kicked my power cord
a name=receber href=\"#\" onclick=\"this.form.submit()\"checar contas a receber/a
the \" are for php print it finely
PY1N1, only inputs have a form property
conditional catch seems kinda useless
like that
and use style to make it appear as a link
oh boy
oi PY1N1
oi wnix, brasileiro? maraca?
sim, de bh
esse seu comando funcionaria só se fosse num botão de submit
me diga, sua página tem um formulário só ou mais de um?
vamos falar em portugues no pvt, pse
ok, pvt-me
yo wnix what's up?
;D
how are you?
i was watching family guy, only noticed you wrote cause the taskbar flashed
hmm, esse nick nao ta registrado. vc pode dar join no #py1nb ?
hum, great
tnx
hey, that jsdraw is amazing
`js ref
`js domref
huh? jsdraw? the dLL?
Hey all, I'm trying to change the cursor on a td to a pointer and then back to default with js.
document.getElementById('UseBackgroundColor').style.cursor = default this doesn't work.
use quotes
……cursor = "default";
Ah thanks!
this http://www.danga.com/misc/jsdraw/xmlhttp.html
use firefox
Ok guys, we need to plot an evil plan to teminate IE!
lol
I like IE
but like FF more ;]
]]]+
wrong channel
contaminate
or a href="javascript:blah();"?
(or is this offtopic)
I drew something for you
neither
element
beatiful eyes
pretty much any element can have an onclick
even better would be not to put those attributes into the HTML, but to use a javascript function to add your javascript handlers
that's pretty advanced though, so don't worry about that if you aren't that experienced
http://projectx.daedeloth.be/
I don't have a debugger, but could someone tell me what file and what line I should look at?
nope, I'll go for it. thanks a lot
remember you can use the cursor:pointer CSS attribute to change the mouse cursor when it's over an element
yep of coure
for their onclicks because they don't know about that
course*
right
anyone here running windows?
daedeloth
req.xmlHttpCounter = xmlHttpRequestCounter;
line 52
k, thanks
in ajax.js
hm what should that be? var req.xmlHttpCounter ?
xmlHttpCounter isn't a property from req object
hm so I can't add new properties? I thought I could thread it like a general object?
in firefox, safari, opera yes
in ie7 I don't know
ie 6 or less no
hm, k. I don't really need it anyway, I'll remove it.
damn, those pngs look sucky in IE
req.prototype.xmlHttpCounter = xmlHttpRequestCounter;
hum
wouldn't that work?
try that vistabear says
ah, k. I'll give it a try
in IE 6 and less, use an activex
so, I don't know if it works fine
yep
oh well I'll just remove it, never mind.
are there anyone still running IE 5.X ? 0o
okay it's kindof working. any clues how I could fix those pngs?
daedeloth, you want them to be transparent?
yep
use alpha filter in css
(IE only shit)
compare IE's version to firefoxs version -
hi
daedeloth, http://www.nczonline.net/archive/2007/1/406
piXelshooter, hi there!
sup?
I'd linke to create a popup-window that does something with the last activated other browser window, exactly, with the url. So, I'd like to check the url of the last activated other window.
is that possible?
http://projectx.daedeloth.be/images.php
sorry, no, piXelshooter
oh… not good.
great system
congrats
there's the difficult option of POSTing the current URL to the popup, then PHPing it into the js
piXelshooter, like I wrote yesterday, this applies to urls also:
you cannot alter other pages other than the current one with javascript, and you cannot hide the adressbar unless you do it when opening the windows with window.open
hmm, I *think* I've seen scripts that manipulate other windows but I might be wrong
if you use window.open, you might have success
like var aWindow = window.open('url', …); aWindow.location.href = 'new location'
well, I think, that isn't actually what I think of:
I have a list of browser windows/tabs.
then I open my script page (ie, via bookmarklet)
the script shall do something with the url of the window I had open before.
til here, no problem
but now, I would it like more this way:
my window is open, and I change the url of the old window, ie per link.
now, my window should recognize that the url of the last used other window changed.
hello! why I get for document.createElement('embde') a typeof 'function
?
only in firefox
if I realize it, I wouldn't have to recall the code again and again.
add an onunload hanfdler, which reports back to the parent window?
did you mean 'embed'?
document.createElement('embed')
hm, or add an onclick handler on the links
yes
vistaBear, ok, i'll try it ;D
eer, and, is there something like onminimize (I know, it diesn't exist), that is called when the window is minimized?
if there is something, google will tell you, but i think there isn't (and i hope there isn't)
ok, but, why do you hope so?
piXelshooter - because I don't want your script to know when i minimize
that's a useragent behavior that should have nothing to do with what is going on inside the window
i don'T want any action to happen when i minimize, such as… prevent it, open a popup, play a sound, alert something, etc.
that actually enters in the "Don't mess with our browser" rule
hi
is this valid var groups = new Array();
var groups[0] = new Object();
to create an object within an array
I have a onclick event matched to a form's buttom and in the javascript function is like that http://pastebin.ca/655637
The paste 655637 has been copied to http://erxz.com/pb/4017
but the form is still sending even when fields are empty
I have got something like input type="submit" value="Save" onClick="edit();"//div
do I have to add a return?
hmmhesays, yes
and not in onclick in the input
because that does not sem to work
var groups = new Array(); groups[0] = new Object();
eval var groups = new Array(); groups[0] = new Object();
''ERROR: syntax error at (eval 212) line 2, at EOF
if I load a page into an iframe, how can I use the javascript called in that page to be used instead of the parent window's javascript?
You want to disable Javascript in the parent?
know, i just want to use to prototype.js in my iframe's env instead of the parent's
know = no
I think both will run.
I think it depends on the user agent though.
well, they seem to partly, although, I don't seem to have access to the Array methods that prototype.js offers in the iframe. I only seem to get those methods in the parent
even if I call prototype.js in the iframe
fozze, js in firefox has that natively
array.forEach
yah, but I have to get this to work in IE too
Then get it to work in IE too…
Should be a simple conditional.
hello. I am having some pretty simple issue with a script I've been working on… was hoping to find some help
this is the correct place to go to?
hey folks … how to retrieve part of some page and then to display info with js on other ?
ajax
functionName is not defined. even though it is indeed defined in the js
mefisto, any examples maybe ?
don't know if this will help you, but take a look: http://www.xul.fr
they have some pretty simple ajax examples
and what you described sounds like something simple enough that you can just copy their codes and make changes
hey..
does anyone know how I can scroll to an element?
not sure, but it might involve making an anchor
tnx atula
if I have post = document.getElementById('post1234'), how do I make that the "top" of the page?
…or the top of the viewing area
hey everyone
perhaps you can make that a div and then make it absolute positioning?
hmm. what if I alter window.location.hash?
and in stylesheet, make the necessary positioning place?
I dont have access to the stylesheet
it's a greasemonkey script
hmmmm then how can you get the id?
hello, how is the md5 function called that is buildin to javascript ?
you can set css in gm scripts too
you can do inline style too… div style="position:absolute; yadda"/div
rocketmagnet, http://www.myersdaily.org/joseph/javascript/md5.js
yeah, but i can't use position for this
wasn't there a function from javascript hosting ?
in js function 'md5' doesn't exists
can i specify utf8 encoding for js file?
i kinda have it in php hosting and have header application/x-javascript
?
so i can just add this .js file and use md5('somevalue') ?
yea)
dabear, window.scrollTo(0, post.offsetTop));
kronos, if web page is in utf8, its gonna kinda expect js in utf8 as well right?
grimboy, nice
I'll try that
i want restrict user input same maskedit in windows application any one can help me.
rimad, i think yes, but you can test it)
hi
hey enzo
imagine i have input id="foo", i have var foo_object = getElementById("foo"), with var foo_object, how can i get it's id name back ? (foo)
this placing dynamically created tables really sucks
they aren't going where I think they should
enum, foo_object.id
enzo, foo_object.id
should I be using span instead of div if I don't want paragraph breaks?
ok grimboy
is inline.
anyone here use Ajaxpro
the .NET library
inline
i'd like to know if i can tack properties onto the result object
the server side return value
what is an appropriate way to stop or at least handle dhtml applications when the refresh / back / forward buttons are used?
any example how to retrieve text content from td element and to make that text to be clickable ?
' + td.innerHTML +'/a'
dabear, it's for gm script … and i have like 20 td's on that page … but there's only one with "health" text in it
??
i have page that have 20 td on it … and i need only one … how to retrieve it's text ?
document.getElementById('table').cells[0].innerHTML
oh … nice … tnx
Hi, Can someone help me please? http://rafb.net/p/ESoXgF14.html This is working on FF, But not in IE, Does someone know what is wrong? (It must count how many emails are 'sent') (Sorry for my bad english btw)
what a horrible code O.o
Why you have in method in class echo function
blech
hmm..
create method is … heh
First. Don't use echo funciton in methods, you should return string and then write it in code.
i have var tab = [], i want to add an element in tab[2], how can i do that ? tab[2] is another array
maybe tab[2][] = 'foo' ?
enzo, that doesn't work in js
if tab[2] is an array, you can use tab[2].push('foo')
ok
anyone have any experience generating dynamic tables? I'm having some trouble appending them to my DIV tags and making them go where I want them to
layout wise
hmmhesays, avoid innerHTML…
avoid it where?
I'm only using inner html on cells, when the tables are generated they look just like I want to them
element too, otherwise the table wont get displayed in ie6
avoid using innerHTML when writing tables
like I said the tables look just like I want them to
however, for the life of me I cannot get them to sit side by side
when I generate the second table based on what the first table was clicked, it is always underneath
how do i detect for onsubmit in my header javascript?
is there a way to safely include external javascript file via javascript code?
!seen buubot
seen buubot
Sorry, I haven't seen buubot
seen Byan
way to nick alert me
thats what I can't figure out
I tried appending my tables to a div tag and span, same result
_
beer Byan
what is your opinion on SVG vs js+ dom ?
there is no vs for svg, dom and js
at least i cant see one
http://www.kevlindev.com/tutorials/basics/index.htm
"AhmedShaikhM" at 71.6.194.243 pasted "javascript code" (1 line) at http://erxz.com/pb/4018
so do you have any idea how I generate two seperate tables and make them sit side by side?
depends where the data is coming from that you want to display
and if it needs to be fast
generating svg with js+dom is quite easy but horrible slow
so, what do you want to do?
yep, probably svg is more sutable for real-time graphing
suitable
gfldex just exploring technology
i create stuff with inkscape and add some js for dynamic stuff to it
trying to identify svg's place
hard to tell atm
it's not really well supported and if you leave the warm and fuzzy mozilla realm you will be surprised quite often with svg
you can do quite a lot fancy stuff
like interaction between svg and the surrounding page
i think comparison should be done in js+svg vs flash
http://www.carto.net/papers/svg/comparison_flash_svg/
that exactly what you cant do anymore with flash
you can't access javascript objects of the html part from a flash on a page
Meh, svg. Canvas
even if they come from the same domain
but svg is a lot slower as flash
is there a way to safely include external javascript file via javascript code?
"javascript code" (1 line) at http://erxz.com/pb/4018
AhmedShaikhM eval ?
if you are used to xml and use xslt, css and such quite heavy and can convince your users to use mozilla or opera it's quite nice
and can save you a lot work
AhmedShaikhM, document.write("script")
AhmedShaikhM, Is the only portable way.
it hangs IE7
I suppose I could user css to place my div tags
is part of HTML
Oh?
Yeah, I saw. I just not sure what you're doing wrong.
you might be better off having a javascript build files cause otherwise you'll end up with a lot of superfluous requests.
i want to make a child window cause a submit on the parent window… how would i do this?
javascript build files?
You know. A small script to concatenate your scripts, minify them, pre-gzip them and give them a timestamp so you can get your webserver to sent some ridiculously long expires header.
"AhmedShaikhM" at 71.6.194.243 pasted "hey grimboy have a look at the code" (31 lines) at http://erxz.com/pb/4019
have a look at the new past
What I am trying to achieve is that, I want to add XHTML parts on link click so that TinyMCE editor get activate on some javascript based event
i can change the value of a form on a parent from the child window, but how can i make the parent submit too?
window.opener.document.main.displayPref.value="newSkool"; ….what other code can i put after that to make the parent submit
"SamuraiDio" at 71.6.194.243 pasted "How do i make this (the loop and the endsWith() ) without prototype?" (25 lines) at http://erxz.com/pb/4021
is window.opener.document.main.submit(); valid?
if main in the opener is a form, yes
i got the child to 1) change parent values of some fields in the parent form 2) force the parent to submit .. problem is the submit didn't "include" the modified values
which is strange, becaues you can visually see the change, for instance, in a drop down, you can see hte parent's value of hte drop down change, but the child making the parent submit, doesnt seem to keep this change
rook2pawn, What if you put a timeout on the submit?
what for, im not closing the popup. the child is used to make display adjustments on the parent
can anyone destermine the purpose of hte ? and the :…is that a ternary operator used in a regular expression? /(\d+)(?\.\d+)|)/
non-capturing-group construct.
the first (\d+) captures a series of digits, the second one doesn't capture but places into a group.
it's kindof superflous in that example
the reason why you would want a noncaptured group is so you can express more complicated matching patterns, such 5555.88888 or 5555.foo but not 5555
you could as easily write /(\d+)(\.\d+)|/
how do i convert a JSON string such as {"name":"test","image":"test.jpg"} to an object with the corresponding properties and values?
You use eval.
thanks
eval('var obj='+json_string); alert(obj)
Hi all!
Is there anyway I can tweak the CSS (visibility in my case) before the page is rendered using JS? When using onload() I get a moment of flickering when the black text is displayed.
thanks fatbrain, it worked… but doesn't eval() have problems in internet explorer?
rindolf, You can attach an onload to the element itself which might fire slightly quicker.
but I have many elements.
can you edit the css directly and control the classes assigned to the elements?
i have a popup change some values in the parent form, and i can visually see that the values are changed, but when i have the child make the opener parent submit, the changes are lost
yes, I can.
but I'd rather the page not be all with visibility : hidden if JS is disabled.
Why not do that then?
Oh
is there any other ways to load an XML document other than xmlDoc.load ?
rindolf, You could shove stuff inside noscripts
no.
you could look at YUI's onContentReady event and see how Yahoo is handling it.. it should be in the event library at http://developer.yahoo.com/yui/event
they have a few different events you could look at.. onContentReady, onDOMReady
how will this help me?
onDOM waits for all child nodes, onContent waits for the node to exist at all
rindolf, Stuff inside noscripts only display on browsers with no javascript/javascript turned off.
oh.
rindolf, hello
Hi pkrumins
what brings you to ##javascript ?
Well, nevermind, I'll use CSS.
interesting
rindolf, this:
http://www.catonmat.net/blog/learning-javascript-programming-language-through-video-lectures/
a href="http://www.catonmat.net/blog/learning-javascript-programming-language-through-video-lectures/"http://www.catonmat.net/blog/learning-javascript-programming-language-through-video-lectures//a
i need opbject oriented stuff anyway
I see.
my popup can change my parent's form values, but when i submit on the popup, the parent submits, but not with the data
fatbrain, ok i understand the noncapturing now, but what is this now. (?=pattern)
hi
section31, A zero-width positive look-ahead assertion.
for example "foo(?=bar)" would only match foo if it is followed by bar without including bar in the match
gotcha
thank you
You're welcome!
it is possible to work with prototype and mootools simultaneously, both?
only if they both have a function named "$"
/troll
karma vinse funny
how come you need both? seems like they have a lot of overlapping features … and i thought mootool's advantage was its small size, which you'd be negating if you're also including Prototype
vinse, mootools provide a effects..
its a question
all - how do i pull the text in an HTMLLiElement?
i want use it
but already use prototype
is the tofixed method supported by most browsers? where can i find the compatability of certain methods between diff browsers?
:w
hi all
plz
http://pastebin.ca/655920
The paste 655920 has been copied to http://erxz.com/pb/4022
he working on Firefox but not on IE
ie have some problem with getElementsByName function?
getElementsByName is a bad function. Don't use it.
I'm searching in the innerHTML of an element for any strings that could be links. I'm going to replace those strings with actual live links, so "Oh my god becky look at www.foo.com" would turn to "Oh my god becky look at a href=\"http://www.foo.com\"http://www.foo.com/a".
The reason I'm only using Javascript is because I cannot make any modifications to this "system" or "site", and this is actually my own Grease Monkey script.
and what I use to get all elements with same name ?
Here is the corresponding code, lmk if you have any questions..
http://rafb.net/p/wD0AZx45.html
Aankhen“: what is method to it, I need to count all elements with name 'marca_nome' that have text
Iterate through all the elements in the document, test their `name` attribute.
hello. how do I get an element in xml… the equivalent of .getAttribute("attr")?
ich mach jetzt feierabend. noch einen stressfreie nacht euch süßen ;P
yummy_sammich, here's some stylish code for you:
http://norskwebforum.no/pastebin/9263
one sec…
phone
brb
impressive
–n00b
thank you a lot
is there a way to use an object as an array key? http://pastie.caboo.se/87300
GMFlash, did you try it?
of course
and it didn't work?
i tried with both array and object
then you would need to assign them as values instead
like itemsByObject.push(items[i])
i need to get a link between the object reference and the array index though
so that wouldn't work
GMFlash, no, you wouldn't
itemsByObject[el] and have it return a number
because; var itemsByObject = []; itemsByObject.push(items[i]); itemsByobject[0] would be the object
so what about using the id of el instead?
they don't have ids
well, keys cannot be of type object, can they?
i thought they could be
i swear i've seen it before
so you have to make your self a function or something
ah, now I see
when you do bla[foo] = bla, you are converting your array to a hash
and a hash doesn't have a .length property
an actual type conversion takes place? so that subsequent calls to bla.length fail?
try this:
javascript:var t= new Object(); var arr = [];arr[t]='foo';alert(arr.length)
and then
javascript:var t= new Object(); var arr = [];arr[0]='foo';alert(arr.length)
i changed the array to a hash, it is partially working now
the only problem is that the value of each item in the hash is the last value of i
i'm guessing because they're all referencing the same instance of i ?
Is passing an FS Command through VB and then to JS not compatible with IE or FF?
http://pastebin.ca/655974
The paste 655974 has been copied to http://erxz.com/pb/4023
^Link to my document
gmflash the object you saw probably had a toString method, thas wjy it coul be used as an object key
you realize VBScript isn't supported in any other browser than IE, Kai_wp2 ?
Well its working in Opera.
A page with VBScript is working in Opera?
o.0
I can ensure you the vb-part is not executed in opera
ensure? heh. you mean assure?
ahh that appears to be the case
why do you explicitly specify that the args should be passed ByVal?
looks like i'll just have to give an id to each item
they are by default passed ByVal
Well the Flash passes a command to the VBScript which runs some JS and its working fine..
It doesn't work if I remove the VBScripts.
when used as keys, objects are converted to strings
Well I didn't write the VBscript so I left it.
so basically the only way to fix my problem is to set an id?
I couldn't find a way to pass vars from flash to JS so I used this.
deltab, hmm, empty strings in this case, are empty strings valid keys?
I geuss I could've used geturl();
length only counts the numbered properties of an array
they are
anyone has experience with google map api?
right, nice info, deltab
function definition inside a loop?
nah i just want to make a quick lookup/reverse lookup of an array
if i have 10 LI's in an array… index of 0-9 i want to be able to later on do something like: reverseIndex[el.id] and get a number 0-9
i thought i could just use the object reference as a key but apparently not
the object probably convert to the same string
so i'll just set an id
right it is, just found that out in a test
what do you want it for?
i'm emulating a multi-line select widget
with an ordered list, so i need to keep track of things via an index
why not use a real one?
it doesn't offer the flexibility i need
along with document.createTextNode, can you delete a text node?
note that you can add properties to the elements
or…should i just hide it?
Node:removeChild
yay
thank you
Whats the best way to pass a var to JS?
From Flash?
with mind powa
(or serverside language)
LOL A serverside language
Theres ExternalInterface.call("Function"); but it won't pass an arg
ever heard about ajax =P
ajax? what's that? sounds new and trendy
uhh
I don't like it but . Its really kewl
no don't use it, it will eat your soul
ajax is some kinda cleaner, people!
I thought it's a football club from the netherlands
use it to clean your windows or something
I thought its a kind of plane.
I use it to get to the city.
AJAX:
http://www.cleansweepsupply.com/pictures/standard/bcpm2166.jpg
JS running on the server or the lient?
I use Ariel
so that's ajax!
csaba, now its called Air =]
I won't accept this!
i dont even know why people call it ajax since it is also synchronous and can be used to pass more than just xml such as json and text
I don't really know a lot of people that call it ajax
only part that is needed in ajax is J
I use 'ajax' to mean partial replacement of a page using data requested from a server
no
wrong
you can do it with flash too
they should just call it XHR or XMLHttpRequest since that is the function name
I usually call it xmlhttp
GMFlash, i tried
that's what it's original name was
Looking for ideas on how to build a "drop zone" for files dragged from Windows explorer. I know it would be IE specific, and that there would be security concerns, but….
it's not just XML
boss looked kinda strang on me
yeah i know even XMLHttpRequest isn't the correct term
you can push it directly
'ajax' is easier to pronounce
really it is just a "HTTP Request"
… used in a particular way, yes
ajax is just a word your manager uses to impress clients
and and easier to 'understand' in Marketing Section
what does json mean?
javascript object notation
ah yeah
good thing this AJAX stuff will be a thing of the past when web 3.0 is here
not really
i was just making fun of buzzwords
it was created before whole web2.0-fuss
i know for outlook web access
for that too
the same about blogs .. ppl were writing web journals at mid-90s too
everyone make sure to thank microsoft for XMLHttpRequest()
GMFlash, its hard , because it was only side effect for ActiveX
you could do ajax with images and cookies
or iframes
i'm really glad those days are gone
you can upload files too (which actually is one of coolest features )
tell me more
how?
=]
how do you go to the next iteration in a for loop ? in Perl its next()
continue;
I need a simple script that will make a label like "Searching.." appear when a form submit button is pressed
can i just do
onClick class=appear or something
i've used a class for hiding labels before so i know how to do it
i'll try it..
Saberu, why not change the text of the submit-button?
_$('submit_box_id').value = "Searching..";
assuming you are using prototype, or just have that useful function in there
function _$(x) { return document.getElementById(x); }
ah thanks didn't think of that
is there a simple way to do that?
document.getElementById('submit').value = 'Searching..'
like that?
assuming the id of my submit button was that
yes
now from usability point of view that is crazy to change search button's title to searching, what if i hit escape before the new content is returned
i would still be on the same page with that stupid searching.. button which has no longer anything to do with searching because none is going on
then I would reset the buttons value?
setTimeout
now that's better
besides, can you really reset an ajax-call using backspace?
but, how would you know the timeout to setTimeout
what if db was clogged up and search took more than usual
set a header with no-cache value, problem solved
dabear, with backspace?
how do i get the date 7 days ago?
from JS? I wouldn't…
talk to ##php
no
i need to do it client side
client side depends on the user's computer - it could be the wrong date
not using the current date
so you're just talking about some math? :p
pretty much
how do i get the date that is 7 days before a date?
but you don't want to make a matrix of how many days are in each month? :p
i dont see functions to do it in prototype or YUI
php, by writing an algorithm which subtracts 7 days from this date, duh.
blah
Question, I'm trying to refresh google ads w/o having to refresh the page. What I tried was just replacing the div with google's JS snippet with a new snippet..but apparently the JS isn't getting evaluated. Is there a way to do this?
IE6 is throwing me "object doesn't support this property or method" at a line in my code, which is "instructions.innerHTML = errorMessage;". Does anyone have a clue why this might be?
phpwner, var d = new Date();d.setTime(d.getTime()- (86400*7*1000));alert(d)
eval var d = new Date();d.setTime(d.getTime()- (86400*7*1000));write(d);
''ERROR: syntax error at (eval 212) line 2, at EOF
bha
works in the browser atleast
emm .. goal its to make it work in browsers
not just in one
yall can suck my toe
lol newb :p
@ phpwner hehe
mefisto, works, but not with buubot :p
maybe because of write(d);
eval write('foo')
''ERROR: syntax error at (eval 212) line 2, at EOF
^^
print ('foo');
foo1
eval document.write('foo')
''ERROR: syntax error at (eval 212) line 2, at EOF
new Date ();
{ }
ah well
eval document.write('foo');
''ERROR: syntax error at (eval 212) line 2, at EOF
hm, okay, probably was the bot in #prototype which used write..
hh
How to check checkbox status for checked/unchecked?
thebox.checked will be true or false depending on if it's checked or not
thank you!
how can i get this js to clear the html form after posting a comment, people keep clicking submit and posting more then once, here is my code snippet. http://pastebin.ca/656100
The paste 656100 has been copied to http://erxz.com/pb/4024
Why not disable the submit btn when pressed
onClick="this.disable();…"
ah, i could do that, would it be much harder to clear that form?
No, but usability wise it wouldn't be so nice.
It's nice to know that the information you just entered is still being submitted, and that you actually pressed the "SUBMIT" button, and not the RESET button.
know what I mean?
i guess, all of the ajax powered comments i've come accross clear the form
I always disable the submit button, and change it's inner text to something useful, like "Submitting"
ah, how can I clear the form? I will try both and see how i like them.
form.reset(), but that'll clear the values before the form is submitted, so it would be a very bizzare solution.
ah, how can i clear the values after it's submitted?
you can't
Yeah. Why are you so set on clearing the values?
because then the location would have changed
e.g you won't be on the same page
If you're waiting on an AJAX response, then clear the form with either .reset() or by clearing the values of each of the form's elements/inputs manually.
or the page is reloaded if you provide the same page in action=""
i basically want to clear the form after it's been submitted, this will stop users from clicking submit again and posting the same message. I have some pretty stupid users that will post 3-4x just because it's fun.
No. Disabling the submit button will stop users from submitting again.
clearing the form will simply…clear the form. not much else.
why not just make an array of the fields, and then for each field set the value to nothing?
hi folks
Hello chr0me.
how can i call a javascript function from php?
how do you mean?
there is an onclick event and i want to execute that js function on array elements
by putting it in output'ed html
without clicking on them
tags
make it in window.onload = funxtion(){}
onload event is usually what you want though
ok
!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"htmlheadtitle/title/headbody/body/html
oops, sorry
pkrumins, katru reizi kad tu nelieto strict, dievs nogalina ka7nu
=P
cik saveejo
oho
vells
3 gabali
pilniigi nereaali. pirmo reizi pa vairaakiem gadiem kaadu veel te satieku no .lv
tas ir freenodee, ne #js'aa
arii linuxisti biezhi gadaas attieciigajos kanaalos
Fj neviena cita te nav
aa, es par to neintereseejos, intereseejos tikai par programmeshanu, neesmu linux kanaalos, taapeec ari neesmu laikam ne1 saticis.
veel kaadi pieci toch ir satikti
nez , katr kur ir vismaz 100 cilvji, ir vismaz viens letiFa
sk.
mhm. mani veel peec latviskaa vhosta atpaziist, taapeec biezhaak samos sastopu
s/vhosta/hosta
jap
/who *.lv
ko darat, arii studenti esat?
7ipa , mainu augskolu
pdjs
no rtu uz lu?
aha
lu++
nez vai shii ir iistaa vietai lai to apspriestu
es ar stundents
lu?
Question, I'm trying to refresh google ads w/o having to refresh the page. What I tried was just replacing the div with google's JS snippet with a new snippet..but apparently the JS isn't getting evaluated. Is there a way to do this?
izbanos
onclick="this.disable = true"
bet no saakuma pabridinaas, tapec var.
that does not work for the submit button
mcknin, that's forbidden dude.
explain..
by google?
yeap
hmm interesting
sucks for those of us using nearly pure ajax…
you're inflating page views
well I understand the reasoning
but realistically, it's flawed
mcknin, that sounds like it's against the tos
if I have a site that navigates through a lot of different content, I should be able to change the ads
I am sure they have ways of telling that….
the fact that you are ramping up page views sucks too for google
yeap.
like I said, I understand the reasoning
but there must be some sort of middle ground
oh well, can't do much about it
I am sure they will be able to tell, or else everyone could do hundreds of thousands of hits for lawlhacks.google.com.mcknin.com
What would be the best method to resize the image to half of its original width and height by default and when you mouse over, restore its normal width and height?
is there any way to switch table cells (when first cell is going to be second and second cell replaces first) or only way is to switch their content?
can i put the onload even outside of input?
t
chr0me, yes
Slynderdale, you can set width/2 by default and width:auto on onmouseover
there's a way, but I couldn't tell you how
Isn't width:auto css?
Slynderdale, yes
but you can set CSS properties via JS
no, you cannot
obj.style.width="auto";
(starting flameware against self)
the problem is the width will be relative to its container's width
And for the shrinking it by half part, is that done via css as well or javascript?
not the img's innate dimensions
cssplay.co.uk has a lot of gallery playage
is there any way to just clear the form after it's been submitted like youtube does?
none of the onclick="" work
Slynderdale, you can calculate needed width and set it via JS.
input type="reset" ?
oh after it's been submitted :p
reisio++
yep
getelementsbytagname && value='' ?
hello, do you know a german js irc-channel? or is this the right place too
anyone?
undoubtedly some speakers of deutsch here
how can i get all elements that start with 'amount_'?
amount_ = start of name
Hmm, how do you add an atribute to a ag with javascript so you can do something like obj.newatrri = 'blah';
Hmm, how do you add an atribute to a tag with javascript so you can do something like obj.newatrri = 'blah';
you can add properties that way
is it possible to manipulate a (PNG) image using javascript?
one for "hair style" and one for the base. I want to edit the rgb values of the PNG with the hair style
hai, what is the style attribute that cuts off anything bigger than the object's size?
nvm , it's overflow
Is it possible to set onclick=".." with JS? Something like obj.onclick="newaction()"
yes.
(shal3r)
and how?
just like you did now :p
you actually just said it.
heh.
that`s not working
obj has to point to a node though
dabear, obj is document.getElementById('myid')
document.getElementById('yourelementid').onclick = "…"
That should work, unless the element isn't found.
BradleyB, nothing changes and no errors
Hmm, whats wrong with this? http://erxz.com/pb/4025
IE or FF, shal3r?
FF
Are you getting errors? And why not use setAttriubte, rather than createAttribute?
What kind of element is it?
A
Oh, and I believe the attribute names must be in a string format
I'm trying to sort an array of objects by one of the values it has… how do I do this?
getAttribute('oldwidth')
legind, you can use bubble method
any easier method?
it`s easy
Thanks and also whats the parameters for setattribute?
Slynderdale, mostly any html attribute
You know, these are all googleable things.
just look for setAttribute
it's setAttribute('attributename', attrval)
is it possible to get table cell`s position in table? Like row 0, col 1 or cellNr 32
setAttribute site:mozilla.org
tables have a rows collection, each row has a cells collection. A cell has a cellIndex property I believe
I know rows have a rowIndex.. just guessing on cells
thanks, i will look
hi all
obj.onclick = newaction;
i have a question about iframe. how can i execute an function on parent document in iframe
why are you using all those methods instead of just accessing properties?
acualy i want to send some messages with Json in iframe to parent document for file uploading…
or how can i handle form request (form is contain input file element)
I managed to figure it out already.
how have you chosen to do it?
i found, parent.functionName();
is there a bug with IE when loading an xml file?
xmldoc.documentElement returns null and xmldoc.responseXML/responseText say undefined
i get a readyState of 4 when i check it
i just can't get anything from it
how do you check if it's loading correctly? because xmldoc.hasChildNodes returns false
so i don't think it's loading anything :-S
and changing the loaded file name to one that doesn't exist doesn't give an error or anything
how do I get elements within a div? I want to get all the input elements within a div and disable them
div.childNodes
Hi !
who can i declare a static vars that belongs to a function in JS
no-can-do, helloRobot , atleast not until js 2
you can define a variable in the global scope though, which you can access in your function
doesn't firefox append the elements of a div to the dom, if its loaded via innerhtml?
how can i define a global var in javascript?
hey everyone
[domon], Variables are global by default.
Use var in the scope you want them for local variables.
okay, great!
so if i pass a var to one function, i can use it in another?
Still, you're always best off using a var in top-level code.
Or so I am told.
well my problem is tis
i have one function that displays a page
and i need to pass the variable that i passed to display to another function
thus i need a "global" var
here i'll give an example…
Err… you don't need a global variable if you're passing things in as arguemnts.
arguments
i have 3 functions…
someone will use function a
pass a variable to it
then they use function b (to login)
then i have to update the page after they login (function c) using variables passed to function a
define the variable with var varname=""; outside of the functions
In top level code as I said earlier.
got it
No need for the ="" though.
sorry, i'm more fluent in PHP than JS
and then to update the global var based on an argument….
global varname = arg; ?
or just varname = arg?
can IE not load an XML file when the file has a doctype?
just varname .. but make sure, you dont have used the same varname in the function or the function-header
yeah, i wont do that
-used+declared
last thing is….how can i determine if a var is defined…like php you can put function blah (arg1 = "default1", arg2 = "default2")
anyone?
[domon], if (arg2 === undefined) { arg2 = default}
You need 3 equals signs for a strongly typed comparison. Otherwise if arg2 is 0 it'll get rebound to default.
thx!
hey
anyone know how to get the correct height of IE's body content?
I can get the size of the window but not the content
anyone know?
document.body.clientHeight
iirc
mefisto won't work
gives me the size of the window
not the whole body
uno moment
oki
I am just trying to correct this bug in thickbox.js
it should be working
second is
it used 100% to create a div or something, but it only gets to the size of the window
document.body.scrollHeight
so if I scroll down it won't work
oohh, let's try that
gives the same thing
so it won't work
broser ?
*w
IE 6
oh
what?
are you using 7?
im using opera
lol
well I normally use FF
but I have to do this page and it has to working on both
screw opera
document.body.clientHeight is woring in IE6
mkey , im gonr
*gone
mefisto I know it works
the problem is it's not giving the correct size
how do i trigger a form reset?
OH
reset()
hello,everyone
'lo pp
lo
: )
hehe
hey
I am a chinese,Exhibitions
no body?
hrmm?
??
what's the mean
it means 'what does that mean?'
no means
why did not speak
?
/join #linguistics
ok
my guess is machine translation
yes
which one?
his english is poor
because my english is very poor
i think u are robot.
a chinese boy
i run http://ajaxtrans.com
it does Chinese/English translation (rather poorly, but somewhat workable)
i think http://stardict.org is good
me too
hello.. anybody know where I can found a script for a countdown?
hello
input id="print" TYPE="button" VALUE="Print" onClick="window.print();"
is there a way to just print a single DIV?
http://pastebin.com/m716febea
i'm trying to print a single DIV
could someone let me know what i'm screwing up?
i got this code from a site online
replace "innerhtml" with "innerHTML"
embedded css style tag. How can i use javascript to change the font?
Is there a reason you are embedding the style rather than specifying an id?
that worked, but I lost all of my CSS formatting?
css? where?
yes, because we have a library of css that we normally import, this way i handle one-time special cases
well, i'm using a CSS file to do all my formatting
its not in the part that i sent to pastebin
Vme, it's on the 9th line at code you pasted to pastebin
and 14th
Under what condition will you be changing the style?
Directed to rook.
yea
that part worked
you should insert the reference to the css file in the html of the opened window
or browser don't know if the new window use css
would any of you seriously like to post "5 things you'd like to see in Opera"? if yes, i'm just gonna link to your blog if you are interested
OT (kinda)… Need a simpler (than the HTML select box) multi-select interface for a box that has some 600 items. Was thinking autocomplete but need the multi-select bit.
Anyone see anything that might work with that?
hey
i need A dynamically expanding form element
and generate id=".." in them
Well, rook, the answer is you don't need a lot. YOu can user the onmouseover and onmouseout events to manipulate the style elements of the tag. You can either create a generic function to handle each one-off instance, or you can simply use the same DOM modification over and over.
for instance.
cheers
it will be sent in the post aswell ?
Ah
input type= submit onclick="window.opener.document.font=Font('Arial', 12)
but i imagine thats tied into the dom which i dont know anything about?
try style.fontFamily
Ah i noticed font is not actually a translated word from css, is this correct?
whereas there is a pattern of taking a css word like foo-bar into javascript-ease fooBar ?
it's better to change the element's classes, so hat you don't have to put some of the CSS in JS
can a child change the parent's definitions of the classes
im not sure i understand you
sorry let me s/child/popup
classes don't have (machine readable) definitions
say you have a class called 'hover'
the onmouseover handler can put the element into the hover class, and onmouseout can take it out
then you apply a style rule that matches that class
is none of this trivial? i mean, do i have to learn teh DOM model and actual javascript
is this the kind of thing you are talking about http://onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.html
yes, though I wouldn't use that function
better to have one function for each operation
so this is far from an short hack?
span onmouseover="addClass(this, 'hover')" onmouseout="removeClass(this, 'hover')"
lets say i'm in a public function how do i assign something to a instance variable of the object… do i just define the variable as in var whatever; at the top of the class and then call whatever = 22 or do you self or this?
what language are you referring to?
javascript
i've created a singleton object
what do you mean by "class"?
i.e. var bla = function() { return { init: function() { } }()
there not called classes?
they are*
no
well, whatever it is i'm just trying to work out how to get scope from say the init function to another internal function
if they're called through an object using the x.y(z) syntax, x is available through 'this'
awesome thankyou
http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript
with grey text that disappears when you click on it?
hello… I'm trying to debug an app that isn't working. I'm not good at javascript at all but just need some help with something. Basically, there is an "Element" object that is supposed to load but isn't because window.Element exists. What is window.Element ?
same thing
you talking to me?
yes
window is the global object
ah.. ok
and what is Element then?
something defined by a library you're using, most likely
ok then. I just have one other question:
is there a way I can dump all the object's varialbes and functions?
actually nevermind
use firebug's console.log and click on the object
ah! Ok cheers thanks
i have a from page that I insert into my site in an iframe (dont ask why, long story). after the form is submitted, it should redirect back to a page on my site (not in the iframe). it does, but inside the iframe, but I need it to be in the parent viewport
parent.location = newurl;
But ouch, frames
iframe
not frames
Same concept, same issues, just differently positioned
auto, etc. iframe is useful when you have no alternative
inside your iframe you must access parent
There's always an alternative to iframes — complete site design at its worst.
s/its/the/
Sorry, 0711
with unlimited budgets thres always alternatives.
— then it's undefined. Is there a way I can make that function have access to my element.Window?
ChrisC35, hmm? Site redesigns are free (presuming you're doing the work yourself)
misc–: You mean window.Element, not element.Window?
misc–: It should already have access
misc–: Perhaps it's defined onload, and Lightbox.prototype.initialize() is called earlier?
time = money = budget
no… before that declaration, it exists. Then all of a sudden it doesn't exist
anyways, how would I actiave that javascript in my php code?
when I want to redirect
But alternatively, frames = accessibility problems = lost profits (ha, ha)
maybe. It's something that should work though. It's off a Joomla component (well, mambot) and it works on the demo site but now when I install it on my site. I think it's a bit over my head
You can't, you'd have to write it out to a page.
ic
ok so I can just put that in the onload event of the page I'm directing to?
uok so I can just put that in the onload event of the page I'm directing to?/u
onload is later than it needs to be
what you said sounds about right though. initialize() may be getting called ealier. I'll check
element in the head
cool
no. It gets defined before the initilize() runs
just that? or do I need some onload event?
i'm not great at js..
No, you don't need any onload events.
scriptparent.location = http://styleinform.com/join-success;/script
i put that in the head
Twey ?
maybe url in quotes
it just loads itself now repeatedly
parent.location = "http://styleinform.com/join-success"; /script
Where, I should add, the join-success page *is not* the page with the iframe.
ya hehe i figured that out
made the interim page and it works
thanks
Welcome
hey.. i got simple array question: http://pastebin.com/m328e07ab
Im having trouble seeing the POSTS and GETs performed in my firebug, has anyone seen this bug
Anyone know of a Firefox Add-on that allows me to modify the navigator.plugins collection? (To circumvent lame-incorrect plugin-detection-scripts)
I shall write one forthwith.
I'm bored.
hi, i have… some table like tabletdtrblah/tr/td/table, how to access that 'blah' through window.document method?
good
bianchi, easiest is to just give the tr an id
Or even the td
and use the getElementById-method
Then use .firstChild.nodeValue.
you'd want to switch the tr and the td too though
what is the maximum length of an email address?
Oh - yes.
ok, work now!
255 I think the RFC states
I've just found this
The maximum total length of a user name is 64 characters
The maximum total length of a domain name or number is 64 characters.
So that would be 64+64+@ ?
= 129
ok great
And what's this?
The maximum total length of a reverse-path or forward-path is 256 characters
Oh yeah, the Fw:
i am trying to combine variables in a certain way….
var title=(document.getElementById("ned").which+title.value);
which containts "left_block_"
i am trying to make up a variable "left_block_title"
any help would be appreciated
i mean i am trying to pick up values from "left_block_title"
And now this is confusing:
the total number of octets that represent a domain name (i.e., the sum of all label octets and label lengths) is limited to 255.
So basically a domain name CAN be 255 octets, but a domain name in an email can be only 64
So if you have a domain that's longer than 64 then it won't work with emails?
so i guess i need the syntax for that
i tried "which"+title
no joy
any idea why xmlDoc = document.implementation.createDocument("", "", null); would not work in ie?
hey, i have textfield, now when i press enter on textfield it should do something, how to do it?
use keypress event
praveen can you do little example?
onkeypress=
now report should check if keycode was enter?
thanks, can i report what key was pressed?
onkeypress="change_message_label(this)
whats the equivalent for onload for i.e. 6?
xmlDoc.onload
yes you can ..
is script.aculo.us still a framework to rely on and use if I have to start out from scratch with a project
?
How to get all the hidden values in form ?
Im trying something pretty basic. I have a popup window which i want to close after 5 seconds and refresh the parent window
http://pastebin.ca/656693
The paste 656693 has been copied to http://erxz.com/pb/4030
Codes not working, any tips?
Fx extensions are weeeird.
why i can't see… elements in frame
i'v got var a = window.frames[0].document;
and thtat return HTML document
bud… a.getElementById("pop");
return null, even if I had element "pop" in that .html that is source of my frame
Fx keeps insisting it can't install this basic test extension I build by some tutorial because "install-???..rdf" doesn't exist, where ??? is three seemingly random letters and numbers which change every time I try to install it :-\
what's problem?
You can't access documents on other domains. It's a security feature.
is script.aculo.us still a framework to rely on and use if I have to start out from scratch with a project
script.aculo.us isn't a framework, it's an effects library
evrything is on local disk… source of frame is src="../html/test.html"
It uses the Prototype framework
Personally, I don't like it.
why so?
Prototype imposes a very specific method of coding on you and doesn't let you code any other way
i have lost connection, Twey have you said something?
It also tends to break other code due to the methods it adds to various prototypes
And it values brevity over readability, which is a bad thing IMO.
Is top.window.refresh() valid?
top.location.reload()
Ah, thanks
top.window is pointless, since it refers to itself… you could go on forever, top.window.window.window.window.window.window…
Most other frameworks do the same things, just pick one and go with it. IMO prototype is one of the more readable once out there
i have an overflowing div and inside that div i am doing some drag'n'drop action (not using any library). how can i detect if the user has moved an object outside the div and if its necessary to scroll automatically?
I have a "lightbox" type script setup and i want to refresh the parent window after i automatically close the popup
onunload="opener.location.reload();"
bianchi if you're really getting null, there simply is no such element. You could verify that by referring to the element in the context of your test.html