« first day (12 days earlier)      last day (4950 days later) » 

7:03 PM
I need a bit help regarding orientationchange event
 
7:14 PM
@bhups There for a minute I thought you were talking about something not computer related
 
@sworoc lol!! :)
 
what specifically are you looking to know, I've never worked with it, I just Googled it
 
in android browser this events gets fired continuously on just one orientationchange
so how interchangeable are orientationchange and resize events?
 
Looks like it should only fire once every 90 degree rotation
 
yes, but thats not happening
I wrote a very simple html
 
7:20 PM
I would not say that they are interchangable events
 
<html><body>
<script type="text/javascript">
window.addEventListener("orientationchange",function(){alert("test");},false);
</script>
</body></html>
 
users on the desktop will resize the window, but will never change orientation
if it's a mobile only site, you may be able to get by with them being interchangeable events
 
and viewed it in android browser, it loads fine but as soon as I change the orientation then I keep getting "test" alerts continuously
 
that seems unexpected to me, what happens if you prevent default from happening on the event
 
so in other words resize is superset of orientationchange!
I can try that
 
7:23 PM
I would think that is true, but I have no specific knowledge of orientationchange
 
How can i make this run each 60 seconds
$.ajax({
type: "POST",
url: "imback.php",
data: {
mode: 'ajax',
getUpdates: auto,
},
success: function(msg){

alert('ok');
}
});
 
wrap the entire thing in a function
 
no luck :(
 
@user457827 then do this:
setInterval(makeAjaxPost, 60);
@user457827 where makeAjaxPost is the name of the function that wraps that code
@bhups sorry, not sure what else to try
 
@sworoc thanks anyways :)
 
7:26 PM
best of luck
 
Hmm
i heard something of timeout
 
timeout will do what you want, one time
 
and i dont have an single function for the ajax call only
 
interval will do it every so many seconds repeatedly
 
oh
how can i do setInterval without a function?
ok i made a function quick
 
7:28 PM
setInterval(function() {
$.ajax......
}, 60);
 
(Sorry to ask this here, but the CSS room is super-dead) I'm trying to mask a div, using the overflow:hidden style, and the contents of the div are generated at runtime through JS; a bunch of <img> tags. It isn't hiding anything though. Does the overflow:hidden style work for <img> tags inside a div, created through JS?
 
try ask a question on SO
 
I will if no one here has any ideas :)
 
I doubt.... 3 active, you me and sworoc.
 
@debu does the element also have a height set?
 
7:39 PM
Yup
Both height and width
 
And you're setting overflow:hidden on the <div> and not the <img>s, correct?
 
@user457827 did the setInterval work for you?
 
@Zack: Yeah
 
I was wrong about 60, that is in ms. It should be 60 * 1000
 
@sworoc haha
@sworoc just found out, because i got lagged then i checked firebug, and it spammed it with server calls
 
7:43 PM
@user457827 Doing too many things at once :)
 
@sworoc hehe, i understand. But it works well thank you
 
you are welcome
 
@debu Seems strange, does this work correctly in your browser? jsfiddle.net/mBLYz
 
That's how the code looks after JS generates the img tags
Yeah that Fiddle totally works
 
@debu But this doesn't: jsfiddle.net/mBLYz/1
It's the position:absolute;
 
7:48 PM
Of the img tags?
 
Yes; add position:relative; to the containing <div>.
You want to position the <img>s using coordinates relative to the container, right?
 
Ok lemme try. Do I have to remove the position:absolute from the <img> tags too?
 
No, try just adding the relative to the container first.
You'll see what I mean here: jsfiddle.net/mBLYz/3
 
Ha! Thanks a lot Zack, that totally fixed it :)
 
Whee!
 
7:51 PM
You Tha Man :D
That JSFiddle site is super-sweet too
Too clever for its own good
 
without pushing this into firebug, whats the result of this ?
{{![true, false][+true, +false]}};
winner gets 100 points !
:p
 
true?
I really have no idea, lol.
 
syntax error :p
 
haha :) good answer, but no syntax error there
 
7:55 PM
false
But I cheated :)
 
bingo
 
well ![true, false] should be false
 
actually its indexing the array [true, false] with [1,0]
because +true and +false is casted into integers
 
ah
 
and that result is negated by !
the outer brackets are just for the show business
 
7:58 PM
where did you get the terrible idea to do that?
 
from a mad place :p
I guess I'm still remembering a javascript quiz from james padolsey
where something similar was a question
 
what position is [1,0]
second row, first column?
or is it addition?
 
8:56 PM
hmm with my ajax onblur, with interval 35seconds, why when i try then focus back, it keeps sending ajax calls each 35 seconds even when its not onblur anymore
How can i fix this?
 
you want to stop the repeat?
var handle = setInterval(fn, 35 * 1000);
clearInterval(handle);
 
Thank you
How do i css in jquery
$('#notifications').css(
'color: #000';
);
this isnt right
@sworoc you there :P
 
.css('color', 'blue');
 
... or .css({ color: 'blue' });
 
browser died on me
 
9:08 PM
Yeah.
Beat me to it.
 
thank you
like how nice it is to work with jquery
 
it is an amazing tool, very well thought out
 
you can do amazing stuff when you know it like you guys hehe
even facebook uses jquery :P
How can i check if success(msg) is not empty
 
is msg a string?
 
ajax response
 
9:12 PM
So... when you do
`.click(function() { ... })`
It passes the event to the anonymous function you just created. Does it pass anything for
`.each(function() { ... })`
 
msg.length > 0
 
Backtick fail.
 
@Bacon yes, the item will be this
 
...So yeah, add "why did my backticks fail?" to the question.
 
not sure, I guess chat is different
 
9:14 PM
So do I need to say
.each(function(this) { ... });
To access that 'this'?
 
function(index, element)
no, you can use "this" without a param:
function() { this.toString() }
 
thanks sworoc
 
@Bacon the .each() thing passes you the element as the second parameter, and also binds it as "this"
 
Yeah, thanks!
 
no problem
 
9:16 PM
Ty for the clarification pointy.
 
How are facebook able to respond so fast back when anotherone comments in the wall.. you know these small notifications boxes/and or in the top where it says 1,2.5....
do they send so many ajax calls
 
@user
 
I would guess that they check for updates via ajax every 10 seconds or so, but I'm not positive exactly how they do it
 
@user457827 probably using push methods
 
insane.. and thats for millions of users
@greg how does that work?
 
9:24 PM
@user457827 server can ask for updates, but the request never gets returned until there is actually a response.... rather than saying "is there some data for me? no. is there some data for me? no. is there ....." it will go like this: "tell me when there is some data ......................................... here it is!"
 
a.k.a. reverse ajax, afaik.
 
@user457827 the main drawback to using push is the number of open connections on the server at any given time, although newer approaches like nodejs seem to handle this much better
 
@greg hmm
@greg i always thought that was impossible to do so?
@greg let me get this rihgt
@greg so you mean that you dont make any checker each xx seconds(ajax call) or each page load, but the server itself can check, and when there is something it informs you
@greg sounds unrealistic.. how should the server know?
 
it's like this chat
you ask a question, but don't receive an answer until the "server" is ready
in the case of Facebook, the "answer" is "somebody just posted to your wall"
so I send the wall post to Facebook with an ajax call
 
yes i know, like an ajax response
 
9:32 PM
meanwhile your browser has already sent a "who has posted on my wall" request, which doesn't return until the server gets my post
a request could sit there for 30 seconds or so without returning
 
you send wall post to user2, user2 have a ajaxcall with a interval 10 sec, that checks for new wallpost, and if theres any new display it in the popup. That's how i always think was the only way to code such
am i right?
@Bacon the .css() doesn't work in IE?
 
10:07 PM
It should! jQuery is generally pretty crossplatform/.
Gtg!
 
wow i hate blackberry development
:(
 
Hey guys. I want a button above my textfield to either wrap my selected text with text/tag, or insert some text where the cursor is at. Does jQuery have any selectors or functions that can help me with this? I can't find anything about this on SO, even though I'm sure I've seen it there beforeā€¦
 
10:23 PM
@Eikern textfield? you mean textarea or input?
 
can anyone help me out with a regex... need it real quick :D it needs to allow only letters, numbers, spaces, commas and periods
 
@Greg caps?
@Greg i mean.. case sensitive?
 
/^[0-9A-Za-z ,.]*$/
 
@tpae case doesn't matter
 
might want to use \s instead of just a space
 
10:26 PM
thanks guys! knew I could rely on you :D
 
@Greg i usually use this website: gskinner.com/RegExr
 
cool thanks
 

« first day (12 days earlier)      last day (4950 days later) »