« first day (9 days earlier)      last day (4931 days later) » 

1:00 PM
@Raynos Well you can't fake much when the server checks, e.g. say your Warrior sends the commands to cast a fireball, obviously that won't work
 
Hi guys I downloaded jQuery UI, what files do I need to ship with my website in order for things to work?
The total size is 4mbs, so that seems a bit much for a user to download
Here's whats in the folder:
 
@IvoWetzel I guess so. Still i'm worried the front end will just be replaced with custom front ends connecting to my server
 
@SergioTapia jqueryui.min.js in the js folder
 
That's the only file I need to have on my site?
 
and maybe the css if you want to use a already made theme
 
1:04 PM
What about the CSS folders, and the images, etc.?
 
@SergioTapia and maybe the css if you want to use a already made theme
 
@Raynos Well there's not much you can do about that, but do you care? Unless they can cheat, which shouldn't be possible with the right design, I wouldn't care if they use my fancy frontend or write their own one with ascii graphics ;)
 
Ah thanks, I'll do that.
 
And of course, you need to add the action script in your page...
 
@Raynos You can still force them to use register
 
1:05 PM
like with all jquery script anyway.
 
Yep btw. I forgot what the code is for importing a script, is it: <script rel="scriptHere" />?
 
@Raynos Then you can supply some sort of authorization key to the server, but that needs some quirky logic between the website and the game server
 
@IvoWetzel Just dealing with anit botting seems serious
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
 
thanks
 
1:07 PM
@Raynos As for botting that depends on the type of your game I guess
Making the game simple and fun for humans, but hard and boring for computers is the challenge here I guess
You'll need to make sure that botting isn't rewarding
 
@IvoWetzel What about HTML5 Canvas and rendering efficiency? Is that an issue
 
Letting a bot mine ore the whole day long is easy, but unless all the ore is worth something, it's useless, so it comes down to game design. And I don't consider the need of farming to be good game design...
@Raynos Depends.... on the browser, on what you render, whether there's hardware acceleration available
For 2D tile based things, I would go with the DOM
 
Anyone know why the dialog doesn't show? pastebin.com/J1maswMd
 
@SergioTapia - document.write() == bad, in the <head> it's worse :)
 
Try $(window) instead of $(foo)
 
1:13 PM
@Raynos Still doesn't work when using window instead of foo. What could the problem be?
Maybe I'm not referencing the jquery library correctly?
My .html file is in the root folder, and the jquery.js file is in a folder called js. Did I set the path correctly?
 
@SergioTapia Did you try it in onReady() ?
 
@SergioTapia $(document).ready(function(){ $('#dialog').dialog(); });
Where #dialog is a selector matching the element you want to turn into a dialog box
 
I think you guys overlooked the commneted out code immediately above the .dialog() call :)
 
Hm...
 
@NickCraver Yeah, well they are commented for a reason :P
 
1:18 PM
Still isn't working... well I have a new answer on my SO question: He recommend doing something like: var popup = window.open("http://something","blablabla");
Then I have access to the calling HTML via popup.
 
@NickCraver if it wasn't commented out then sure, document.write would kill the loaded scripts
 
But I don't know how this fits in my context: pastebin.com/LA6xqf6t
 
Hmmm... I wonder if WolframAlpha still charges for the use of it's API
 
ok - cya
 
Looks like it Yi Jiang.
 
1:23 PM
@YiJiang - wolfram made some very poor legal decisions, I'm surprised it's still up
 
You actually make use of Wolfram?
 
Sad...
 
how do i select an anchor tag inside a span id ?
$("span#id_name a") didnt work !
 
they claimed copyright on all results coming back, because that sounded like a great idea
 
@Seidr It plots very nice graphs ;)
 
1:24 PM
True :)
 
@kantu Should work.
 
hi everyone
 
@MarcGravell - I fixed it while asking the question, it was indeed == vs a .Equals(), just 4 levels down in a call that the expression tree was visiting
 
@kantu put space after span make it: $("span #id_name a")
 
is there anyway to get the click functions on any event added by jQuery
 
1:26 PM
@Umair What do you mean by "on any event added"
 
Woot, it's a jQuery channel again here :)
 
@Umair You mean something like: $('#sayit-button').data('events').click[0].handler?
 
ur,,,, what i mean is that
$('#test').click(test_func);
now somehow i want test_func
want this to unbind it from the element
as we need the actual function for jquery to unbind it
 
@Umair it's test_func, you can unbind it
 
@AmrElGarhy thanks
 
1:29 PM
@Umair You can just call .unbind('click') if you want to unbind all click handlers
 
@Amr yes in thi scase I know what is is
but what about this one
$('#test').click(function(){alert(1);});
@yiJang does unbind.('click')
works the way u said
 
@Umair api.jquery.com/unbind - it does, yes.
 
coz i cudnt find so in the documentation
Ok i get it, thanks YiJiang :D
ok now how to change my profile and picture here on chat, :S
 
@Umair The profile images are handled by Gravatar: en.gravatar.com
You need to associate an image with your email address.
 
I posted this in the jQuery room, but I'll ask here too if you don't mind:

perhaps a simple issue, but if I want to select all divs that match a starting pattern in one statement. What I got so far is:

$("#page div[id ^= 'page']")

Can I do $("#page div[id ^= 'text'] | div[id ^= 'image'] ") ?
 
1:36 PM
@bakkelun interesting question, what about asking it on stackoverflow.com as well to be a good reference for others?
 
@bakkelun You can use $("#page div[id ^= 'text'], #page div[id ^= 'image'] ") if you want div with id starting with either text or image
 
Amr: Yes, I'm sorry.
Yi Jiang: I'll try it. Thanks!
@YiJiang You dear sir, are a saviour. Worked like a charm! Thanks again!
 
$("#greeting").text("hello!");
 
1:53 PM
hello
any docs about learning object related in js?
 
@hguser What do you mean by "objects related"?
 
www.jquery.com/docs ?
 
I guess he means object oriented.
 
Object oriented maybe?
 
1:56 PM
@bakkelun jquery < JS
 
I guess he means object oriented.//yes
 
@bakkelun Only if you think that jQuery is what he needs
 
What do you guys think of mixing Classical Inheritance and Prototypal Inheritance in the same app?
 
1:57 PM
Just give yourself some time to read it all. Don't skip everything to get to the examples
 
Eibx: I was about to link that ^^
 
(: Just proves it's a great link.
Or atleast a great read.
 
Well they have kind of sucky examples, but should fare well enough for the beginner.
 
@Gabriel There is classical inheritance in JS?
 
John Resigs Simple Inheritance is being used at my work place
 
1:59 PM
Yeah true. And I think they skip Constructors. Can't quite remember
 
Class.extends({...})
 
googled yet.. :( Too many I can not understand. I can not get away from the concept of object in java.
 
Quite note here. Java != JavaScript (:
 
@Gabriel That's all build on top of prototypes.
 
yeah I know, I guess what I was asking is if there are any advantages to mixing Class.extends() and Object.create() based on those classed objects
 
2:02 PM
@hguser MDC has a fairly comprehensive article on objects in Javascript: developer.mozilla.org/en/JavaScript/Guide/Working_with_Objects
 
Java != JavaScript (: I know this. But I can hardly change this when working with js.Once I see the constructor in js, I will compare it with java....:)
Thanks, I am saving all these pages,read them carefully tomorrow.:)
 
Ok - no offense. It's just easy to get confused. (:
 
also, for testing stuff real quick in javascript, you can use http://htmledit.squarefree.com
(not endorsed in any way).
 
Can anyone explain to me how/where jQuery stores metadata on objects?
 
@Greg It uses the .data function I think
 
As of the new release, it uses the HTML5 data- attributes, IIRC
 
.
 
both yeah
bound handlers are in .data("events") though
 
@YiJiang I see. Ok so I use the .data function to access the metadata, but how can I then create a JSON object of the object, with associated metadata in place?
 
@hguser On a related note. That's a smiley -> :) That's an opening paren and a colon -> (:
Just sayin'.
 
2:09 PM
@Tomalak @rchern (:)
 
@YiJiang *lol*
 
@Tomalak Psst she writes her smiles like this: (:
 
ha
@hguser and @Eibx and I seem to have y'all outnumbered (;
 
you are trying to change the direction we all tilt our heads after so many years?
 
@rchern Don't panic! whips out smiley reversal script Muhahahahaha!!!
 
2:14 PM
@Greg, if people actually tilted their heads, you might have a case...
 
in The Tavern (General) on Meta Stack Overflow Chat, Oct 17 at 14:50, by Yi Jiang
rsmiles = {
	'\\)': '\\(',
	'\\(': '\\)',
	'o': 'o',
	'O': 'O',
	'd': 'p',
}

reyes = [';', ':'];

rnose = ['', '-'];

$(".signature:contains('rchern') ~ .messages .message .content").each(function(){
	var $this = $(this);
	for(var i in rsmiles){
		for(var l = 0; l < reyes.length; l++){
			for(var j = 0; j < rnose.length; j++){
				var permute = i + rnose[j] + reyes[l],
					replacement = reyes[l] + rnose[j] + rsmiles[i];

				$this.html($this.html().replace(new RegExp(permute, 'gi'), replacement));
Fiend! I have you now!
 
@rchern I think we do on a subconcious level
 
i don't get why people make such a big deal about it
shrugs
 
Oh god. Backwards smileys. Oh god someone actaully wrote a reversal script. Seriously do we have nothing better to talk about?
 
@Raynos you could talk about how to get a JSON object for a custom object that has jQuery metadata associated with it, without losing the metadata details?
 
2:19 PM
@Raynos (;
 
@rchern We identify thoughtcriminals, radicals and non-conformists by the direction of their smiles. You shall now be taken to the Ministry of Love to be interrogated by the Thought Police
 
jquery metadata as in the metadata plugin or as in fn.data ?
 
@Greg Shouldn't .data() with no arguments give you an object with all the metadata attached to the element?
 
@Raynos metadata plugin .. I asked a question here: [stackoverflow.com/questions/4015297/…
 
> The people on Meta are little crazy. Actually, they are very crazy.
Don't you know!?
 
2:23 PM
to confirm plugins.jquery.com/project/metadata or jquery .data ?
 
@YiJiang, it does, anything that's stored in it at least
 
@YiJiang Ooow... I just unicornified the chat page...
 
I am trying to find "weather user has selected entire document or not ?"
 
@Raynos .data - I'm using jstree, and in the docs for it, it says metadata can be associated to nodes by using .data("jstree")
 
oops
 
2:25 PM
@Golmote That's the spirit!
 
@YiJiang It removed event handlers... ?!
 
I am trying following code - for getting selection. var range, sel;
var selObj = window.getSelection();
var selRange = selObj.getRangeAt(0);
var startRangeNode = selRange.startContainer;
var nodeTypeOfSel = startRangeNode.nodeName;
 
@Golmote Hmmm...?
 
but how to identify user has selected entire document or not ?
 
@Greg var json = jQuery.jstree._reference(tree).get_json();
json.HereIsData = jQuery.jstree._reference(tree).data();
then stringify it
Talking of jstree why does "select_parent_close" : false still deselect child nodes when I close a parent node
 
2:28 PM
@Golmote It shouldn't. All the code does is to replace the src attribute of all images on the page that matches a regex with a link to their unicornify counterpart
 
@Greg @Golmote @Gabriel @rchern @Raynos @RandallKwiatkowski - what to do - if I want to find out weather user has selected entire document or not using javascript ?
 
$jq('img').attr('src',function(){return%20this.src.replace(/\w*\.gravatar\.com/i,'unicornify.appspot.com');
 
@YiJiang Once the page is unicornified with the bookmarklet, chat buttons like send button or answer button don't work anymore.
 
@sugar the weather is sunny today
 
oops my mistak
 
2:29 PM
@Golmote Mmmhmmm... not possible... how does it do that?
 
mistake
 
@YiJiang I'm investigating now
 
Do you mean detect if someone used select all on the page?
 
@Ray
@Raynos yes same
@Raynos - I tried this one. var range, sel;
var selObj = window.getSelection();
var selRange = selObj.getRangeAt(0);
var startRangeNode = selRange.startContainer;
var nodeTypeOfSel = startRangeNode.nodeName; but it gives selection first node & selection last node. I'm confused here.
 
jQuery vs. Prototype
 
2:30 PM
I cant see how you could detect that. Why do you need to know this. There may be a better solution
 
@Braveyard - dems fightin words
 
:)
 
@Raynos - in safari - iphone browser - sometimes selections
 
I know I hate asking these kind of questions after there are a lot of debates around web already
 
i will give prototype this, even though I (and some of it's core team) disagree with it's overall direction/implementation
 
2:32 PM
Is there a way to create JavaScript API to control the embedded video players even though the host doesn't provide one. Example, cnn doesn't have javascript api for their video, is there a way I can create the api to control it?
 
I think it's because of jQuery.noConflict()
 
Prototype is the most appropriately named JS library
 
hey people have you tried Appcelerator
 
I think it's because of jQuery.noConflict()
 
with which you can create cross platform app with javascript
for iPhone,Android, Windows, Linux etc.
 
2:33 PM
iphone only
 
if you did, can you share your experiences?
was that good, amazing, sucks?
 
every thing :)
 
Because I want to dive into that area
:)
 
each has it's own pros & cons
 
@Raynos Just tried the code you suggested, it throws the error: Property 'data' of object #<an Object> is not a function
@Raynos please could you reply to my SO question for rep. points? [stackoverflow.com/questions/4015297/…
 
2:35 PM
@YiJiang Using jQuery.noConflict(), the bookmarklet seems to "remove" the $ variable... And then the chat raise plenty of errors ^^
 
@Raynos - what to do - for detecting "has user selected entire document or not ? "
 
@Golmote Actually, I don't even know why that bookmarklet is loading jQuery just to do that
@balpha -1
 
Hello :?
 
@YiJiang x) neither do I
 
@sugar Hey, I just accidently the whole JavaScript book, what to do?
 
2:38 PM
what bookmarklet?
 
@rchern Unicornify
 
@Greg - I didn't get you.
 
@sugar I accidently the whole book!
 
i've seen it (:
 
2:40 PM
var img = document.getElementsByTagName('img');

for(var i = 0; i < img.length; i++){
    img[i].src = img[i].src.replace(/\w*\.gravatar\.com/i,'unicornify.appspot.com');
}
There, no jQuery
 
@YiJiang whatcha blaming me for? As you see in the post revision history, I didn't write it :)
and I have no idea where this is from:
13 mins ago, by Yi Jiang
$jq('img').attr('src',function(){return%20this.src.replace(/\w*\.gravatar\.com/i,'unicornify.appspot.com');
 
@balpha Well, if I rewrite it so that's it's shorter and better do I get the credit? :P
@balpha That's erm... from your bookmarklet
 
I'm developing a off-line web-page for iphone safari.
basically used for highlighting the selected text. but I don't want to allow user to select entire document & highlight. that's it.
 
@YiJiang oh, you're on the actual homepage
wow, I didn't even remember that that one had all this cruft in it
it's from here:
7
A: My God—it's full of unicorns!

ArjanSome sites use things like 0.gravatar.com -- at least the homepage of www.gravatar.com itself does. The following change handles that, also ignoring the case: replace(/\w*\.gravatar\.com/i, 'unicornify.appspot.com' And now that unicornify.appspot.com is a true web site, maybe add the Greasemon...

 
javascript:(function(){var img=document.getElementsByTagName('img');for(var i=0,l=img.length;i<l;i++){img[i].src=img[i].src.replace(/\w*\.gravatar\.com/i,'unicornify.appspot.com');}}());
3
Hm... code isn't syntax highlighted in the chat messages ?
:(
 
2:48 PM
@Golmote It isn't. Also, remember that prettify.js can't handle compressed/obfuscated code very well
 
@Golmote: nope.
 
Well it should be ! x)
 

Chat feedback

Problems with chat? Let us know...
 
@YiJiang ^^
 
This has to be the 4th time this month someone has edited my answer to change "falsy" to "false":
1
A: jquery: what does this mean?

Nick Cravera is an object in this case, it's setting the .fkey property on it if it isn't set (or is falsy) already. For SO chat, this allows the fkey input to either be provided or gotten from the page, it's a hidden input at the bottom of your page, populated with a value used to authenticate your reques...

 
2:55 PM
@NickCraver Eh... why are you typing falsy :P
 
Might be automated SO bot
 
Just noticed MDC's compatibility implementation of Function.prototype.bind declares 'use strict' at the top of the function. That's the most pointless line of JS I've ever seen and I just referenced it in an answer :<
 
0
A: Javascript Class + Properties not sticking to their values

Andy EWhen a method belonging to an object is called using dot notation, its context (where this points to) is the object that it's connected to. For example: // Context: `this` is `myObj` myObj.myMethod(); However, when you store a reference to that function in a different variable, it loses that ...

 
falsy! Isn't that crockford>!
 

« first day (9 days earlier)      last day (4931 days later) »