Help Logs Database

Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Ircnet  |  Dalnet
Page: 1 2 3 4 5 6 7 8

<kosh[-1]> i'm preparing a pastebin with the entire page source, might help
<rajesh> ok
<BarnacleBob> k
<Burninator> do a while loop through the nodes of an element, and delete each
<frb> that's still a hellal lot more code than innerHTML
<frb> even the DOM Tree in FF shows innerHTML
<BarnacleBob> in firefox can i trap someone hitting the back button or backspace (navigate backwards in the history). i am using an AJAX style framwork for navigation and that is just detrimental as it kicks them out entirly. any one know?
<kosh[-1]> http://pastebin.com/397632 the script block begins at line 505, the text areas being ignored are lines, 531 and 532, the script where I attempt to find the tags is at line 542
<Burninator> frb: right, and it *works*, but it's bad practice
<rajesh> BarnacleBob: http://contentwithstyle.co.uk/Articles/38/fixing-the-back-button-and-enabling-bookmarking-for-ajax-apps
<rajesh> dont know if that's useful or not.
<frb> it's better than insertAdjacentHTML :)
<BarnacleBob> rajesh, sounds usefull i'll check it out :)
<kosh[-1]> yeah, so anyway, my page outputs the name and id of each textarea to a textarea it knows (suprise suprise, the one it finds)
<kosh[-1]> but I am surprised itdoesnt find teh rest, a simple text search show them there
<BarnacleBob> uhhh thats kinda wiered
<BarnacleBob> is there a page where i can try this?
<kosh[-1]> BarnacleBob: talking to me?
<BarnacleBob> yeah sorry
<kosh[-1]> hmmm, it's on a blog page and it's p***worded
<kosh[-1]> I'll reset the p***word, nothing there anyway
<BarnacleBob> k i'll just paste it onto my server
<kosh[-1]> naa wait, I'll just open it up, since it's an empty blog, can't do much with my p***word, since I'm not admin
<kosh[-1]> barnacle bob, http://kosh.kmem.org/blog user:p***=kosh:abcdefg
<kosh[-1]> I'm hoping everyone doesnt rush in and try to hack me out, I've got level 5 thunder here and I'll kill the entire thing if I have to :)
<dmarien> hey guys
<kosh[-1]> BarnacleBob: so yeah, if you click login and use that, you'll find in edit, a blog
<kosh[-1]> BarnacleBob: with me?
<BarnacleBob> i just copy and pasted it :)
<kosh[-1]> lol
<BarnacleBob> but ughh since its just a <script> block i cant tell the debuger to break on it
<dmarien> quick question: i'm using php, to output some javascript and html... in my onMouseOver="" javascript, the content is generated from php... and it contains newlines... if i put the contents of onMouseOver all on 1 line then it works... i can't use php's nl2br because i dont want newlines, i just want them ignored... any ideas?
<fatbrain> *yawn*
<fatbrain> dmarien: stupidPHPString = str_replace("\n", "", stupidPHPString);
<kosh[-1]> BarnacleBob: well it's weird, cause if you look at the page source, they are clearly there
<fatbrain> dmarien: And it's onmouseover (NOT onMouseOver)
<BarnacleBob> kosh[-1], it is definatly looping over it and it definatly fetches all 3 textareas
<BarnacleBob> not sure if its looping the right # of times tho
<kosh[-1]> really??
<BarnacleBob> trying to get back to it real quick
<fatbrain> bah!
<BarnacleBob> kosh[-1], got it
<BarnacleBob> for(a=0;a<ta.length;ta++){ change to for(a=0;a<ta.length;a++){
<kosh[-1]> ****!
<kosh[-1]> I can't believe I did that
<BarnacleBob> hehe :)
<BarnacleBob> i couldnt see it for a bit
<Daveman> heehee, silly javascript :p
<fatbrain> JavaScript isn't silly
<fatbrain> -end of story.
<guido_w> fatbrain: ...
<guido_w> ;)
<frb> it's not silly, it's insane
<frb> and HTML is worse
<guido_w> lol
<fatbrain> guido_w: ;)
<frb> it turns out that <input type="image"...> really means <input type="submit">
<BarnacleBob> lol
<guido_w> frb: might well be... the default behaviour of a <button> element is also to submit the form
<frb> holy hell I hate IE
<frb> I have 8 friggin windows open now because it has no tabs
<fatbrain> I like how Microsoft is trying to turn IE into Firefox ^^
<fatbrain> I did give IE7beta a testspin
<fatbrain> (and I didn't like it)
<guido_w> like with Mac-OS, they try to copy but miss the essence
<fatbrain> yeah, tho they are making another go for it, in Longhorn
<guido_w> you mean the transparency? yeah, screwing that up quite badly too
<frb> once I get everything else installed, and my wrt54g fix0red, I'll install FF and Slimbrowser
<BarnacleBob> damn its looking like i can not trap the navigate away event
<BarnacleBob> (if there is such a thing)
<frb> BarnacleBob: not reliably
<frb> you _could_ catch onounload, but some browsers don't trigger that on back/forward navigation
<BarnacleBob> hrm
<BarnacleBob> lets test
<frb> opera is notable for that
<BarnacleBob> this site is firefox only so no big deal
<frb> then it might work
<BarnacleBob> i'm 99% sure people will be iritated for a while till they learn not to click back so i'm trying to kill it off
<guido_w> BarnacleBob: the navigate away event? you using 'onbeforeunload'?
<BarnacleBob> its an intranet app using ajax style stuff
<BarnacleBob> guido_w, never heard of it
<frb> the other option is to use window.open and kill their navigation buttons :)
<BarnacleBob> lol kinda a hack man :)
<guido_w> BarnacleBob: it has IE origins, but is implemented in FF and Moz (since 1.4 or something)
<frb> BarnacleBob: if it's a custom webapp, why not?
<BarnacleBob> i think onbeforeunload will work nicely
<timr> I am creating new elements using JavaScript, and giving them and ID. Is there a way that I can remove them easily also?
<guido_w> BarnacleBob: onbeforeunload will let you cancel the navigation entirely, onunload won't (actually the Moz guys didn't want to implement it at first because it's somewhat rude to interrupt user actions, but they have in the end)
<BarnacleBob> yeah i figured it would be impossible based on that alone
<BarnacleBob> but there are instances where its usefull
<guido_w> BarnacleBob: good luck anyway, i'm off
<BarnacleBob> hrm
<BarnacleBob> how do i abort it
<BarnacleBob> return false didnt seem to work
<guido_w> for IE: set event.returnValue to false, for Moz: call event.stopPropagation()
<BarnacleBob> ah thanks
<frb> who what?
<fatbrain> BarnacleBob: return false; ususally works when you want to disable the default behavior
<fatbrain> if it's an inline event handler you have to be sure you return the value returned from your eventhandler, e.g. onclick="return myEventHandler(this, event);"
<BarnacleBob> oh right!
<BarnacleBob> i forgot about that :)
<frb> fatbrain: how does one do that with addEventListener?
<frb> does the second argument have to be "return whatever()" or is there a better way?
<BarnacleBob> lol
<BarnacleBob> there is a message that comes up!
<BarnacleBob> stop propagation dosnt seem to work
<BarnacleBob> but return false asks me
<BarnacleBob> well i'll have to settle for that
<enygma> this_item=xmlObj.respon***ML.getElementsByTagName('item')[i]; alert(this_item.firstChild.data); would that be right for: "<root><item><title>this</title></item></root>"
<enygma> (where "i" is the var in the loop)
<fatbrain> BarnacleBob: You just return false from the eventhandler function if you'r using addEventListener / attachEvent.
<fatbrain> (iirc :S)
<BarnacleBob> i just used the <body onbeforeunload> does doing it that way ask a question?
<BarnacleBob> fatbrain, i'm not even sure how to do it that way. any short examples so i can test it that way?
<BarnacleBob> lunch time i'll be back in a bit
<fatalis_> OOGA BOOGA
<fatalis_> don't use inline event handlers
<fatalis_> I know how to use wget, I am the most leet
<kojiro> Can someone please explain this line to me? x[len >> 5] |= 0x80 << (24 - len % 32); // the mod operator I understand, are the >> <<'s bit shifts? what's the |= ?
<frb> kojiro: bitwise or between the lvalue and the rvalue
<frb> so a |= b --> a = a|b
<kojiro> and the << and >> are shifts?
<frb> yes
<Burninator> javascript has bit shifts?
<kojiro> danke schon
<frb> of course
<frb> kojiro: bitte
<kojiro> now I gotta figure out how to do this in coldfusion <shudder />
<daaku> can anyone point out some advantages to using DOM methods to create/append nodes as opposed to writing to innerHTML?
<frb> dom methods are cleaner, and easier to manage
<frb> with innerhtml it's too easy to create bad html and bust your page and not tell why
<daaku> ok, fair enough
<frb> I've only used innerHTML for plain text anyway
<daaku> the only reason i ask, is because i'm writing some stuff where it seems like the create/append methods take up like 75% of the code
<BarnacleBob> functionize it?
<daaku> its just like create span, set cl***name, create strong, bla bla bla
<BarnacleBob> i use .innerhtml because in essence i'm using a div as a frame almost. so using dom is not possible
<daaku> BarnacleBob: it is, well, as much as i think possiblie
<daaku> brb
<BarnacleBob> *shrug* ;)
<frb> it's possible
<BarnacleBob> frb, no its not
<BarnacleBob> its really not the way i set it all up. if i changed how the whole thing worked and made it far more complex than it has to be then it could use it but not this way :)
<frb> anything is possible
<arguile> Here's an 'interesting' issue. Has anyone else encountered the fact that object.attachEvent("event", formControl.click); ceases to work in IE > 6.0.29?
<arguile> It worked fine in 5.5.x -> 6.0.23. Other than creating a closure spawning function does anyone have any ideas on work arounds?
<arguile> ie. overloading the proto for inputs of something of the like? Changing this entire code base for what looks like a transitive bug isn't my idea of fun ;)
<fatbrain> arguile: You'r fubar
<arguile> fatbrain: ?


Return to javascript
or
Go to some related logs:

wow the emissary tactics
lambdabot
football
c++

Copyright © 2005 www.irclogs.ws. All rights reserved. » disclaimer » contact