Id like to open a form from another site another domain in an iframe and ideally the iframe should disappear-hide

?

the [/chat nick] doesnt seem to work
@wymetyme .. how do u get a pvt chat going?

don't you have to be identified?

[/msg nick]
and you have to be indentified
[/msg nickserv identify password]

done.

element in a form, is there an easy way to get the form object?

how do i force conversion of a number to string?

you could just do
var str = "+num+";

oh
thanks
doesn't work
stores the variable
not the contents

?
what do you mean
var str is now literally "num"?
oh
cause
""+num+"";

it's "+num+"

there

oh
thanks

hi,i just quit my job,and taking a 10 month open source stint. im a js hacker whos into event handling in particular. i run returnable.org ,and authored the reusable js library.also blog at http://bosky101.blogspot.com .any suggestions/pointers as to
how i can contribute to opensource?

umm… can someone point out what i'm doing wrong in this: http://cpp.sourceforge.net/?show=38105 ? it just refuses to work… no errors or anything… i didn't forget to set the events, either…

interval is set as a private var
doubt thats the only reason it wont work

it doesn't even start

hard to see without the whole script
wh dont you paste bin the script

it's a part of a page…
just a sec
i'll paste it somewhere
http://cpp.sourceforge.net/?show=38106
the alerts i put there do show up….

element is a local variable, but anything passed to setInterval is executed at global scope
Use a closure

yep

http://cpp.sourceforge.net/?show=38106
that's the one
the alerts do show up…
so i guess it's something related with my html…

yeah but element is set in the function as a private var

element is a local variable, but anything passed to setInterval is executed at global scope
Use a closure

when you have element.style.backgroundColor is doesnt knwo what element you are talking about

closure?
oh

setInterval(function() {nextColor(element);}, 250);
Passing strings to set(Timeout|Interval) is bad practice anyway

oh
it still does not work :/
how do i force a variable global?

Global variables are generally a sign of bad design.

okay

`doesn't work @ a9913

doesn't work: What do you mean it doesn't work? What happens when you try to run it? What's the output? What's the error message? Saying "it doesn't work" is pointless.

well, there is no output…
it just does nothing
except for the alert

where can i find a tut or some code for a custom scrollbar….i want one that acts a slider, ie you move it between positions

What's the error message?

which means that atleast the function was run
Twey, no error message :/ had there been one, it would have been easy to fix it :/

A link to the page?

Twey, it's a local file
a part of it is at http://cpp.sourceforge.net/?show=38106 though
i'll post the full one, if needed

It would help.

okay
http://argent.50webs.org/t.html (currently only the first entry has the onmouseover and onmouseout events set, though)

can I connect to a pop server with JS?
POP3

Your function doesn't return a valid CSS colour
nextColor(), that is
What's it meant to do?

Twey, well, the values represent 0xffffff and 0×010101 respectively in hex
it subtracts 0×010101*i from 0xffffff

But you need to convert them to hex explicitly and prepend a hash

and sets that as colour
oh
thanks

t.style.backgroundColor = "#" + ( 16777215 - 65793 * temp ).toString(16);

oh
thanks

It… kind of works then
Kind of.

kind of?

It turns the whole row white.

oh
well, i can find a solution for that
thanks a lot!

Heh, welcome

atleast it works

Your code is too mathematical for a simpleton like me

heh, i was gonna use sine for rotationg :P
*rotation
i'm glad i didn't

I'd probably have done a load of string manip

basically because it'd be too complex even for me

Haha

bah, i *need* a global variable here :/

frb grrrrrred at Google Maps too
Not necessarily… try a closure

hehe
well I love it
except it doesn't work in IE

Ah

at least, the maps app I've built for my site

does anyone have an idea whether JS could connect to a POP3 or IMAP server?

It can, but only with the help of a server-side script and XHR

that's what I thought… :/ (XHR?)

XMLHttpRequest

oh right

Which is really stupidly named, actually.
It handles more than XML, and the naming is inconsistent between the two acronyms (XML vs Http), it should be XMLHTTPRequest or XmlHttpRequest or even better, just HTTPRequest (or maybe HttpRequest)
But I digress.

is there a "sleep" function in javascript?

`js sleep @ a9913

js sleep: Javascript doesn't have a sleep command (as it's single threaded (if that makes no sense, ask)). Instead use the setTimeout function. Example: doThis(); window.setTimeout(function(){ thenThisIn2Seconds() }, 2000);

you're dead-on tho

does setTimeout wait before performing or performs and then waits?

Waits then performs

ah, cool
thanks

Welcome

the server-side script is required because a) it needs to translate POP3/IMAP/SMTP to HTTP or b) because of XSS?

a)

k :/

Although it could also be an issue sending your POP/IMAP/SMTP login details to the client

how do you mean

Oh, the client's own account, never mind

for (i in myobj) { var myvar = eval("myobj."+i) }

myobj.foo === myobj['foo']

ah
ty

does recursive setTimeout work?

Yes

how can i make a scroll bar that works in steps?….like the ones at blueshoes ?

http://argent.50webs.org/t.html :/
just stops at one

I think it's stop()'s fault
It's kind of hard to tell where it stops, though, because of that big white chunk

it's supposed to get called only when i move my mouse out of the element…
o :P

Perhaps you should use a simpler algorithm to get the code right first, then you can go back to your high-performance mathematical stuff

okay :P

Also, your markup is broken
http://validator-test.w3.org/

i'm not so much concerned with the markup currently….
javascript, then markup

Broken markup causes broken scripts.

oh
okay\

Probably not in this case, but keep it valid anyway.

okay

The markup really comes first. You can think of it as a series of layers: first, you have your markup, the bare content; then, the CSS, making it all look nice; then, the Javascript, adding handy but optional functionality and pretty effects.
Each requires the previous layers to be working nicely in order to function.

okay
thanks
markup first, then
um, it worked
sort of
i found the problem
it was with my uber-1337 maths
when i do 1/2, it becomes 0 and not 0.5, right?

how can i invoke an anonymous function passed as an argument to another function?

apparently, it doesn't
how do i force it to an integer?

foo(bar) function foo(arg){ arg() }
will run the 'bar' function

function myf(func) { return func(3); } myf(function(p) { return p + " times five is " + p * 5; }); // @ Determinist

truncating it?

3 times five is 15

Math.floor(), or .toFixed(0)

oh
thanks

Math.floor(5.3);

5

(5.3).toFixed(0);

5

The former returns a number, the latter a string, IIRC

o
thanks

[ Math.floor(5.8), (5.8).toFixed(0) ]

{ 0: 5, 1: 6}

Hi, I have a problem with my javascript

atleast a part of my script works now
thanks

in my css I have :hover and :active set on a link containing a background image, and in my javascript host i need sometimes to change thios background image. But once I change the background image in the javascript, the image isn't changed anymore with the css
:active and :hover

yay! it works fully now!
thanks, Twey!
you're my saviour!

Can replacing @ with @ secure e-mail address against bots?

hi all.. say I'm using javascript to show/hide elements of a form and on submitting the form, form validation errors occur so the user is sent back to the form
now on returning back to the form, the parts of the form that were previously shown are now hidden
is there a way round this? basically, i have a pair of radio buttons
they click one radio button and one part of a form is shown, click another and another part of the form is shown
when they're returned back to the form, the radio button they previously clicked is selected and the corresponding part of the form is now hidden
hmm.. i suppose i can check if the radio button is checked onload and then show/hide the form from there
yeah, that did the trick! cheers!

if we have a statement like document.onmousemove = getMouseXY; can we disable it in some other function ?

document.onmousemove = null;

thanks
if two functions are listening to the same event is there a way to prioritise which funtion gets called first ?

how do I dynamically load an external JS file? e.g. say I click a button, and that loads SFX.js

thecoolone19 you mean AddEventListener?
IIRC they should be called at the same time

hey everyone
I'm trying to access a variable from within a function defined in another function
is there any way to do this without using globals?
here's my function

"barryog1" at 71.6.194.243 pasted "attempting to access a variable from within an inner function" (28 lines) at http://erxz.com/pb/3492

anyone have any ideas?
or reference material I could read?

local is local
only way to do it is via parameters

can you pass a variable by reference in javascript?

`byref

i want to hide a div when focus is no longer on an input field - is there an event for that?

http://www.google.com/search?q=javascript+%22by+reference%22
why don't you use the return value?

I'm calling a function which takes a function as one of its parameters which it calls back
its part of an ajax request method in the Ext library
the problem is that function has a defined set of parameters which it takes in so I'm not sure if I can alter its parameter list

I guess adding a parameter doesn't hurt
not exactly sure tho

yeah I'll try it

hi

so, anyone on the dynamically including a JS file issue?

hey everyone

fields to a page, do i need to use DOM or will document.write suffice?
ufields to a page, do i need to use DOM or will document.write suffice?/u

_

^_~

hey all

greetings

anyone have any tips/tools to help me see what links are navigated or headers sent by a javascript? i am trying to automate interaction with a website, but the site is filled with javascript:void(0); URLs

check the onclick="" in the link's tag

the onclick goes to another javascript function
i looked at hte function, but it is difficult to tell what it is doing

Firebug for Firefox, or Fiddler for IE on Windows
getfirebug.com

hihi

hi deltab. i'm writing this script in python :P

Ooh
deltab

or write your own proxy in python
hi Jan-

how do I figure out when someone was last on?

deltab, my own "proxy"? what do you mean?

/whowas

It says "there was no such nickname"
Oh, hey, me can has unbanned!

deltab, how would a proxy help with the javascript issue?

a server that receives requests from the browser and passes them onto another server
meanwhile displaying the request for you to read
that's what Fiddler does

firebug doesn't?

and Firebug

okay, i've installed firebug

though it does it within the browser
http://getfirebug.com/net.html
a href="http://getfirebug.com/net.html"http://getfirebug.com/net.html/a
Jan-: or you can try asking SeenServ

I was wondering when our illustrious channel founder might return

has anyone met with inconsistencies in setting the keys of arrays starting with numerals ?

Ooh. How?

does any one who of any easter eggs in ecmascript?

/msg seenserv seen nick, I think

seenserv hasn't seen b0at recently

what kind of inconsistencies?

hey, rocker

deltab, using firebug shows all the requests made for javascript host after the initial loading is complete. howver, interaction with the site does not show up (except for images).

when i try to add a flash object dynamically , i noticed that the id of the object throwed errors when containing @ or starting with numnerals.
(add to the DOM tree via js ie)

those aren't allowed as ids

when the same code was executed removing the @,and started with alpha's it worked.

"ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")."

but how come divs can be added .
try it in firebug.
var div1= document.createElement('div');div1.id='1sd@';document.body.appendChild(div1);
works in firefox( try pasting it in firebug's console)

it allows some things that are nonstandard, probably for compatibility

but flash objects cant be added
so wanted to know whether its a flash execption or dom one
or ecmascript
hmmm…

Aaaaargh! I *hate* the iphone!

Jan-: you've tried using one, or are just fed up with hearing about it?

The latter. God.
Hello, I am a drooling, easily-led prole.
"I am so stupid, it's actively infectious. Warning! Stay well back, danger of contagion."

Hi, is there a possibility within js code to include other js files?

Not directly, but there's tons of libraries for it.
Basically you use DOM methods to insert a new SCRIPT tag and populate its properties, like you'd change the SRC on an image.

var file1= document.createElement('script');file1.src='someurl.js';document.body.appendChild(file1);

Jan-: strange (for me as C developer) but thanks!

sorry ir should be added to the head ideally

Hi, I want to test if the current browser is IE version 6 or lower, is this possible to do ?

document.getElementsByTagName('head')[o].appendChild(file1);

Well, as I say, I wrote up a library and I just say include("foo.js")

please
why i cant use document.getElementById("tTL").style.left= to move the div tTL?
appear document.getElementById("tTL") has no properties

although,u code does become a candidate for the functions being called before the script is added.

barryog1, u is takinh with me?

tahts why i think its better to make a callback after the code is loaded.or start code only after all code is loaded by setting some flag.

sorry, but im brazillian

You end up putting most of your onload in a document.body.onload=function(){…}
otherwise your include()d script won't be available

what do u think of a ….include({url:"a.js",callback:nextFn});
do avoid code being called before script is added .
to make it more synchronous.

hey Jan-

How can I compress a javascript file to reduce it's size ?

google for javascript minify i think
json.org do one

minifying or packing

what is the difference ?

I think it just compresses all the variable and function names to the shortest possible strings
not much else you can do

just different names for the same think i believe it just removes all whitespace and other unneeded characters

packing is a more aggresive form, where variable names are compressed,etc . but there are chances for scope being changed i guess.
upacking is a more aggresive form, where variable names are compressed,etc . but there are chances for scope being changed i guess./u
bupacking is a more aggresive form, where variable names are compressed,etc . but there are chances for scope being changed i guess./u/b
bupacking is a more aggresive form, where variable names are compressed,etc . but there are chances for scope being changed i guess./u/b

hey rocker, you'd like Motteke
It's about schoolgirls

lol

thank u I found a website
http://javascriptcompressor.com/

hey somone say 'rocker' - i added it to the alert list
i need to see if it actually worked

rocker

yay it works!

roCkeR

yup, it works

if u want tochk regeex 8 )

Ooo.
javascriptcompressor.com took my table viewer from 18k to 8

nicee

can anyone name a opensource project that needs contribution in js ?

hmmmm

nobody likes or values JS authors.
we're scum

if I code a js , and put it on my website, someone can just download it and put it on his website, is there any way to avoid this ? I guess no …

P

No.

u could do a url rewrite to check only if the refering site is urs ,to give the code.
uu could do a url rewrite to check only if the refering site is urs ,to give the code./u
and secondly it doesnt take much to make ur own guys to use ur code. so forget others :P
@mono !?

i have a project you could help with js but the server is down

ah ha.
spit it out anyway

If I understand, in the JS I can check the URL, if it is not my site I do not execute code ? He could just change this line and point to his website ?

it's a web os, http://rockermono.unixpod.com/webos/ when it finally comes back online
make a server-side check that checks that the last url was your site
bmake a server-side check that checks that the last url was your site/b

so dont load all ur code initialy, dynamically add files from ur server.abstract stuff .
initially i thought hard about this as well..

ahh I check the url in the server, and then the server adds the script into the page, simple if else in php maybe

hell im html developers though the same way when they started ! but luk whats happened now
it just forces more creative,innovative js
nowadays infact sites like to make their code luk gud and with nice comments,coz they know ppl will luk at it. so i guess they're resolving to open source everything instead.
unowadays infact sites like to make their code luk gud and with nice comments,coz they know ppl will luk at it. so i guess they're resolving to open source everything instead./u
im talking about sites like yahoo,rico who started off with js in a big way.now they're showing the way.

omg add is a reserved word

does http://rockermono.unixpod.com/webos/ work for anyone???

nope

dangit

there are a few projects with webos on googling for it ?is it anyone of them?

lemme see
search for 'mcgw webos'

Aimai san senchi sorya…

while ur at it…check out mine as well 8 ) … its over at http://returnable.org

dude awesome
http://www.google.com/search?q=mcgw+webos&hl=en&filter=0 — all the links involving mine
the unixpod ones are probably taken off due to 404's

@mono : merci 8 )

?

what did jan just say?

i dont know, i'm not sure i want to know
http://www.google.com/search?q=mcgw+webos&hl=en&filter=0

Aimai san senchi sorya puni tte koto kai? Cho!
Roughly, "At 3cm long, could you call it squishy? Jeez!"
as you will note, it doesn't make sense in ANY language.

sort of like how the movie 'the mummy returns' would sound when translated to any language expect englighs
; D

http://www.w3.org/TR/html401/struct/lists.html#edef-DD

what is lolibot trying to tell me ?

to go to http://www.w3.org/TR/html401/struct/lists.html#edef-DD i think, but that's just a wild guess

ah ha !

lol

is that a real bot or a funny nick ?
no ofense…

who knows
hm
http://palidhar.nonlogic.org/index.php/tag/webos

i got into http://rockermono.nonlogic.org/webOS/desktop.php?guest=1 ,it doesnt do anything though.no error.no response on clicking anything.

huh?
oh
you gotta double click the icons
i'
*i've* improved it so much since that was the main on
*one

contains block elements?

MONO`

go to http://rockermono.nonlogic.org/webOS/desktop.php?guest=1 now
looks SO much better now that i uploaded all the updates
haha but the main page
DONT GO TO THE LOGIN PAGE
you'll be sorry…
xD
irc://chat.freenode.net/webos
er… #webos
anyone wanna help me come up with project ideas? ##MCGW

hey guys how is the name for the firefox plugin console debug

it's console…
er…. wait
no that's what firebug uses
idk

hi MONO`

hey, what's up?
hm g2g, be back in a little bit

ok

hi. I have a Javascript function that runs onLoad that adds a table row. In that function there is also a line that sets focus to the first input field in the newly crated table row. But I don't want focus to be set to that input field onLoad, but only any other time when that function is
run, such as when clicking a button. The focus line now looks like this:

table.appendChild(tr).getElementsByTagName("input")[0].focus();
How can I accomplish that?

bah, I need to find myself a adobe channel.

hi everyone

what's the best way of aborting a link url change? I don't want any js in markup…

add rel="something_to_make_it_unique" and work with it using javascript

so no one here nows the firefox plugin? i am getting errors but i cant debug them

firebug?
I need the link to actually work for those without js, so what I'm really looking for is a onclick function who breaks the link, and executes a function

add return false; to the end of the onclick
a href="/blah/" onclick="viewBlah(); return false;"blah/a

yeah, I tried that, but it would only work when I put the code in markup… weird, really… I'll have another try
nope, still won't work in the external JS
oh, well. Just keep it this way, then.. tnx

guys if i want to add an onclick event to an image element i created via document.createElement("img"), how do i go about doing it?

how i know the real(actual) position of a input text?
js ref

hmmmmmmmmmmmmmmmmmmmm

please, someone?

i want to hide a div when focus is no longer on an input field - is there an event for that?

how can I redirect a browser directly from JS? (without html hosting header stuff)

location=

thanks.

i have a question, I have a table filled with text input with the same name, how do I dump them into an array
I tried to loop through them but that didn't work
it worked with check boxes but I dont know why it won't work with text inputs
cv = document.myform.myname[i].value — why wouldnt that work

"alert(xmlHttp); xmlHttp.send(null); alert(1);", I get message box with "[object XMLHttpRequest]", but not with "1". Any ideas?

because the .send(null) fails i think

Any particular reasons for this to happen? (URL is correct)

when poping a window how can i hide the address bar?

well

has insertNode method. Is it for WySiWyG?

www.wmonline.com.br/
"geradores online"

all element nodes have an insertNode method

it doesnt work for ie7 windows vista
i still get the address bar

ohh

with auto:blank

and now?

now what?

I'd like to open a form from another site (another domain) in an iframe, and ideally the iframe should disappear/hide when the form is posted. Is this possible, since it's cross-domain? Does the iframe element itself — which is on my domain — perhaps trigger some event if its content
changes?

Obviously that wouldn't tell me that the form has been posted specifically, just that the form page has been navigated away from, but it'd be good enough.

can someone confirm if this code will work?

hi folx
how can i build a regular expression dynamically?

build it up as a string and use new RegExp(yourString)

that is an idea
thx

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:RegExp#Created_by

thxalot
string.replace(new RegExp(myStr), replaceStr)
?

Hello

"test".replace(new RegExp("e|s", "g"), "-")

t–t

k
looks like

alert("Hello");

Error: Error: ReferenceError: alert is not defined at line 0: (null)

How can I instantiate a class using a variable? something like className = "MyClass"; myObject = new className;

if MyClass is in the global scope, try var myObject = new window["MyClass"];
otherwise, apply the property access to whatever object scope it's in

how to wrap non-break strings?

'cluster shade'.replace(new RegExp('\b'+shade+'\b'), '')

Error: Error: ReferenceError: shade is not defined at line 0: (null)

'cluster shade'.replace(new RegExp('\b'+'shade'+'\b'), '')

insin, isn't there another way?

cluster shade

how do i acess xml nodes with namespaces? document.selectNodes('//foaf:member').length gives me a namespace error. here is the document. http://my.opera.com/Opera/xml/foaf/

shouldn't that be working?

escape the slahes

oh shit
right

'cluster shade'.replace(/\bshade\b/, '')

alright, thanks
new RegExp('\\b'+'shade'+'\\b') works fine
is there an innerHTML for text-only?
like innerText?

theres no difference

because

hi there. I can't seem to use getElementById with the id as a variable. I have this code for debugging:
var therow = "input_date"+inputs; alert(therow); var thedate = document.getElementById(therow).value; alert(therow+thedate);
The alert for therow works just fine. But it seems like thedate never gets a value although it works if I hardcode an id as a value…. What have I done wrong?

i have an image and one br and text in a link
and only want to get the text

hey everyone

element.textContent is what i was looking for

how do i run a loop in the "background"?

what do you mean by background?

asynchronously

that's not what asynchronously means :p

in another thread

:p

js doesn't support multithreading, does it?

doesn't

does it matter? Multithreading is silly! :p

for js - maybe
;search js multithreading

http://ajaxian.com/by/topic/editorial/page/2/

Is there a way to know the size of a file? For example I go through the DOM of a site and retrieve the sources of all embedded images. Is there a JS way to know that file http://foo.bar/img.jpg has XX KBs?

looks in the DOM inspector at the image. It *may* be available.

oh hihi Woosta

heya Jan`

Perhaps making a HEAD XHR (Ajax) request returns the file size? Though that would only work with images from the same domain, I think.
Nevermind, seems HEAD doesn't send the size of the file contents.

thanks

Content-Length: 3373
^^ should do
but as you say .. only on the same domain

I'm sorry - I'm a totally JS rookie - I can't follow both of you
But I guess this means that there is no way to download other elements from/withhin js?
like a page, or image

dorward isn't here, is he?
*phew*

Oh, HEAD gave that? Cool.
"HEAD gave" :O
You can "download" in the sense that you can make HTTP requests. So you could make a HEAD request which basically just asks if the file exists and when it was last modified. Perhaps also gets you the file size. Or you could make a GET request and actually receive the data. Suppose you could
count it.

http://www.google.com/search?q=xml%20http%20request

thanks

foo = [1,2,3,4,5]; foo.1

Jan`: Error: Error: missing ; before statement at line 0: foo = [1,2,3,4,5]; foo.1

Note that there are tons of methods (in any of the big libraries: Prototype, Dojo etc) that wrap the XHR stuff so you get a nice interface and portable code.

I'm developing a firefox extension - and my background is c, c++, python, java and the like. I'm fairly new to any web stuff. JavaScript seems to be a nice but strange language thanks for you help!

false = true,

strange indeed xD

Error: Error: invalid assignment left-hand side at line 0: false = true,

false = true;

Error: Error: invalid assignment left-hand side at line 0: false = true;

false = 0;

Error: Error: invalid assignment left-hand side at line 0: false = 0;

jseval false == true

false

false = null;

Error: Error: invalid assignment left-hand side at line 0: false = null;

false == null;

false

jseval false == null

false

^^

false == true;

false

false == NaN;

false

false == '';

true

hmz

false === ""

false

!!""

false

jseval !!NaN

false

hmm
explain this.
false == 0;

true

false == '';

true

false == undefined;

false

lol

false == null;

false

explain that.
why isnt 0 '' undefined and null false?

null - is not 0
false is - 0 integer, "" string
boolean false

explain more.
is it because its different types?
this;

{ }

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Boolean

!!null

false

JS converts values to their boolean equivalents when used in a boolean context - you can do this using !!
if you want to ensure they're equal and the same type, use ===

hm

never heard of !! b4

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operators:Comparison_Operators

kool

"When both operands are String, Number or Boolean, their type is converted to Number, and then the comparison takes place. When both operands are null or undefined, the result of the comparison is true. "

how can i avoid selection of text while dragdropping some elements

could be nice to know
try change cursor to pointer.
pointer; css.

false == "false"

false

!!""

false

!!"notempty"

cursor is move atm

true

but that's only the display of the cursor
not the function
associated with

"" - false, !"" - true, !!"" - false

wicked
last time was.. 97, not so fun then :/

http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript

heh
ill check that, but i dont havy any problems.

oh men
y can't i make floating images in a heading?

and i want clear it onfocus, and fill it with hint valued on blur if it content is empty, what property of textarea i should user ? or innerHTML ?

innerHTML i think.

textarea.value

hm

so what ?

and have a reference on one of them how can i determine what property use ? .value or innerHTML ?

has .value

yeah
and textarea also

thanks, looks nice. ill read that.

but html 4.01 refenrece doesn't say so

i tried it
and it work
ed

im very happy to have world top notch mentors who i learn from aswell. .)

and konquerror, for example, doesn't show .value when loading page ..

that's for writing HTML, you're deaming with the DOM at this stage
soryy, that was directed at yup

hm
so i shuould see in DOM for properties, not in html ?
sorry for misspelling

what do u have to say regarding building js api's?

cool

file.setAttribute("class","textpicada"); ?
when creating an element dinamically

use className instead of class

?
file.className = "textpicada" ?

yea

nice!
thanks
d.setAttribute("style","margin: 0 auto");
but it seems it aint work in IE neither
any fix?

el.style.cssText = "whatever";
http://www.jonathanbuchanan.plus.com/repos/js-utils/scripts/12-dombuilder.js
see ieSetAttribute and createElement

thank you very much insin

you're welcome

..

n8 folx
cya
bye

hi

how do i get an elements absolute position even if its a relativly positioned element? i thought it was offsetTop, offsetLeft

That's it's position relative to it's offsetParent
crawl up the offsetParent and you'll be fairly close

hmm

IE has a few weirdnesses

so there isnt actually a property for that?

no

ty

is there a way to assign an event handler for a particular class of elements using css?

like http://www.bennolan.com/behaviour/ ?

unfortunately no

:/

heh .. /me looks

would be really nice though

try jquery $(.classname'').click(function() {alert("!")});

insin, no i mean that i could specify onclick= in the CSS itself, so i wouldn't have to write every time i wrote an element with that class

Just wondering, I'm trying to stick a reference to the main document onto a subwindow. windows.open(….).mydoc = document works well, but when the subwindow reloads, the attribute stuck onto the window get lost

Byron, yeah i could write something up in an onload or something, but it's only one element i need it for actually heh :P

insin's link looks like what you want .. just it's not in the CSS (which it shouldn't be anyway)
I didn't think it was right until I got to the docs part
Though it just recurses over the whole dom and applies the fn to each element .. which means you have to be careful if you modify the DOM

ah
thats nice
yeah much better than putting it in CSS
and definitely better than having onclick etc all over your html :/

yes and no .. putting it in the CSS would be bad, but 'tying' behaviours to classes should be available

hmm
how can i make some text unselectable?

you don't
that's silly

Jan`, oh it means light of islam :P

aka Terrorist

Woosta, i'm making an ajax desktop, and i want a text logo imprinted upon the desktop wallpaper, but i want it to be unselectable so it looks like its part of the background
i've set it at 25% opacity so it "blends in"
in firefox its unselectable

Uurgh.
Religion.

default; and did onmousedown="return false;"
but i can still select it in IE7 :/

Yup
IE sucks

No kidding.

lol

Nanobot++

I learned how to make thai green curry
It was nice

I love masterchef .. but how did you learn to make a curry from it? They don't go through recipes ..?

No, no. I *am* master chef

Ahhhhh

All I actually did was mix a load of curry paste style stuff up in a blender and add coconut milk.
But it tasted like a thai green curry
so I'm happy.

hehehe

bean thread noodle with pickled garlic & scrambled egg

Oh quiet you

:p

i've been living on pizza for the past month
literally
pizza and coke
i'm desperate for something else

NoorulIslaam is single

You'll end up looking like Woo… you'll end up overweight.

i'm already overweight :P
obese actually

Woosta, weren't you in the process of losing tons of weight?

i passed that point a long time ago
:P

I am .. still ..

hard going?

Lost 18kg
yup, killing me

visible difference?

losing weight is like going without internet

Ought to be, that much…

you cant do it for more than a day

18 kilos is a lot.

yeah, but mainly around my neck .. putting on a ton of muscle

How much do you want to lose?

you had 18 kilos on your neck?

Jan`: 60kg more

also another IE7 bug…
in order to actually reload updated content from the server
you have to close the tab, open another one, and then reload the page you were at
hitting the refresh button doesn't work

Aw well, you'll feel better.
You must already feel better I guess.

hey everyone

Jan`: except I have a cold .. again .. :-(

Gah.

hey, Dr. Nick^H^H^H^H^H^H^HMONO`

If you're coming down with more than usual infections, it may be worth reexamining what you're eating for vitamin content.

i'm not Dr. Nick, ok? lol

You can really screw yourself by making big dietary changes.

Jan`: nah, it's a fitness thing: the more fit you are, the more colds you catch

is there anything against using iframes?

does anyone understand the underlying method behind draggable elements?
is it just a mousedown event, and essentially a constant relocation of the element?

yes

Woosta, you shouldn't catch colds.
It says here you should increase your intake of vitamin C

heh
i was just doing some javascript animation involving swipes and fades at the same time
and man
IE7 is much, much slower than firefox

what are you using?
as a js lib

meaning?
for the animations?

yeah

i just wrote my own code

maybe that's why then
hehe

all it does is increment a value over a period of time

yeah, js can be pretty slow

well it works fine in firefox

There's a reason most people use existing libraries for such effects

hmm
what would i do differently?

There's probably a lot you could do to optimize it, but it would be a reinvention of the wheel

oh for example?

I don't know really, I let the jQuery developers worry about such optimizations

well
all its doing is calling a function every 15 milliseconds, and the function does a element.style.left+=constant*iteration_number*iteration_number;

Yeah, that should work… I dunno. I just know what I use works great
http://jquery.com/ if you decide to check it out, else good luck getting it to work

what's a "rockstar programmer"

a programmer who is to the programming community as a rockstar is to the rocknroll community?
I can't believe I just said "rocknroll community"

me neither

hehe

I saw a job position for a "rockstar" programmer
maybe my hair isn't long enough

I really hate the type of people that write ads like that

http://www.codinghorror.com/blog/archives/000552.html

They probably want said "rockstar programmer" for 35k/year too

hah
"http://seeker.dice.com/jobsearch/servlet/JobSearch?op=300&rel_code=1102&N=0&Hf=0&NUM_PER_PAGE=30&Ntk=JobSearchRanking&Ntx=mode+matchall&AREA_CODES=&AC_COUNTRY=1525&QUICK=1&ZIPCODE=&RADIUS=64.37376&ZC_COUNTRY=0&COUNTRY=1525&STAT_PROV=0&METRO_AREA=33.78715899%2C-84.39164034&TRAVEL=0&TAXTERM=0&SORTSPEC=0&FRMT=0&DAYSBACK=30&LOCATION_OPTION=2&FREE_TEXT=rockstar&SEARCH.x=0&SEARCH.y=0&WHERE">
http://seeker.dice.com/jobsearch/servlet/JobSearch?op=300&rel_code=1102&N=0&Hf=0&NUM_PER_PAGE=30&Ntk=JobSearchRanking&Ntx=mode+matchall&AREA_CODES=&AC_COUNTRY=1525&QUICK=1&ZIPCODE=&RADIUS=64.37376&ZC_COUNTRY=0&COUNTRY=1525&STAT_PROV=0&METRO_AREA=33.78715899%2C-84.39164034&TRAVEL=0&TAXTERM=0&SORTSPEC=0&FRMT=0&DAYSBACK=30&LOCATION_OPTION=2&FREE_TEXT=rockstar&SEARCH.x=0&SEARCH.y=0&WHERE
=
hahaha

I get sex, drugs and parties… still working on the rolling stone cover
"
Job Title:
Rockstar Developer"

looks like that's even the title yeah
haha

wouldn't it suck to have that on your nametag at company events

hehe

is there a way to specify that a javascript file should only be fetched once the window.onload event has passed?

you could just fetch it onload
by just creating a new script element in the head after the dom has loaded

tag

so by dom manipulation?

yep

just quickly, how would I do that?

just create a new script element and set its src to what you want
somthing like this http://pastie.caboo.se/77203

http://rafb.net/p/JJxNVK12.html

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

cheers Byron

np
what is that getSize function supposed to do?

it supposed for getting A4 format
size

a4 format size?

That worked perfectly, but for some reason, the following code that needs to use that script does not wait for it to be downloaded, and therefore, the functions are not recognized. Do i need to set a timer or something stupid like that?

so you have to wait for the script to load before you call the functions?

yes
xerox paper format
printer paper format

sorry i dont know much about paper formats, whats wrong with your function?
can you paste the code somewhere?

width = 297 cm, height = 210 cm
Byron, my function does distortion of the cell's widths
table-layout:fixed does wrong help

Byron- yeah i need to wait for the script to load. If it is done inline, it is downloaded in that order. Obvously with javascript, it is not a blocking call…

try a timeout with a check for the "GScript" function, when that function exists execute the code

thanks for your help. I'll give that a try.

hello
if I want to submit my form to my javascript. How do I make the form not submit regularly?
bif I want to submit my form to my javascript. How do I make the form not submit regularly?/b

you can submit a form with myForm.submit()

I do not want my form to submit. I just want javascript to do stuff with the form field values.

like validation?

yes

use dom to get the values and do what you want with them?

I get the value
s
hrmm
if you hit enter in a field or hit the submit button it submits the form the regular way a non javascript form would

oic

I did onsubmit="return false" but that doesn't seem to be working for Firefox

change the submit into a button

ahhh ok

then just call the submit function when ur ready

cool
thanks

np

hey guys, i need a script to slide up and slide down divs, any example i could use? but the problem is that when i slide down the a div it needs to slide up the old div slided down if there is any
anyone could help please
how can i get an element height?

element.offsetHeight ?
document.getElementById('myElement').offsetHeight

Hey guys
Is anyone around with IE7 on a Windows XP machine who could verify something for me?

sure

Thanks Byron, pm'd link

O_o

Huh
Welcome back

how can i know if a element exists?

if (whoever)

how can i assing a element to a var if the element exists
can i do something like that

yes

how?

one sec

got it
thanks

no problem in ie7 besides some overlapping elements

Oh, thanks

Hi there. Is there a way I can pass parameters into a function when calling it as a pointer?
i.e.
document.onmouseup= dvdMenu.moveLayer;
i want to say dvdMenu.moveLayer('foo', 'bar') etc

a pointer..?

document.onmouseup.onload = function() {dvdMenu.moveLayer('foo', 'bar')} ?

that should do it, Byron thanks.

np

Like in C? Javascript doesn't have pointers, at least not exposed to the programmer

It's not really a pointer, it's way to reference the function, i know.

event?

From my understanding, the = operator always creates a copy

= is assignment
== is compartive
=== compartive with type cast
somthing like that :O
s/cast/check/
*sigh*

hello!
link[i].onclick = function() { return mostrar(id[i]); }; How can I make the "i" inside the function be the same as the "i" from the link[i]?

you mean it isn't?

yes, it should be?

what do you mean? the 'i' in a loop is not scoping out to the containing function?

CommandPrompt, yes, but if it should be then I have another problem

… ok… :|

CommandPrompt, link[i].onclick = function() { alert(i); return mostrar(id[i]); }; the alert presents the correct value of 'i' but mostrar(id[i]) is not working, but mostrar(id[0]) works..

strange….

if the alert() shows the correct value, I don't see why the function mostrar() will give otherwise, it seems you're getting the correct value for 'i' just not the element you want returned

yeah, I agree with you

`js closures

http://jibbering.com/faq/faq_notes/closures.html or http://blog.morrisjohns.com/javascript_closures_for_dummies

`js openings

read those

well
he's saying 'i' is correct on alert() hehe
I don't see how it'd be…. wait… is a function call…. I see

the i inside the function definition stays a variable, so later changes to the variable affect the inside of the function

so, you DO get out of the function scope

so how can I fix that?

make a local one

var e = i; funcall(id[e]); ?

function() { var myvar=i; return mostrar(id[myvar]); };

ensure a new variable is created for each iteration, by calling another function

CommandPrompt, I have tried your suggestion but I just get undefined…
deltab, I'm afraid I did not understand your suggestion, is it the same as the CommandPrompt one?

….

no, mine would work
read the articles, I don't have time to explain now

deltab, ok, thank you!

..

does anyone know what the difference is in using jquery to create classes as opposed to prototype

..
… wait! it doesn't … crap

sticky . key?

well now I see what you mean.. it does work on assigning the classes :P
…. wtf?
even on the wrong channel, sorry I have to let go with the pipe
can't say :|

does jquery allow you to create classes?

ha, thanks…I think it's Class Foo{} in jQuery
yes, I was reading it yesterday on some page….now I can't find the page….hate when this happens

I don't see anything about it in http://jqueryjs.googlecode.com/files/jquery-1.1.3.1.js
only some functions for dealing with HTML classes

hmm…

..
got it sorted?

some website I visited last night compared jQuery to prototype and showed how creating classes in each was different. It provided code. Now I can't find it.

CommandPrompt, I'm too tired now to read about closures now but I found a example of a similar code… I'll read it tomorrow, if you like to read it it's the Example 5 of "http://blog.morrisjohns.com/javascript_closures_for_dummies">http://blog.morrisjohns.com/javascript_closures_for_dummies

hehe
the issue is, youre … assigning an event handler
'i' runtime value, is good only over the loop at the time of the assigning, that's its scope runtime
so

hum… so how to fix it? uahuauh

link[i].onclick = function() { alert(i); ..} is assigned at that runtime, when the runtime is done, 'i' is flushed, and by the time the .onclick event looks for it, is NOT THERE, since its runtime is done and 'i' was flushed from memory

but it works
alert(i) works

no, it's kept in existence becuase the function refers to it

what doesn't work is funcall(i)

forming a closure

..
I'd … need to read some more…. but I'd expect 'i' gone :P after its runtime

is there anything other than prototype for creating javascript classes?

can i access post data with js?

currently i'm accessing an xml document with selectNodes('//elem/text()') this requires me to cycle through the nodes to get the actual text value with node.data; is there a way to use selectNodes/evaluate to get the actually value of the strings into an array like structure without
looping?

javascript doesn't have access tot he webpage headers where post data is sent/stored

are we talking XSL?

no
var els = xhr.responseXML.selectNodes('//foaf:Person//foaf:nick/text()'), friends = []; for (var i = 0, l = els.length; i l; i++) friends.push(els[i].data);
thats what i'm using now. trying to remove the looping completely

.
`dom ref selectNodes

it seems to only be in ie and opera
evaluate with the ordered nodes listing basically

Hey!

hello, i have a table that has onlick event on it's rows, is there a way to make it so i can navigate with my keyboard between the fields ?

I've seen some website where you change the colour of certain text without having to edit any of them on like those paste sites, how do i make one of those?

hi, is jquery.com down for anyone else? just wondering. can't get to the docs.

fearphage, thanks

 Web Hosting Provider | Hosting Provider

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Comments are closed.


Blog Tags:

Similar posts: