« first day (19 days earlier)      last day (4945 days later) » 

9:00 PM
Please help me, sorry if im wannabe but i am open to learn
 
start by reading the API I linked you:
2
7 mins ago, by Nick Craver
http://api.jquery.com/jQuery.ajax/
it can tell you much more much quicker than I can, with examples
 
@Johnson the request is made to a server, it's the server that would test for the header ... the client's don't often GET a request IN.
 
@drachenstern that just made me more confuse
 
Then you're going to have a dickens of a time with what he's trying to help you with
 
@NickCraver beforeSend?
 
9:02 PM
I give up
 
@drachenster "the clients dont often GET a request IN" what should this mean?
ok f this sorry for disturbing you
 
it means client's don't get requests, servers do
 
I just mean that clients don't get requests
it's a request for a reason
 
I know?
 
when you go eat in a restaurant, do you go to the kitchen and get the food?
does the cook come to the table and tell you what you are eating?
 
9:04 PM
I don't mean to be rude, but this is an honest observation: you need to learn the basics how how HTTP and JavaScript works before trying to put it all together, you'll be much better off knowing at least some of what's underneath
 
but what has this to do with X-Requested-With and XMLHttpRequest?
 
when he says "the request will contain" then you can know that the server is the one receiving the request
@NickCraver I feel your pain
 
@Johnson - point #2: google is your friend, you could have found the answer on any of the top 40 results here: google.com/…
 
wow pain? How did you guys started, i have noone besides me in real life and never had about programming..
 
use google before asking, it's more efficient for everyone and you'll get an answer faster
 
9:05 PM
I started by reading about webservers, I started by reading the definitions of what it means to be a server and a client and to make a request
that's how I started
I didn't go into a chatroom and say "what do you mean request"
 
there's fallacy to my logic..
return ($('#phone1').val() == "" && $('#phone2').val() == "" && $('#phone3').val() == "" )
 
I really mean this: googling is by far the best skill a programmer can ever learn.
 
it doesn't return true if all 3 are blank?
 
Well me neither.. nickcraver trys to teach me a method to pass some variables, and then all turns into request here and there
 
a client requests from a server, and in order to identify the type of request, the client sends a small number of headers. that is true for all internet requests
 
9:07 PM
aw fruitcakes. returns false if 1 is true
 
@tpae - you're using that callback to determine if it's required, instead that should be in a custom validation function
 
Yes ok drachenster
 
@Johnson I'll assure you @NickCraver knows what he's talking about
 
@drachenstern im sure he does, i just have problems with all those new unexperienced functions, methods and names.. so when i ask in detail you may feel like im a stupid mf, because its obvious for you guys
 
wow, $279.99 bestbuy.com/ShopEarly 2GB/250GB/15.6/64
and he said "go read the webpage because it explains it in detail" and you say "uhwhut?"
 
9:09 PM
@drachenstern Never said that
 
ok, yes, you never said those words, but my point is, have you read the api he referenced you to?
have you pulled that page up in a browser and put your eyes on all the main words of the article all the way down?
 
Yes, but not the whole only for the parameters i got reffered to learn back then
woow..
im stupid
just read what you wrote again nickcraver, and then what i wrote asking "beforeSend?"
haha
I just checked x-requested-with header, and it's XMLHttpRequest :)
 
there ya go
 
so it should work
 
to determine if it's an AJAX request, yes, jQuery will always set this header: github.com/jquery/jquery/blob/master/src/ajax.js#L369
 
9:18 PM
Aha!
 
Doesn't mean it'll be a jQuery AJAX request, but it's fairly safe to assume that if that request was made, it was an AJAX request ...
 
But there is something wrong, because I cannot get out anything from the form.
again: on my $.ajax url i have sendPM.php, and in this I got this simple:
echo $_POST['txt'];
 
this is why I just transfer JSON on my ajax
what does your data field look like on the ajax?
 
In firebug:
data[4][name] txt
data[4][value] asd
I see it pass
 
you see it in the request on the net tab?
 
9:23 PM
yes in the command tab
console*
 
not in the console
in the net tab of firebug
for that particular ajax request
 
net was inactivated.. just actived, let me run the request again
second
yes i see it
 
i can't get the jQuery.validator.addMethod("creditcardtypes", function(value, element, param) to work
 
so you see it on firebug, but not on the server?
 
does it auto detect visa, etc..?
 
9:26 PM
Hello again, quick question
 
lol@auto detect visa
 
how do i pass param
 
@Johnson if firebug says it sends, and if the console dumps it, then PHP should be seeing it
 
if I have a div element with a custom attr like: <div data-doc-clip-id="13"></div>
if I view the source in firebug I don't see my custom attr
 
I see it on firebug, but Response is empty, which should contain the $_POST['txt']
 
9:27 PM
I'm trying to mimic jQueryMobiles data-role tags
 
@tpae just pass all
 
@drachenstern what do you mean?
 
What could it possibly be, any ideas?
 
@tpae in the place where you have param, put all
 
type all?
 
9:29 PM
show me your calling code
where you're trying to validate it at
 
cc_number: { required: true, creditcardtypes: all },?
 
@Johnson if it's passing it then it's there, you're doing something wrong cos it's there
 
echo $_POST['txt']; <--- how can this be done
wrong *
 
@tpae - all should be in quotes, then it'll be the third param to your custom function
 
@drachenstern Hello :)
 
9:30 PM
does not work, it cannot validate my real credit card #
 
what does your validation function look like?
 
creditcardtypes("1234567890123456",element,"all");
@shaahin hello
 
$.ajax({
url: "misc/sendPM.php",
type: "POST",
data: {
mode: 'ajax',
data: data
},
success: function(rs){
$(rs).prependTo('#PrivateMessages').fadeIn(1000);
$('#txt').val("");

$("#pmResponse").text("Skickat!").show().fadeOut(4500);
$('#sendPM_btn').attr('disabled', false);
$('#txt').attr('readonly', false);
$('#title').attr('readonly', false);
}
});
 
@drachenstern : Do you have any idea for the question that i asked?
 
The only thing i can $_POST is $_POST['mode'] ..
 
9:33 PM
@Johnson - for the very last time...
 
@Johnson cos it's not getting POST data? $txt = $_POST['txt']; ...
 
data: data only
 
@shaahin you're going to have to refresh my memory
@Johnson learn to use JSON it'll be way easier
 
    $.ajax({
      url: "misc/sendPM.php",
      type: "POST",
      data: data ,
      success: function(rs){
        $(rs).prependTo('#PrivateMessages').fadeIn(1000);
        $('#txt').val("");

        $("#pmResponse").text("Skickat!").show().fadeOut(4500);
        $('#sendPM_btn').attr('disabled', false);
        $('#txt').attr('readonly', false);
        $('#title').attr('readonly', false);
      }
    });
 
@NickCraver I am trying to use the validate credit card method found in: ajax.microsoft.com/ajax/jquery.validate/1.7/… , but when i pass in "all" like: cc_number: { required: true, creditcardtypes: "all" }, does not work...
 
9:34 PM
@tpae you're not doing it right
 
ok
 
@drachenstern : LOL.. about sessin time out in asp.net application and alert before it
 
@dra
 
Yes it works!!!
 
@shaahin I've done a few things today, start over again
 
9:34 PM
Try cc_number: { required: true, creditcardtypes: { all: true } }
 
virtual highfive
thank you nick, do you hear me ? :P
even if im annoying
 
welcome
 
@NickCraver worked. thank you. you are a god
 
Is there Any solution to alert user via jquery or javascript before Asp.net Session TIme out ?
 
yes there are many ways to do that. How would you do it?
What are the business requirements?
"1) there's a set time limit, which we can define."
"2) we need to notify them before they reach that time, or change their screen"
but what that doesn't cover is what if they're doing data entry when it does a timeout, how do you save that information?
so, rather than me tell you and you say "yes yes" I ask you, if you were going to be in that situation, how would you want to be told?
And so you know @shaahin I implemented something for this on our web application, then decided it was too much hassle and changed the auth timeout to be 1 year
ours is a reporting db, so it's not like we have a strict need for user privileges
 
9:40 PM
@tpae welcome!
session timeout? sure:
 
@NickCraver : Describe more please
 
setTimeout(function() { alert("Session will expire in 1 minute"); }, 1140000);
assuming your timeout is 20 minutes (the default), adjust the timeout delay (in milliseconds) as needed.
 
@drachenstern : thanks for your response i am searching the matter
 
@NickCraver ... oh come on, you're going to just give him the answer and not help him understand the why? ;)
 
the last time they loaded the page was the last session refresh...if you're doing ajax activity, reset the timer as part of that.
 
9:42 PM
@NickCraver : where i have to put this code?
 
@shaahin all over. It just depends on what you're doing.
 
may i put this in master page that effect all pages?
 
@drachenstern unfortunately, no one every customizes the session timeout...yes that's an exaggeration but when they did a study years ago on ASP.Net usage, it was something like 98% of apps had defaults
 
unless you're going to do ajax requests
@NickCraver hence why I can say what mine is
Also, the guys that did it had a redirect to login.aspx in the script
they failed to account for being in /dir/some/place/
 
9:44 PM
routes baby!
 
so if you forgot to watch for something to complete, or when you came back from lunch, it was looking at /dir/some/place/login.aspx ... which naturally doesn't exist.
yay naievity
 
hah
 
I got tired of trying to explain to them about all of that so I took it out of the master page and set the timeouts to a year and they don't even notice
they're just glad it quit refreshing to the wrong page
well, the boss knew about it, of course
 
we redirect you to login, store your stuff and login takes you right back, no loss (would do single-sign on if we could...FDA rules prohibit it)
 
we have no DE or I would
 
oo yay one of our servers just forgot which domain it was on
...wtf man
as in AD domain
 
???
how does that even happen?
@shaahin I'm glad that you have found some example cases, but have you considered the business implications at all?
or are you just trying to write code to get around a problem and you don't care about the business aspect of the problem?
 
I hate cognos so much....can't wait until this release is out, I get to delete that VM personally
 
@drachenstern : thanks i will describe
 
I think I'm going to adopt a new motto ... if you ask a question, and I answer you, and you keep asking me, I will ignore you and pretend you don't exist. I'm curious how well I could stick to that.
 
9:49 PM
@drachenstern : English is not my first language , i dont understand what u say
 
@shaahin "What will happen when the session expires"
@shaahin "do you ONLY show them a message, or do you log them back in?"
@shaahin "Do you make them go to a new page?"
@shaahin "What will happen when the session expires?"
@shaahin "What do you WANT to happen?"
 
@drachenstern i want to ask him
if he want to login
or else redirect to login page
but without loosing informations
and texes that entred on textboxes
 
you want to redirect without losing information, so how would you do that?
my point is this: it's not as simple as "just add 123 to your code"
 
@drachenstern : look
i can showing a dialog to user
 
depending on how you implement it you may be storing things in a database or you may be passing query parameters
 
9:53 PM
yes
your are right
 
I would suggest using an AJAX call in the background to keep the session alive
OR
Extend the session timeouts on the server to be 8 hours
because after 8 hours they've gone home for the day
 
Extend the session timeouts on the server to be 8 hours is not good way
but i like aja Call to keeping session alive
 
I would not suggest a lot of background processing unless that's a feature of your software
 
it's IIS we're talking about, if you're using inproc sessions you'll also have to watch your recycle time
would suggest moving to a non-volatile session persistence at that point
 
because you're going to have to generate a sessionID and associate it with the unstored records and you're going to have to have a server that will store the data persistently but temporarily while you auth the user
 
9:55 PM
@NickCraver what is inproc Session ?
 
it's a form of session
 
in process, in memory....the default
e.g. if IIS restarts the worker processes for your app pool, all session data is lost
 
I think the easiest thing to do is to just alert them 2 minutes prior with a yes no, then one minute prior, and use a timer and an ajax call
 
on a persistent medium, e.g. SQL server that's not the case...but there's a performance trade-off there
 
which is why I don't use sessions on my server for anything important
also using a persistent storage medium allows for farming the session out, but that's complicated in its own right
 
9:56 PM
aye, we're removing session state completely this release, only has a handfull of things in there now
 
i think jquery represent for me client side timer
yes?
 
I'm trying to decide if I should move to aspnet profiles
 
and it will restart after each postback
 
@shaahin sort of
javascript provides a timer
 
you can use whatever, vanilla JavaScript does everything you need
 
9:57 PM
you will have to restart it yourself (yes, on postback)
but if you use an ajax request you should reset it there too
 
good note
@NickCraver and @drachenstern thanks a lot :)
 
how do i check number of "characters" in integers?
 
welcome
 
1234 would give me 4
convert it to string, and perform .length?
 
1234..toString().length
if it's in a variable just a single .
 
10:09 PM
goodnight everyone
 
10:24 PM
ok dumb question, remind me how I consume e.keyCode==13?
the editor on jsfiddle is damned sharp for being a javascript based editor
 
e.preventDefault(); return false;
 
no, I want to consume it on a textbox ... oh wait
yeah, I want to consume the e.keyCode and it's not being consumed
so that the <enter> doesn't propagate to the textarea
 
oh
e.stopPropogation() then
(i would guess)
 
ahhhh
that might be it
no
 
e.stopPropagation() // excuse typo
copied that straight from the Event.prototype .. i had mispelled it before
 
10:29 PM
@drachenstern What do you mean "propagate to the textarea"?
 
that was some intense validation stuff
had to validate 100+ fields
 
If you mean that you don't want the enter key to result in a line break, stopPropagation won't do what you want. preventDefault should, though...
 
I want to stop the enter from hitting the box
neither one did, lemme double check prevent
 
preventDefault wont stop propogation, but return false would i thought
 
10:31 PM
by the time you get the event though, the newline is in the textarea
 
both of those and setting to null
 
maybe you should just remove the newline yourself
 
ooooh, is that what it is
so how do I get to it before it gets there?
 
textarea.value = textarea.value.replace(/\r?\n$/, '');
(again, just a guess)
oh, dude
try catching it on keydown
rather than keyup
 
@drachenstern try using keypress rather than keyup
 
10:33 PM
you could hold keydown and insert several newlines before letting go :)
 
I was on keydown
keypress was it
thanks @lonesomeday
 
@drachenstern jsfiddle.net/dDCC3/1 if you're interested... :-)
 
@lonesomeday yeah, thanks
 
@drachenstern also, you're doing $(this).parent().parent().parent(). Don't -- this will make your code very hard to edit in future (when you try to figure out what three parents up is). Do $(this).closest('.commentwrapper') instead.
That also means that if you add another level of divs at some point, your code won't explode!
 
interesting, thanks. I was just goofing off with it for now, but I hadn't realized that was an op.
really I'm killing time while my database spools and so I was tackling this as a "what can I build today"
IE8: jQuery 1.4.2
Object doesn't support this property or method
event.stopPropagation();

What boneheaded thing am I overlooking?
 
10:48 PM
@drachenstern code?
 
I've got a checkbox on an accordion header. I don't want the header to expand/collapse if they check the checkbox, but if they check outside it I want it to expand/collapse.
@lonesomeday working on it, figured I'ld give the narrative part first
 
hi guys
 
in the page I've got :
function accCheckOnClick(event, element) {
event.stopPropagation();
sorry, I showed two disjoint bits of code
 
@drachenstern How are you binding accCheckOnClick?
 
i have a javascript function that checks if at least one of my elements are selected. it works fine. but how can i make it continue (after the test is passed) with a php query?
 
10:52 PM
@lonesomeday serverside <span class="accCellCheckBox"><asp:LinkButton ID="CheckBox2" runat="server" OnClientClick='accCheckOnClick(event,this); return false;' ></asp:LinkButton></span>
@sebastian do you mean that you want to do clientside validation, then submit a form of values to the server?
 
yes, something like that.
 
well it depends on if you're doing form based submission or an AJAX call
 
i know that javascript is client side and doesn't handle mysql queries. but i want to call somehow an php function that makes a query after javascript checks the form.
 
@sebastian are you familiar with php?
 
yes
 
10:57 PM
So the hard part is how to get from that javascript to the php?
do you know what AJAX is?
@lonesomeday did anything jump out at you on mine?
 
yes thats the hard part. i know ajax just by definition.
 
the behavior is right in FX, C, S
just not IE
@sebastian so are you wanting to make your request AJAX or can you do a submit?
is it ok to reload the page to get your data to the php?
 
@drachenstern um, yes, the fact that it's kinda ugly. I'm not really familiar with ASP, though. Are you trying to do a jQuery-ish function?
@drachenstern In any case, doing in-line event handlers is not a good thing
 
no, I'm only using the jquery for the ajaxian stuff on that page, it could probably exist without any jquery in the first place
yeah, I know, it was a hack page done to support a group who don't understand jQuery in the first place
I sneak in jQuery where I can
 
if i reload the page, won't the values from the form be erased?
 
11:00 PM
trying to get them acclimated
@sebastian not if you post the form
 
hmm... what's the fastest way? :) by programing time
 
put a button on the page with a submit function, and let the page post to a php somewhere, then get the values out via $_POST
 
@drachenstern The problem is that natively IE8 doesn't have a event.stopPropagation method. jQuery simulates it so that you don't have to worry about cross-browser compatibility. Try doing if (event.stopPropagation) { event.stopPropagation();} else { event.cancelBubble = true; }
 
Oh ... I thought that jQuery would "patch" the eventhandlers ... I hadn't looked into the jQuery stopPropagation or I likely would've known that huh?
I can knock that hackup into the page in thirty seconds flat, brb
 
@drachenstern It does... but only for handlers bound by jQuery.
@drachenstern jQuery doesn't modify native objects like Prototype does -- it wraps them instead.
 
11:07 PM
@drachenstern my english is not quite so good, can you please explain?
 
@sebastian on this I'm not the best teacher, I'm sorry
 
np
 
@lonesomeday no kidding... thanks for the minilesson, I'm gonna have to read through the source on that I guess ... shame on me cause I don't normally have a problem jumping into it
@lonesomeday thanks again, that was too easy of a fix.
 
@drachenstern The lesson is that jQuery makes your cross-browser life easier. </jqueryevangelism>
 
can't i just make something like this? if(var1=='empty'){alert} else {<? mysql_query?>}
 
11:20 PM
i jsut reformatted my computer, i remember there was a website to download all the softwares together in a bundle
anyone know what it's called
 
what software?
download.com?
 
umm, it's like a cool web app
that combines all the necessary junks like.. rar, vlc player, firefox, etc..?
into 1 installation
 
I know google has a similar download
 
found it
 
how spiffy
 
11:26 PM
pretty cool eh/
 
It's a nice site. I'm not 100% sure of the relevance for a Javascript chat room, but still :-)
 
@drachenstern can i check in php what does a js function return?
 
@sebastian what are you trying to do?
 
@sebastian I'm not sure I understand the question. You can always pass the result to the server, but the technical details of "how" vary.
 
i have a function that, checks if at least one of the elements in a form are selected. if at least one is selected to continue with a mysql query in php.
 
11:30 PM
@sebastian ~ Ummmm, how do I say this
I think you should focus on making your form submit to the php
but I don't write PHP, so I'm not sure how to tell you to do this, I am much more familiar with .NET code
I know that if the .php has a <form> then when you <submit> the .php will have those values
even if the .php also contains javascript
you should always validate the values on the server because the client may disable javascript. You can never trust the javascript to run completely
 
i have a submit in php. the validation form is caled through onSubmit
 
then you should be able to have the values in the php from the form
 
i do have the values. the function checks the fields after i press submit. what i want is after i pressed submit and the test went ok to continue with a php function.
 
11:46 PM
then you need to handle that in the form submit on the php
I don't know how to help you with that
if the values are valid and are submitted, then you have submitted the valid values ... it's rather self-defining
 
yes, that's true, but there i have an other problem with that. it's not a registration form. i have 7 elements in my form and any one to 7 can be selected. for each selection i have to make a different query.
 
so make those distinctions in the PHP
 

« first day (19 days earlier)      last day (4945 days later) »