OK I am trying to submit a form from within a function and have it trigger the validation which is in the onsubmit

how can i make the title bar flash?
on windows

titlebar of what :p

the browser
like when you get an im
it flashes orange

on firefox window.getAttention()

ta
except…it doesnt work

where can i find that acordion js ?

hmmm

CRAP! I need a function wich works for Safari and can pick the textContent from any kind of element.. (at least a and td) .textContent, .innerText, .nodeValue and .innerHTML are all no good

no good as in empty?

no good as in returns different values for different element types..
at least innerHTML… the others only return undefined…
remember this is safari and js support is not the best…

can anyone tell me what I am doing wrong in http://www.pastebin.ca/641710 ? I'm kind of newbieish to ajax, and for some reason, readyState does not trigger when it gets 4. (My Firebug tells me, however, that the document was loaded correctly)

The paste 641710 has been copied to http://erxz.com/pb/3858

hi all, if I remove an element which has many children, is there any problem with the garbage collector? are all the children automatically removed from memory too?

js dev

anyone got an idea why the line doesn't start from the edge of the mouse icon? http://doktoreas.ominiverdi.org/esercizi/misura/index2.htm

thats probably a css problem
you need to subtract canv.offsetLeft and canv.offsetTop from your x and y vars
you are taking the pos from the page, not the canvas element

hi Jabapyth , this is the function for coordinates..http://rafb.net/p/TwI0tN54.html
what is wrong?

like i said, subtract the coords for the canvas, eg canvas.offsetTop/Left
the document body automatically has padding, therefor your canvas isn _right_ and the top of your page, its about 8px down and 9px right

hi folks. is it possible to check if the network connection is active using javascript ?

do a xhr
xmlhttprequest
to google, or something
here is a correct posting: http://rafb.net/p/0×3it551.html

thank you Jabapyth

no problem

i place an alert and it show that all offset are 0

theres a func to fix that…let me find it

I have an onchange="" on a radiobutton. This seems to work perfectly in firefox, but in internet explorer, it doesn't do the update untill I click something new.. how can I solve that ? I want the update to happen immediately after a user clicks the element

here this http://pastebin.com/d1a4c3ecc function finds the correct position of the elements
"click something new"? what do you mean? unfocus?

yeah

try "onclick"
heres the fixed function: http://rafb.net/p/DDaYbR89.html

Think it worked Jabapyth … thanks mate.

no problem

Got a bit of a problem with my page - using Dojo controls; but they often appear as "normal" buttons for a split second before becoming decorated.

try decreasing.optimising the load time. Use Yahoo!'s YSlow companion to Firebug for that

ok all is fine…i had to change to -=

Anyone from Spain here?

how can i get the current date in the following format 20070801 ?

How does that affect this? I get the same symptoms as removing the dojo.js script load, albeit for a split second.

string-concatenatoin and using the getFullYear() getMonth() and getDate() methods on you (new Date()) object.,

hiu
hi
how can i open a new window in firefox

thxs

has no properties
window.open('alaprajz.php?id='+this.id.substring(5)
).focus();
what is wrong?

getDate() — returns 1 how can i make it always return 2 digits like 01 instead or 1 ?

how can i change the favicon with javascript?

you can't, once its loaded its cached, so any change won't take effect, and seen as javascript hosting is per page, next time it loads it'll be be back to normal

the favicon is a file on the root of the website, so no you cannot, you could with server side scripting if you have read/write persmmisions… so you could use Ajax to run a script on the server that will change it

sure you can, meebo does
you can specify it with html

oh didn't know, sorry

link rel="icon" href="favicon.png" type="image/png"
in the head.
you can just change the href on that

i tried it but that didnt work

yeah, but as i said - it won't do anything.

add another link obj?

http://www.forever.co.il/Loading.htm — little javascript problom… if anyone can help

doesn't the wait function work?

i don't know much javascript..

Nir-PHP: use a setTimeout

yeah.. but..
i don't know js

learn

found that script in a js website.. need to adjust a little bit

setTimeout()
and then change the value

and how do i loop it?

why won't firebug break at any breakpoints that are in external scripts when the window.onload event isn't inline?

while etc

heh.. it's not so understood
can you help out with that?

works ta!

Nir-PHP: kwik n dirty http://rafb.net/p/noYk9T38.html
np

Jabapyth?
kinda got an error

what?
you need to set "loader" to the val of the button
it isnt *completely* plugnplay

:o

http://www.pastebin.ca/641804

Nir-PHP: The paste 641804 has been copied to http://erxz.com/pb/3860

where was my mistake?

damn.. my script crashed the browser.

Nir-PHP: this should work http://rafb.net/p/WUeanO49.html

is there any ajax guru available :o ?

just replace the "disablebutton" function with that one
right here

nope… not working
by the way
why did you put function inside a function?

is it doing anything?

(need to solve the back-button: got some scripts, but they are not refreshing the loading function which is used to get the content of sime files and to display them then)
okay, need to post it on pastebin.

yeah. gives me an error

Nir-PHP: to preserve namespace
Nir-PHP: what error?

ohh
you forgot { :P
heh working
thanks mate

np

http://pastebin.ca/641809

The paste 641809 has been copied to http://erxz.com/pb/3861

sorry for the typo
what do you want to do?

onclick im loading a file
for instance

uploading?

a href="#" onclick="loadcontent('test.php')"menulink/a
http://miranda-me.org/config/ajax/ajax/
you can see it here
the three links above

and the problem is….

that the back button does not work
it does work with some scripts
but the loadcontent() isn't refreshed
historydata changes, but the loadcontent() doesn't
i'm using reallysimplehistory for back button
http://www.onjava.com/pub/a/onjava/2005/10/26/ajax-handling-bookmarks-and-back-button.html

i havnt dealt with back buttons much, sorry… :'(

:-/ no problem. as a js beginner i just don't know, how to insert the loadcontent() function into the reallysimplehistory function, so when pressing the back button, loadcontent() is called again

and the historyData) changes

you put your load function into the "historyChange" function (in ajaxHistory2.js)
it gives you the location and data, so you can work with that

ah
thank you, will try

hi! Anyone editing javascript with Eclipse? I'm looking for some extra suport beyond WTP: code formating, better highlight, etc. Not much beyond the basics, but I need good basics
Anyone can point me to a plugin? I've tried some time ago JSEclipse from Adobe but I didn't find it very good for my purposes
Code formatter is what I crave most

"miro" at 71.6.194.243 pasted "updated function - doesn't work" (22 lines) at http://erxz.com/pb/3862

nice bot :-)

how does it not work?

when pressing back button, content doesn't change (http://miranda-me.org/config/ajax/ajax/)

do you get the debug?

yes

uise firebug

oh
I see
my fault

document.getElementById("midle") has no properties

midle?

yes.. i'm pretty stupid, translated the name for you and forgot retranslating it :p
middle*

typos cause so much grief

so final testing on live page :o

anyone know if any of the libraries in the extjs stack have a way to query a div to get its height and width? found some stuff in YUI for getting viewport/document height/width but nothing for an element by id.

thats built in node.offsetHeight/Width

hey guys …. what's the easiest way to create link from some text … eg. i have somewhere on page "TEST" word … and i want to make a link of it using js ?

hey fellas-
isnt getElementsByTagName supported in most places?

argh.. it drives me crazy.

I choose one of the radiobuttons and then another field disapear
?

yes
style.display = 'none';

where to put it (i don't know js very well)

mom
type="radio" name="radio1" onclick="button2.style.display='none';" onblur="button2.style.display='inline';"
type="radio" name="radio2" onclick="button1.style.display='none';" onblur="button1.style.display='inline';"
for instance

brrr.

:O

I have this weird thing happening on my page where, for a half second, it shows the undecorated buttons then decorates them, i.e. looks like the dojo.js library wasn't loaded at all; but then corrects. What's going on?

are you using images?

No, unless dojo's buttons count as images (I'm pretty new to this)

I'm sure they're images
or background images

The formatting/positioning/concealment doesn't occur either for that half second

either way they'd load late, but I'm surprised a js framework as popular as dojo doesn't preload

I pulled the code from one of the demos - it's plausible I'm doing something wrong.

how are you "starting" dojo?

dojo.addOnLoad(init);
?
I just script-kiddied a bunch of code

there must be something before that

So itinitiates when the page has loaded. Thats pretty normal

script src="static/dojo/dojo.js" type="text/javascript"/script

onLoad
:o

ok, well, dojo needs a dom to operate on, so it can't load before the DOM exists. The simplest way to do this is to execute stuff when the page is finished loading, but that means you'll see what you're seeing
there are workarounds, though
However, I don't have them stored in my brain's cache

Give me something I can look up (terms) - I'm dynamically creating this page, so I can control the rate at which the HTML comes out if that's a concern.
What's this problem generally called?

Then build it serverside and flush it when it's ready

It happens even when I create the whole page as a single html hosting unit

You probably have som large images

Would the dojo.js count as a large image?
How do people normally deal with this? It isn't just the button images; but also the formatting that the dojo stuff does (concealment of hidden forms)
It's like none of the dojo is running until some time after. I can emulate it by nixing dojo.js

you could preload images

How do I preload the images? (Forgive if that is a clueless question)

you know how the images are called?
i'm not familiar with dojo. don't know if it will help.

No

:-/

you could compress the js (obfuscate)
you know like google does (remove newlines, rename the variables to 1 or 2 letters)
but make sure you save a readable copy

oh. is there a tool for doing so?

probably
havnt looked
ya

http://kirov.dyndns.org/test817/
a href="http://kirov.dyndns.org/test817/"http://kirov.dyndns.org/test817//a

it says "Hi" … o.o
oWow

Wait for it

ok I found one

omygosh

http://www.codeproject.com/csharp/jscompress/JSCompress.zip

I didn't know there was a #dojo on here - I may pester them there.

make sure it actually compresses, not just makes it unreadable

2939 bytes to 1414 bytes

i might keep that
good tool
but..is it just mswindoze?

C#, yes

crap

xD

stupid windows
C# can compile on mono, right?

could anyone explain me, why back button works for …http://miranda-me.org/config/ajax/ajax/… but not for … http://miranda-me.org/config/ajax/ … (only click downloads, serverinfos on the
right side) :! ? either i'm stupid, or i'm stupid - can't get the second one working (and the first one is just a test script ;-( )

maybe i can use wine

oh I don't know, I never used unix :o
only for backing up my drives when windows crashed them, hehe

fiiiirebug
4 errors
;-)

hum
output is just for debugging I think

but it throws an error, so it stops the js

oh :o
now it is true

bytheway, you should have the links give an actual href, to a seperate page w/ that content, so that google can index them

you are my god :p

MWAHAHAHAA

i thought i would do a noscriptarea for users without js (like google)
i should build a shrine :-/

ill come visit it…by carpet type="flying"/

har har
first ajax does its work, then the browser opens the page again without ajax
so I hope google attends noscript

just change the href to a "#number" with js
google wont see that

use javascript to delete the href

path[l]: deleteing the href removes the "link-ness" (underline,blue,etc)

á la document.href ?

find then modify it to just href="#"
fine*

I meant location.href btw :o . thanks for your tips

… 'à la'

oh. unicode.. "a la"

no a(link).hrefg
when the page loads, change all the link hrefs to pound-number's

onload="a(linkliste.htm).href = '#1';"
for instance?

ya
put it in a function (looks better) in an external js file, but ya

oh.. thanks again. and thanks again for helping me with the problem before, i really was despaired.

any time

there is no eventhandler which handles something automatically before onload is called?

yes

:-/

alert("hello"); /script

this will run as soon as the browser reads that part

but I need an eventhandler :-(

bouhouh

myfunction() /script

yes.. and to call the function I need onload

i don't see why you need to set up an event, if you are to set it at the same time you'll be calling it
for the onload, set it up as you always do, i donT' see how those 2 are realted
rlated
related

okay
I have some links I want to rewrite
as soon as possible
so the user isn't redirected to a wrong site
so i created a function which rewrites the links
and body onload="" im calling the function
but if the user is fast, he could have clicked another link before the page is fully loaded
and before the onload handler has done its work
but
hum
mom :O
ok.. I'll use onload and onmouseover for fast users

lol

:O

seems like a bad patching to me

it is, indeed. but I'm a bad javascript user and don't know a better solution :O

i think that this should not be handle by javascript
but fixed directly in the page

mom
I got some links which are using ajax
so href="#test"
and now if google visits the page
i need the correct href
like href="test.php"

if google visit the page the javascript won't be triggered

hi

heard google bot attends js, too.. just heard :o
but till i read it, i thought it doesnt

idoutit

anyone familiar with iframes/

hey.. you told me to rewrite the links

why would google waste time w/js, it would slow it down
ya, from the real (actual page) to something more ajax-friendly
sure

cool Im trying to make An Image when it gets clicked load into an iframe covering almost the entire page

so I could have used href="#test" and noscripthref="test.php"/noscript, too?

since google doesnt do js, it will just see the page w/content, not the ajax

an example http://ringtonecraze.info when someone selects a carrier it gets rid of all of the carriers
and loads my affiliate link on the page.

but it attends the noscript, doesnt it?

no, but have "a href='pagewcontent.html'" and then "scripta.href="#5"/script"
how much js do you know?
and css?

all you have to do is put a certain meta tag in your webpage
to not have the bot search it

I know CSS
no js

spider

the spider should crawl it
but not the js things

we want google to be able to crawl

I've been trying to hire someone to do it all day but no one wants the job so im like ill hit up the irc channels and see how its done

ill make a postbin for you

i dont think spiders crawl .js files

thanks

what do you want?

hire? how much ;P

jabapyth
im going to login

.js files aren't important

actually private message me
your aim or msn addy
we will discuss a fast price
you accept paypal?

jabapyth is a god, hire him :p

hey everyone

hey

what's up?

i want to
Ok, Jabapyth im not logged in I can accept your messages but you cant see mine so When you post it I'll add you to msn or aim

ok

i need lil advice … how to do this … i have menu with links that i want to remove … and i've made del function using xpath … but i want user to be able to choose wich links to remove … so how i should make it that way ?
creating with if states and commenting the del function for that link … and then if user wants that link to remove … i should use replace to remove // ?

gotit?

added you

global variables are bad, right? but in effect, isn't foo.bar pretty much a global variable as well?

Global variables are considered bad by some, yes. foo.bar isn't a global. foo is the global, bar is a property of foo
very good read: http://yuiblog.com/blog/2007/06/12/module-pattern/

thanks

ooo nifty http://phrogz.net/JS/Classes/OOPinJS.html

can I disable the back button?
or keep the back history empty

hardyVT - why is it anybody's business where I was before your page?

have a site that we can't have the user clicking the back button within the site…so I'm looking for a why to prevent the user from doing it.
it's for an internal web app

um… you cant disable the back button
[unless you manage to clear browsing history and never change the page location]
but that would be a huge feat
so yea.. have fun =p

I was thinking of not changing the page location, but that would only work with doing a lot ajax requests and that isn't happening because we want server sending pages…now the server host keeps track to see if user is trying to request an
previously requested page and prevents them.

what do you mean you want 'server sending pages'…? that's what happens with ajax

let me get my terms looked up

ajax sends a request to the server && gets a page back and gives you control over how it can be displayed

all within current page though, right?
so no reloads

yea

and no back button

and you can do both get and post requests
well i KNOW you can do get requests, i'm pretty sure post requests too

right, so we don't want to use ajax.

brb
um, why not?

so without using ajax, we can't pretend we are always on same page.
rockermono, cause I'm not the web dev guy

right… so why dont you want to use ajax? lol

you could use ajax+anchors

get request == viewing a page

if I was doing it then I might use ajax, but i don't want to side track the developer getting done all the work he must get done first.

erm… so why did you ask? .

because I thought I could set the location.href="#" on page load and it would keep me on the same page, but it doesn't work.

-_-
setting the location.href="#" makes it go to the same page with a # on it… it wont submit anything at all

if we used the ajax strategy, then we'd have one page and it would just replace the current page with whatever the php sends down, right?

yea, you have to tel it to replace it though

I'll suggest that to him then

how do i get event arguments in IE?

if you go to http://blah.com then click a link to http://blah.com/blahblah and http://blah.com/blahblah has location.href="#" your at http://blah.com/blahblah#

it seems clean.

^

yep, that's what my testing showed

the # doesn't change the page at all
that's just ajax people being stupid and thinking the href has to be there for it to work
that's just ajax people being stupid and thinking the href has to be there for it to work

lcoation.href="" puts Safari in an endless loop

um yes… because it reloads the page infinately
location.href="" means "load the page you're on right now, again, but actually reload it from the server"
that's basically what it tells the browser
could be likened to clicking the refresh button each time the page loads
=p

what's the send/pull command xmlrequest?

um?
idk
i'm guessing send/pull == post/get

httpRequest?
what do I call to send a request to server from javascript?

XMLHttpRequest

ty

Anyone want a High Paying Javascript and CSS job?

explain why you're advertising on IRC?

doesn't everyone want a high paying javascript and css job?
of course that's just marketing for a sweatshop, right?

well why would you be advertising on IRC instead of… oh i dont know…. a webpaeg?
*webpage

'cuz webpages are too slow, people have to go there and read them and I don't (yet) know everyone's email address to send them a link

RockerMONO Because I suck at Programming
And I'm offers a nice amount of money to do something simple

isn't alot of people's first instinct to go to google and look? =p

offering*

well, EasyMarketer what exactly is it you need done?

hehe, I know JavaScript and CSS. Give me some mo
Knowing JavaScript and CSS should be enough for any highpaying job.

any thoughts on extjs?

can you make it XHTML1/CSS2 valid? =p

I once had a guy applying for a position where I worked who was good (according to himself) in HTLM.

was that a typo or did he really say that?

I kicked his ass out of the building. HTLM that

lmao

He really said that.

wow
um…even my MOM knows it's html not htlm =p

HTLM - that's for "Language Modelling" - he was applying for an anthropology job, right?

I also asked an applicant how he would describe the word "dynamic" and he started ranting on about people beeing able to adjust and adapt. i.e. He thought I wanted the human-social-description of that word.
hehe, sadly no

i would've been tempted to /literally/ kick him out =p

or /knock/ him out, then drag him to dumpsters out back? (wait, was that a bit too far?)

more like not far enough =p

indeed. Tho he has written some high-end business web host applications in C/C++. He was just probably slacking and let everyone else in the project write the code.
People like that, there's no "too far".

so, I just came back from this interview. He started asking me about 'dynamic'. And I told them I wrote this big ass business project in C++ but really, it was my co-wo… hey! wtf?

haha

lawl

getDate() — returns 1 how can i make it always return 2 digits like 01 instead or 1 ?

anyone using IE that can try this snippet for me (just put it in the locationbar)? javascriptnew Date()).getYear()

2007

string concatentation using some conditional statement?
function two_digits(n) { return n 10 ? '0' + n : n.toString(); }; two_digits(1);

01

but it takes off leadingok

what's the latest and greatest version of suckerfish dropdowns?
I need a guide my mom can follow

the latest version's called milf. so when you wanna show you mom, just say, "hey mom, I wanna show you milfs I wanna (ab)use"

http://developer.yahoo.com/yslow/

~~ Speed up your web pages with YSlow

ah … dabear .. you're here
do you know any other source for docs … except diveintogm and gm wiki ?

If I am in the onClick of an element, is there an easy / generic way to get the current elements ID or javascript handle?

hi out there, is there a possibility to access the parameters a js-file is included in the document (not the parameters of the document itself, that whould ie be location.href)

anyone able to get prototype and jquery to coexist?
is it the event handler that clashes?

hmz, am I here :p
elbac, yeah, just use this.id

thanks

firefox doesnt require frequent enough updates
cant they do a couple a day?
sure hope this one breaks Selenium again!
/sarcasm

vinse, !!!
you can't have a closing-tag without an opening tag!

tsk tsk tsk
that's called Emotion late binding

if you don't mind, why isn't this working.. a href="#" onclick="this.id.innerHTML='A very cool site!';"Hello/a

hah

elbac, this.innerHTML

elbac how do you know it doesn't work

this.id.innerHTML would set the value of the id-attribute

ok
let me try that

( in a rather fucked up way)

Got it, thank you

when you use "this" in inline code like that, "this" is the element , not the document

np
nobody with easily solvable questions?
:p

dabear what's your problem?

StaZ|work, lots
like what's the meaning with life etc

42

so, sup people?

I'm running opera 9.22 build 655. I'm using trying to use the Web Applications Audio object. I'm not used to opera and have no idea how to go about debugging it. The page is http://paste.css-standards.org/21484/view

hi all, how do i access "td" of a "tr" for which I have an id? for example, is it getElementByID("rowID").firstChild.innerHTML ?
because that's not working, but it should be something similar

skr1, firstChild will be a text object if tr doesn't immideately follow td
in some browsers at least

tr follow td? you mean the other way around?

yeah

and I'd like to change the innerHTML of the TD

– first child to tr is td

– first child to tr is text object

right, but it isn't working as posted above
heh i see
but it follows

I would use xpath :p
getElementByID("rowID").getElementsByTagName('td')[0].innerHTML = 'asd'

sorry?
i see

xpath is a way to navigate through a document
isn't supported in IE though

what's xpath?

xpath is a way to navigate through a document
as I said

is there a way i can include a javascript file into/from another javascript file?

no

and apply a new script-element through DOM

you can do document.write based on ifs
but it will all be in one js file

alright, thanks.

hihi all

Jan- !
hi my love 3

hey bear

how can i insert ascii character 1 into a string?

You're not The_Bear by another name, are you?

nope

So uh. Do I know you?

nope :p

it appears i can't do document.getElementByID("period1").getElementsByTagName("td")

at least I dont think so..? :p

object doesn't support this property or method

Me either, but we seem to have gotten off to a great start!
bMe either, but we seem to have gotten off to a great start!/b
bMe either, but we seem to have gotten off to a great start!/b

thank you!

Me too.

do you have some milk, too?

Sure.
I bought a bag of five double chocolate chunk ones. At lunchtime.

skin milk?

any more suggestions regarding firstChild ?

No. Skim milk is too watery.
I have semi.

oh..
skr1, yeah

Are you on a diet?
drinks please

skr1, look at prototype
http://norskwebforum.no/pastebin/9192
firstDescendant would work
Jan-, no diet here

firstchild should work i'm pretty sure..?

yeah, but you might get a textnode in firefox, and a DOM element in IE

window.location.href("../../duel/duel/start.php");

window.location.href = '..(../asfdsa'

that stinks

window.location.href = '…./asfdsa'

td is the first child

skr1, that's why you should use hte function I liked to above

or just id the row
i mean the td

it's window.location.href="new location";

dabear firefox says its a unknown function

it's *not* a function
window.location.href="location"; or top.location.href="location"; or location.href="location";
=]

how to use arbritary ascii chars in javascipt strings?

String.fromCharCode(n)
String.fromCharCode(55)

Jan-: 7

ta

String.fromCharCode(0×0A)
it's a property of the String object itself
Not of strings per se

ye
i think helping me counts as coding

Where are you from, garethfn?

…uk
why?

Because saying "how to do x?" as a question makes it sound like you don't speak English as a first language.

really?

Yeah.
Really.

maybe its a local slang

um…
slang?

No, it's just crap grammar.

"how to do …" != slang
yea what Jan- said =p

i dont speak like i write in irc, anyway…:P

You could even have said "How do I do x", which is just colloquial, but doesn't make you sound like a 15 year old Polish person.
Well, bah. Give us a bit of credit, willya?
Using that sort of rubbish contraction just says "Hello, I am a bit of a moron. How are you?"

I'm fine, thank you
:p

haha

what, it doesnt lol

that seriously made *no* sense

missing ; before statement
[Break on this error] } elseif(data == 6){\n
http://pastebin.ca/642245 — and this is the function

The paste 642245 has been copied to http://erxz.com/pb/3864

Jan if you think i articulate poorly, there are lots of people in the uk who speak much worse :/

Just don't do the "how to do X" thing.

how to do x?

It's like turning up to a funeral in a hot pink spandex jumpsuit.

its like making speaking your train of thought out loud, nothing wrong with that

Sure there is. It makes you look less smart than you really are.
Then people start talking down to you and you get upset.

nah

yeah

no

Yes.
YES.

damnit
stupid internet

hmm, now i ID'd the TD and can't select it by id

a negative used to express dissent, denial, or refusal, as in response to a question or request

anyone answered while i was away?

No times a billion. Neener.

:P

where are you from?

Me?

is there some sort of javascript debugger program?

California originally, but I live near London now.

do you speak mockney?

js supports elseif right?

else if

*jinks*

its jinx, _Fallen

*sigh* NO, you dullard. JINX.
Showoff

I'm foreign, how should I know :-}

How foreign?

with a space?

german

can i get elements from non-html namespace with getElementsByTagName?

Aww, that's not *very* foreign?

but foreign enough to have an excuse

You mean like from an XML object? Yeah, I think so.

hmm for table "value" is used not innerHTML

Jan-: i mean that i use XHTML+some elements from my own namespace

don't know about that, but it's worth a try

getElementsByTagNameNS ?
if its in the dom tree it should work fine

nope, that didn't work either

I got this regExp:
how can I say JS, that it is correct when http:// is set but it is also correct, when it is not set?
blabla /^(http|https|ftp)/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(\d+))?\/?/i

er, what?

the regexp checks whether a url has the following format:
http://bla.de or http://www.bla.de

he's looking for a regex to validate URLs

so the http:// hast to be set
and i want, that the http:// hasn't to be set, but could
if not, i will add it by using php

will anyone help me with an issue I am having with my javascript
its small but tough
hello?

I think you should just ask

OK I am trying to submit a form from within a function and have it trigger the validation which is in the onsubmit attribute in the form tag. I found a way to do this just fine with this little script if(document.form2.onsubmit()){document.form2.submit()} But when using this script it
requires me to push the button twice in order for it to do anything… Without the if statement it works just fine but the onsubmit does not get called…. Help??

you should check whether the check called by onsubmit is true or false
if its true, submit the form using js if not, give alert or sth

well on the second click of the button it works just fine
runs the validation and if the validation returns true it goes ahead and submits
the only problem with it at all is the fact that it requires two clicks

do you have a live example?

no im sorry it is on a secure site
but I am not getting any javascript errors
its just screwy

any code?

other then that?

yes

what would be relevent?
that is the only part of the code causing any issue

form, function for checking

well the validation script 700 lines long

ok :O

and the form has 300 fields in it

then only the form and if statement
could you shorten it?

do you want just the form tag?
I could send you the button tag as well

send me what you think could help

input type="button" name="price" value="Price & select carrier" onclick="document.form2.buttonclicked.value=this.name;if(palletpos()){if(document.form2.onsubmit()){document.form2.submit()}}"
form name="form2" id="form2" method="post" action="/tendering/insert.cfm" onsubmit="return validateshipment();"

oO
if(document.form2.onsubmit()) {
document.form2.submit()
}
why don't you just use onsubmit submit.form ?

can you write that in code?

if(document.form2.onsubmit()) {
what do you want to check there?
if form2 has been submitted?

that triggers the validation script in the form onsubmit tag

ah ok
so if the validation is true, the form is submitted

yeah

if(palletpos()){
and this is?

that is kind of anther validation

okay
you should get all these if statements into a function

ok
let me try that

ok

still worked on the second click of the button
but not the first
the first click seems to do nothing

and now it looks like onclick="document.form2.buttonclicked.value=this.name; anotherfunction();"
?

input type="button" name="price" value="Price & select carrier" onclick="document.form2.buttonclicked.value=this.name;submitform();"

are you using this button for submitting the form?
or just for checking anything?

submiting the form
ultimately
no more thaughts?

is someone have firefox 2.0.0.6 ?

I do

i sent you something, but i knew that it wouldn't work :o o .. hum

i have a problem with it
it crashes

when?

can you try some page ?

hit me with it

http://romanyak.livejournal.com/
view sources
and scroll down

screw that its in like arabic

russian :p ?

that's some form of cyrillic, and even then, the code is just javascript

yeah
cyrillic

well im not gonna touch thatr

so ? does not crashes ?

and where should ff crash?

btw, pink never works in websites. Ever. No exceptions!

did not crash for me

when you view sources

no problem

not here

hm
scroll down to the end

what opperating system?

linux/fedora

xp

works in ubuntu

linux / xubuntu
2.0.0.5 ff

2.0.0.6 ff

i recently updated it from repo

if http|https|ftp is set, it's ok, but it is also okay if none of them is set?

doc|monster, pink works fine for pron sites

salu2
How I cant do, to my function recived a paramter, I like to past this parameter to String

nevah!
well, in certain… hmmm, not as a colour scheme :/

ello
just wondering, is there a problem with window.onresize in IE7?
it seems to not be picked up by it :-/

FF then returns "DIV" what gives ? where does this undefined firstChild come from in FF? there is not tag.. sure \n is there.. but is that standard? I cant see any tag in FireBug.. so what does firstChild pick this thing up? Does this mean I have t

d

[phl4k-x]: what do you want to do in your function ?

ai-a: you can enable display of whitespace nodes in fb I think. They are honored in ff.
you would need to skip whitespace nodes. Several js frameworks like prototype have functions to do so

but is that standard dom ?

I think so

i dont recall having this issue before.

I know its different in IE and FF in any case

How do you modify the content of a div with with id="info" for example? I would like to use ajax to update certain divs.

getElementById

not that hard.
do a xhtmlrequest,, get the result.. use getElementById("info").innerHTML = get_result

ai-a: Sweet, that's easy enough
Thanks
Could you guys recommend a good JS reference?

google.com

or more specifically

js reference for what ?

ey I have a problem

js the lanugage,,, or dom reference ?

with ajax y php

ai-a: http://www.google.com/search?q=Javascript+Tutorial

Just a general refernce - functions, etc..

ai-a: Javascript is a language, DOM is part of it

remember,, JS is not DOM.

DOM is part of it

its a library.

…no

I guess I'm looking for the dom reference.

DOM != library

developer.mozilla.org
@alkos333

http://www.w3schools.com/dom/default.asp

for both dom and js references

Thank yOU!
Greate source.

how come when i do events within a prototype class the events dont have the information of the class
like if i have a function in my class that gets triggered from an onclick event, and i want to call another function in the class, it says it is unefined
why is that happening and how do i fix it
and also its doing the same thing on ajax calls
when it gets to the callback method it doesnt hav eany concept of "this" in any respect to the class
not sure what it considers "this" in that situation
any ideas?

hi
is there a list somewhere of which xhtml elements allow the 'name' attribute?

name isn't XHTML

it seems pretty stupid to me that it is being deprecated, seeing as how important it is to javascript

yes it is. Forms do not work without name

…it's hardly used at all in javascript
….
yes they do
id
….
i use ID on my forms

names create domnode hooks

and how in the world is that an issue?

?
you use ID on your forms? Does it post properly?

yea

it doesn't work in older versions of IE though, so i just use both so i can get better access to the elements && still support older versions of IE

I have never seen an example of this
hm how to test it

post.php : php echo $_POST['test']; ?

/html

=]
^^

name when i have the value selected?

something about selected index if that helps, i'm not exactly sure, btw not trying to be rude but IRC nicks that are really long w/ all caps tend to be annoying

hello

hey wfq

I have a problem with this function http://pastebin.ca/642382

The paste 642382 has been copied to http://erxz.com/pb/3866

everthing works fine but I would like get the value in ret=checkSubmit(t);

O.o
runon function calls all the way dude =p

and put the return value in the form again
I have checked checkSubmit should return the value ok as I have done an alert just one line before than return
but I don't know how to return this value to the form again

it is not working for me. with id: http://neo-zeon.de/~nick/poster.html with name: http://neo-zeon.de/~nick/poster2.html

RockerMono, do you know how could I manage to to that?

i dont know much ajax at all…
odd… PHP version?
wait
try method="get" on the ID one

what why

method="get" puts everything on the URL
if that works it means that it's an issue with PHP =p

there
no difference

O.o
hm

but this question is not ajax, I think it is more javascript. I don't know how to return the value in the onsuccess: function

refresh
I do not think name is deprecated

yea
this is odd though, i had a working one with only id before then added name for older versions of IE, lol idk, go with name since that seems tow ork

there is no attribute "onsubmit"…why is onsubmit not valid?

that's only for form elements

yes
oh
hum
ok

form method="post" action="page" onsubmit="do_something();"input type="text" onsubmit="error_time" /input type="submit" value="Hm…" //form

yes.. that was my error :o

lol you put onsubmit in an input?

yeah lol.. must be drunken
maybe I wanted to type onclick oO
dont know

lol
onclick works for buttons
=]

:

what's that supposed to be?

clearing textfield on clicking it, filling it again when form is submitted
and changing the text-align
damn lol.. now I closed the firefox window with 70 tabs open instead of just closing the sourcecode window

haha

does anyone know how could I get the returned value by onsuccess to my form again http://pastebin.ca/642392 ?

The paste 642392 has been copied to http://erxz.com/pb/3867

thats not funny.. reloading that many tabs drives me crazy :p

stop pasting that url, use the one buubot sends you=p
oh, ok
who was laughing?

there's a mirror, you know :p ?

stop with the alcohol! =p

you got me

you pretty much flat out said it earlier =p

if i use javascript to request data to a php page that checks a session variable to see if the user is logged in, and they're otherwise logged in, will it still show they're logged in if js is doing the request?
uif i use javascript to request data to a php page that checks a session variable to see if the user is logged in, and they're otherwise logged in, will it still show they're logged in if js is doing the request?/u
(hope that made sense)

anyone needs some?
due to missing english skills, it doesn't make sense to me :p

yes. The http call will still send the cookies for the PHP session
yes. The http call will still send the cookies for the PHP session

great, thank you.

value';?

no
`html2dom @ wfq

html2dom: Woosta's (x)html to DOM convertor .. convert xhtml chunks to DOM scripting: http://rick.measham.id.au/paste/html2dom.htm

Put "divsome text/div" in the top left and click the 'convert' button to see some example code
Put "divsome text/div" in the top left and click the 'convert' button to see some example code

hey Woosta

Hi
Anyone can help me with this idiot problem please

http://felipe.dev.telium.com.br:8080/frontend_dev.php/auth/register?name=Felipe+Cardoso+Martins+%28Teste%29&tax_id=22842516842&email=felipe.cardoso.martins%40gmail.com&mail_code=07191210&address_line=Rua+da+Casa&address_line_number=51&country=5656%23Portugal%23351&state=&phone_code=011&phone_number=85736968&panel_user=macafe_teste&panel_password=123qweasdzxc&panel_password_confirm=123qweasdzxc&submit=Cadastrar

short url
and the sourcecode?

select one value in select and change please

oh ok
thought there are only the errors :p

My php …
This is only a debug page external of my application

and then?

No php for you.
Not in a javascript channel.

I have this error
document.nadaaver.submit is not a function

I shan't have it.

Sorry for not explain correct

why dont you just call the other function?

I would like submit my form in onchange of the select combo
But the propertie document.nadaaver.submit(); aren't workung

`forms @ macafe

forms: Accessing form elements via JavaScript: Don't use document.forms[index].elementName or document.formName.elementName. Use document.forms['formName'].elements['elementName'] or document.getElementById('formID').elements['elementName'] or document.getElementById('elementID')

`submit @ macafe
learn submit = Do you have a form element with name="submit"? That confuses some browsers. When you call yourForm.submit() it thinks you're talking about the name="submit" element.

OK

jsBot , Woosta .. When I do a sample in other file this form … document.form.submit() works
but at this page no
I don't know what is happen, I already try change the name of forms and etc

You'll need to show us some code

http://pastebin.com/d6e20b6

syntax error
Isn't your debugger showing you that?
function submitform() { alert ( document.forms['nadaaver'].submit(); ) }

document.forms.nadaaver.submit is not a function
sorry… A try the alert for debug the value of document.forms['nadaaver']
but the correct is function submitform() { document.nadaaver.submit(); }

I'm saying you have a syntax error that needs fixing
No, use the one that'
s in the pastebin
document.forms['formname']
but fix the syntax error
FFS
`submit @ macafe // and read the stuff I give you

submit: Do you have a form element with name="submit"? That confuses some browsers. When you call yourForm.submit() it thinks you're talking about the name="submit" element.

jsBot, good
I change the name of field and it's working
Thanks!

np

Woosta, Thanks to much for the help

are javascript associative arrays guaranteed to keep order? (I guess it doesn't make sense, but…)

howdy folks, I am having trouble with my prototyped model, everytime I call a method on it it returns the method like a giant string instead of actually running the method.

guaranteed NOT to

thanks

(and they're Objects .. you can just use them like associative arrays)

are objects by reference in this language? so I can create a new object, and have it referenced both in a normal array, and an associative array simulataneously?

I don't quite understand what you're say, but I'm going to go with 'no'

bad place to ask.. anyone know a channel about dvd ripping?

wrong place to ask. Seriously.

lol.. if i knew a dvd channel to ask in i wouldnt need to ask
#dvd has 1 person idling -_-

I'm getting this ominous error from google analytics, anyone have any hints? Expected ':' but found 'undefined'. Declaration Dropped.
I found nothing on google to explain it

Anyone know how I would disable a button (after the user has clicked on it)?

this.disable = true; ?

frb-work: Will have a look

maybe it's this.disabled or something

yeah it should be this.disabled='true';

thats done it
thanks
Easier than I thought

`js ref

http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/

`js ref indexOf

Returns the index at which the first occurrence of the specified value can be found in a string, or -1 if the value is not found. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objectstring:indexOf)

Does anyone know of a way I could write on an image? I mean, I know how to do it in PHP to actually generate the finished image, but I want to let the user do it graphically (Select a font, click where on the image he wants to type and type)

not in JS .. you could do it in flash I guess

Hm, okay. Thanks

no, you could
with canvas

IE doesn't support canvas, right?

not directly
but google wrote a canvas emulation layer over VML for IE
excanvas.js iirc

Nice

it's not perfect, but it should server your needs

So now I just gotta figure out canvas :-)

s/server/serve/

Thanks, frb

Also thank whatwg(tm)
Death to xhtml.

Anyone know how well-supported func.length is for determining the number of formal arguments to a function?

idk if this is a JS question or HTML question…but i have an iframe to an external page, and its redirecting, but its causing the whole page to redirect

?

The paste 642487 has been copied to http://erxz.com/pb/3870

`js ref @ woosta

js ref: http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/

`dom ref

http://w3.org/DOM , http://mozilla.org/docs/dom/domref/ , http://krook.org/jsdom/ , http://www.zvon.org/xxl/DOM2reference/Output/index.html

Because of javascript in said iframe. This will be using document.location = 'foo'. Disabling javascript in the iframe is the most obvious solution. Another would be to set an interval and keep checking if the iframe had the right address (or iframes might have a handler for this) and
resetting it if it's been changed.

how do i disable JS in the iframe?

none;, how do you degrade that for people who don't have javascript enabled?

none;"

and have javascript expand it when some little + is clicked, for example, then when someone comes along without javascript, they can't expand the div

but if i have the javascript set the display to none on load, there'll be a flash of the content being collapsed

I'd check for javascript capabilities

none; dynamically?

and based on that, I'd document.write the stylesheet link
oops
sorry
i'm not thinking straight
block; (or inline, or whatever)
then on window.onload, set the style of the div to display: none;
that way if js isn't enabled, the div will be shown by default

Chatmasta, iframe_doc = document.getElementsByTagName('iframe')[0].contentDocument;scripts = iframe_doc.getElementsByTagName('script'); for(i=0;iscripts.length);i++){scripts[i].parentNode.removeChildNode(scripts[i])} should get rid of most of them (untested)

document.getElementsByTagName('iframe')[0].contentDocument;scripts = iframe_doc.getElementsByTagName('script');
sorry
was copying that (irssi/putty)

That won't get of something like a onclick="javascript:document.location='http://example.com/'"Moo/a

if I'm intercepting a link's click, how do I stop the click from going through?

can someone go to http://mcgw.dav7.net:8181/beta/ and tell me if it looks right & if not what browser/os and what the issue is?
return false;

ah. Close, I guess. and it looks wrong. Firefox/Ubuntu
want a screenshot?

yea

hold

k
AHHHHHHhhhhhhhhhhhhhhhhh

RockerMONO, http://evancharlton.com/Screenshot.png
that's maximized (well, except for the bookmarks sidebar)

wow…
hm
close the sidebar and restore it and everything shifts to the right instead of the left =p

and I'm returning false but the click still goes through. my href="#" and the viewport jumps to the top of the document

hm
wait… what do you have href="#" for? -.-
most un-needed thing ever: href="#" and href=""

because I'm too lazy to do it correctly for now

lol
um.. how bout removing the href?

eh, might as well fix it now I guess

lol
you can change href="#" to xhref="#" if you really dont want the link to go through =p
although i wouldn't recommend it
but it /works/ …. not correctly.. but anyways…

I changed it to a real URL, but the onclick isn't stopping the href

hm
ok
it's onclick="crap_to_do();return false;" right?

no, crap_to_do() returns false

oh
you need to return false; in the onclick i think

there we go

oh btw
did you have the () or not in the onclick?

yes, as I'm passing a param

hm
if it has the () it should pass back the return false; …
i dunno
meh, it works =p

heh, eah
yeah*

hey everyone. I'm trying to pass a div ID into srcElement, but when srcElement is called, it is coming up void. Any ideas why? http://rafb.net/p/O8AhPQ89.html
It's the 1st function here, starting at line 4
I think this only happens in conjunction with next_photo_gallery() … otherwise, I think it works fine

hey
anyone familiar with jQuery?
I need a way, when a on click event is executed for a checkbox, to know if it is checked or not

endra, document.getElementById('checkbox_id').checked

hey all… had to leave for a second, but I'm back now. I fixed the earlier problem I had… I have a new one.
Using javascript, I am trying to create, hide, and show divs containing images with the img path located in an array. When I load the div, instead of the image being displayed, all I see is this: undefined
http://rafb.net/p/y50ILV19.html
begin really looking at ln 55

your loop variable is x, but you're using i as the index

ahh… so I should change the loop to i

by the way, you should only declare each variable with var once

oh ok, thanks. I'll keep that in mind

var i; var i

undefined

hmm
I think I've seen Firefox complain about redeclaration, anyway

took out the extra "var" declarations and changed everything to i … the first image is being displayed correctly, but when I click "next photo" I get another undefined… this is handled in function next_photo_gallery() on line 23 of the same paste bin I posted a link to
oh… and that first image isn't be hidden like it's supposed to

hello
anyone here?

I see part of my problem in getting it to hide.. I'm not naming it correctly
…. i think

Is anyone interested in A Javascript Iframe and a CSS Job?
jordan5815 or PM me.

this is kind of a javascript question.. can javascript tell when a flash file has finished losding/started playing, or if flash can somehow execute javascript?

in javascript, when building a function, is it ok to "do something" with an argument, or do I have to define it inside the function locally as a var?
right now, I'm doing the second way… but it would really cut down on some uneccessary lines if I can do it the first way

what do you mean by do something
either way, even if you want to assign to the variable, you do not have to refine it locally.

such as stick it into an argument for another function called within the function
oh, that's great

does anybody here have trouble loading more than one script file into IE?

I read in some forum after googling around a little that after you put something into an array, load the document, and then issue something that "writes" to the document such as document.write(), that the array becomes reset.
Is this true?

I guess it depends on where the array is

Generally, if you keep all variables in the header tag as a global or in a function, you'll stay away from the document body.

well, I'm issuing a document.write() inside the document body - when a function is called. I guess I should just try to move that - and the array - into the actual function?

yeah

how do i rewrite this if the form is in an iframe? document.MyForm.submit()

Another option is to stay away from document.write(), and try to create and attach DOM nodes

ok… it'll be difficult with everything that I'm doing and trying to call, etc.. but I'll give it a shot
hmm… I'm still not very familiar with javascript - much less what DOM is (although I've heard of it)

Chat, you have to name the iframe, and then insert it as part of your call to the submit
so it would be document.iframeName.MyForm.submit() I believe, but I am not 100% sure

ok
and whats the function to fill a form value in that form?

For a certain field in the form?

yeah

MyForm.inputName.value = newValue;
document.iframeName.MyForm.inputName.value = newValue;
the second one

thank you
a href="" onClick="document.myiframe.theForm.submit()"submit/a
that doesnt wor
k
any idea? :|

it only works in IE

submitting the form?

IFrame is a complicted element to handle

or submitting the form in an iframe?

you can try "getElementById" to get the iframe

tried, didnt work
i guess i dont really need the iframe

this is very tricky because
iframes are interpreted and render at a different pace than the rest of the surrounding page

target attribute takes the name of the iframe right?

yeah

k
these iframes are making me feel so stupid lol, i never use them

this.iframe=window.frames[iframeId];
try this

nah i realized i didnt need the iframe

target the iframe

I think I'm realizing that I'm using quite a bit of uneccessary code… instead of showing and hiding divs, I can just show and hide the actual images (that I'm currently putting inside the div)

right, what you need to do is to set style attribute of the image

yup… that's what I'm working on now

had so many optional attributes

once I get my code whittled down, I'm going to try and put it inside the function instead of sitting in the document body

style attr is a very useful extension

yeh, no kidding
can I put an onLoad() call into a div declaration?
I got rid of the "img"divs, but I still need one of the divs for the design
…. and I need to populate that div with some initial data
(i.e. the first image)

let me think
I can't remember if div has a onload event, but I am sure that body element has such a method, perhaps you can add your code in there

I know the body does… I guess I could do that….

also, you can add your code at the end of your html

??

I've never heard of that.. never knew you could do it

yes, /htmlscriptyour code here/script

oh nice

wtf?
That's not going to validate
Anything you need to do once things have loaded goes in the window.onload event handler

oh ok

I'll have onLoad call that function

after racking my brains, I figured out a better way to do this… I'm not going to need the onLoad function, thankfully… that would've gotten way to messy and complicated for what I'm trying to do
if I have a global array in my script inside headscript/script, can I call values of that array in onClick()?
for say, a link or an input type button

of coz

cell?

phrame, do you really need tables, or can you use CSS?

i knew someone would say that

where output is the array

someday it will be all divs but not yet

heh. I know the feeling. I just got to that point this past spring… but seriously, if you can use CSS, then you can assign things an id, and use functions to write the text in there

wrong

negative

i am using css just for fonts and colors

you can't use output[i] in this way

ok
as far as I know, I don't think you can do it
what would you suggest?

wait a moment

k

document.getElementById('label1').innerHTML
works

nice
I remember using that at one point, but I totally forgot about it

cool but now i forgot what i was doing

?

why don't you just use an underscore or dash or something like "my-id"
(to answer your question, I don't know)

ok nvm.

I am back

wb

how about your question?
solved?

nope… I'm starting to google around

I think attr value can contain space
if you want to use output[i] as id, you can only do it in javascript, i think

ok, no problem…. I just thought of a solution…. I'll stick it into a php variable, and echo out the php variable as the id
because all I need is for it to be output once… after that, my javascript functions will be changing the values of the id by document.write()

hey lets kill meth heads

try this
script
document.write("img id='"+output[i]+"' style='display:block;' src='http://www.baidu.com/img/logo.gif' alt='blah'");
/script

inside html/html??

anywhere you want to place img element

ok

Can someone tell me why this works in IE and not in FF, please

http://paste.css-standards.org/21549/view
Please

I'm going to need to fix a couple other things, but right now I'm not sure if it's going to work

it seems a menu, but the source code is too long…

that actual logo comes up fine though…

stickto, talkign to me

 Business Web Hosting | Business Hosting

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

Leave a Comment

You must be logged in to post a comment.


Blog Tags:

Similar posts: