| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8
Comments:
<0> Munter, eg. var f = new foo( 'something' ); var b = new bar( 1, 2 ); <1> How do people usually get a hold of the right window object in javascript? <0> with the right code <0> Elaborate please <1> I have a website with several frames, I want to get a hold of one of themm <1> there's a separate window object for each frame, right? <0> document.getElementByID( 'some_id' ); <0> ? <1> Munger: so "window" objects are children of document? <0> What do you mean by 'window' object? You have frames within a document? <1> Munger: as in window.foo. I need to access a javascript function foo. Yes frames within a document <0> So document.getelementById( 'id' ); should get it if each frame has a uniques ID <0> A frame is just another DOM object <2> Munger: the bar constuctor can just have a new foo('string'); line? <0> Munter, That's what I'm asking <1> hm...so what is this "id"? Is this a property of html tags? Is there a way of getting right "window" if no "id" tags are used?
<0> Munter, I use an Extend() function i got from somewhere or another to help with subcl***ing <2> Munger: That Extend function probably leaves the old constructor accesible. Use that to supply the string as argument <0> YaroslavVB, <iframe id="myframe1"> hdshjkdhsjkd </iframe> <0> Munter, It does, but I'm not sure of the syntax for calling the parent constructor. <0> trying to pastebin it but pastebin.com is hosed <2> Munger: pastebin.parentnode.org <1> Munger: so if the frame doesn't have "id" tag, is there a way to get a hold of it? <1> it looks like this http://rafb.net/paste/results/b7voZZ78.html <3> The paste b7voZZ78 has been moved to http://erxz.com/pb/1679 <4> how do i create an using createTextNode? <5> lol <0> Munter, The basic stuff is here http://pastebin.parentnode.org/536 <2> Munger: i think you can access is with this.supercl***.constructor <0> Munter, Right. It's a bit confusing really. How would the super-constructor normally be called if I don't do that though? It's a mystery to me :-) <2> Munger: To be honest I am not that good at this part yet. I also just found an inherit function and used it <2> Munger: However I ahve some real clever guys in #javascript on quakenet that probably can tell you how it works. Dont know if anyone is alive at this hour <0> Munter, I'll figure it out. This OO stuff in JS really is a bit of a fudge though, isn't it. It works, but what a palava :-) <2> Munger: Indeed :) <6> i dont suppose js has any built in base64 encoders? <5> how do i log into the firebug console ? <0> Log i? Just click the green tick mark in the bottom right of the window <5> ? <5> i want to log to the firebug console from my code <0> ah. I thought you were trying to 'log in' ? Wondered what the hell you were talking about :-D <5> everywhere i look it says its easy but no one tells you how <0> chino[dev], http://userscripts.org/scripts/show/3964 <0> That might help <5> printfire(); <5> tahts didn't work <0> I nevre tried it. I have my own logging panel that works on all browsers <0> It's based on something from yui <0> chino[dev], http://encytemedia.com/blog/articles/2006/05/12/an-in-depth-look-at-the-future-of-javascript-debugging-with-firebug <0> console.log('width: %d height: %d', width, height); <4> in safari, the keyCode for left arrow is 63234 but in firefox it's 37, is this a bug or am i doing something wrong? <7> how do you keep text input saved without using a form <7> variables <7> like google does <8> imsorry: wha? <9> imsorry, google just sets the input box to the q variable in the get string <10> hey, if I need to create a date from a string, how is the best way to do ? the format is yyyy-mm-dd <9> regex? <8> the best way? <8> new Date() =P` <11> imsorry: you'll most likely need to use some kind of server-side technology to do that <10> gah, what I hoped to avoid <9> that is the easiest way, but it is nor required <9> not <9> you can read the url in javascript <12> TheDeathArt: what are you using this date for? <9> read out a get variable <9> then fill the inputbox <10> GarethAdams to initialize a Date object ;) <10> that's used in a lib <10> and new Date(2006-06-24) don't work, so i'll need to parse it <12> Jo-W: the question's pretty much null anyway. "text input" needs to come from some kind of form element, unless someone writes a visual keyboard for users to click on <12> so "text input ... without using a form" isn't possible <10> so I need to parse 2006-06-24 over in the correct form, the good part is that the format is always like this <12> TheDeathArt: you can use substr then <12> year = date_string.substring(0,4) <10> hmm, true <10> works :p next question: how to write a singleton cl*** in javascript :D
<1> I have several frames in a window, none of them use "id" tag, is there any way to get a hold of a particular frame? <1> IE, is there a function that lists all objects of type "window" for instance? <8> window.frames <8> :) <8> collection, you could check their .src or location.href <8> to see who is who <8> if (/ducks\.html/i.test(window.frames[i].location.href)) ... <1> ah cool, thanks <1> it says window.frames is "[object Window]" how can that be? <8> correct <8> I said it's a collection :) <8> ohh <8> object window, meaning, you don't have frames or something <1> ok, I guess it's a colleciton <1> I just didn't expect window.frames to be the same type as window.frames[0] <8> it isn't <1> I can do window.frames.location.href, and I can do window.frames[0].location.href <8> .. <8> that means you may have only 1 frame <1> no, I can also do window.frames[1].location.href, window.frames[2].location.href and get different url's <8> and the browser is (in)correctly returning it upon calling the collection <8> I'm ***uming IE? <1> Firefox 1.5 <5> if(!(defined(args) && defined(args.attrs) && defined(args.parent))){return false}; <8> eh <8> well <5> anything wrong iwth thT ? <8> YaroslavVB: nothing really new often, window.location is NOT an url, is often used to get the url though, but per standard in js, window.location when used as such, calls on the actual property with the url, which is window.location.href, so <8> chino[dev]: the if (.... is never closed by a matching ) <8> as for the &&, they look good <1> Comand: what I don't get is why window.frames behaves the same as window.frames[0], is is window.frames some sort of "root" window? <8> YaroslavVB: nothing really new often, window.location is NOT an url, is often used to get the url though, but per standard in js, window.location when used as such, calls on the actual property with the url, which is window.location.href, so <13> can anyone tell me the name of the film that is on tv now? (eddie murphy or someone? ) <8> sorry, I'm not eddie murphy, so I guess I'm out of the trivia :| <1> Commander: what about if I have several browser windows open? <8> ok <8> then, I'd conclude you have several browser windows open :) <5> var defined=function(ref){typeof(ref)!='undefined'?true:false;} <5> anything wrong with that ? <13> I always thought it was typeof ref <13> no brackets <13> not sure <5> its optionaly <13> ok <13> you probably want a return <1> CommandPrompt: I meant, how would I get a hold of a particular frame if I have several browser windows...is it same technique? <13> sorry I have drunk a bit not really sure <13> chino[dev], that function is not doing anything <13> you want it to return true or falso <5> yes <5> oh duh <5> ok <12> putting brackets in is like doing (5)+(7) <12> i.e. pointless ;) <14> Wait, now ( and ) are called brackets too? Holy cow, can't we have one name per symbol? <8> YaroslavVB: ... <8> YaroslavVB: the way you'd do it, is by means of using global variables upon child window creation :) <12> Nanobot: one symbol per name would be better <14> For me, "[" = bracket, "{" = brace, "(" = parenthesis. End of story <8> YaroslavVB: var myglobal=window.open('child.html'); then you address it by means of myglobal var :) like -> myglobal.document.body <5> var emptyHash=function(hash){return for(var p in hash){return true} || false;} <0> chino[dev], Get the logging working? <5> yes! <5> thanks... <5> duh thats stupid <5> var emptyHash=function(hash){for(var p in hash){return true};return false;} <5> thats it righ t? <8> ... <8> well <8> depend on what 'right' means :| <5> duh <5> the boolean is backwards <5> if emptyHash() <5> the booleans should be swapped
Return to
#javascript or Go to some related
logs:
#php thundercity font can ndiswrapper ne used to install webcam drivers suse 10.1 Dependency Resolution Failed Resolver Failed #math mysql longest prefix StartListening: Unable to bind socket Permission denied. maplestd2e ubuntu java swig iterator #lisp
|
|