« first day (600 days earlier)      last day (4351 days later) » 

word doc to HTML converter in JS anyone?
 
@FlorianMargaine i asked you on OSI because i have a viva tomorrow
and we were just told to find out what the heck is networking in depth
the syllabus has words like TCP/IP , OSI and etc
 
if one doesn't exist, it exists in php, and you can port it :D
 
i know most but OSI was new so asked
@rlemon .xdoc ? is just xml
 
@Esailija or I can just use the PHP one, upload the file convert it then spit back the HTML and remove the file from the server
 
6:03 PM
posted on June 07, 2012 by miraculous1

I recently ported my little CreditCard.js library from Prototype.js to use underscore.js, as I needed that in a project. Here’s what I’ve found—check out the original Prototype.js version first: And here’s the same thing, but ported to underscore.js: A few observations that, needless to say, are opinions, not scientific fact: Prototype.js’ direct extensions of built-in [

 
@rlemon the best word doc to html converter
is
 
it being just xml doesn't really make a difference
 
MICROSOFT OFFICE WORD Lol
 
@Abhishek GTFO
 
lmao
 
6:04 PM
hey there
 
anyways finding
 
$.MSWord(doc).convertToHTML(); wow that was easy....
 
lol
 
what language is that ?
 
6:06 PM
word2cleanhtml.com/api Y U SHOW API PAGE THEN ASSHOLES
 
html and javascript
@rlemon LOL
 
since when javascript allowed universal file reading @E ?
 
seriously ... lets put a contact page on our site with the message "There is no way to contact us, sorry!"
Trolls!
@Abhishek since IE and ActiveX components rape your system
 
@Abhishek javascript is a language, being able to read files depends on platform
 
ah i never wrote specifically anything for IE
 
6:09 PM
> ar w=new ActiveXObject('Word.Application');
 
javascript can set your coffee maker's timer if it runs there
 
^ garbage IE6 type of crap that I thought I was done with.
 
@Abhishek originally, xhr was an ActiveXObject
 
I remember those days.... :(
 
activex is what caused many security problems for some years
because too much power was given to it
 
6:10 PM
> xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
yea and MS still uses it on their websites to install their applications without an installer.
 
user1385191
ActiveX is also why boolean logic on host files is problematic
 
more specifically
wvware.sourceforge.neta
 
user1385191
scroll down to "Feature Testing a Host Object"
 
@Abhishek ok seriously... Javascript dude. IDC about offline converters or converter services that I cannot use offline from the webpage :P users need to be able to drag and drop their doc files and have them converted into pages.
 
6:12 PM
you can use it :P
with php
 
typeof el.childNodes // 'function' hah pretty nice implementation leak
 
yea there are tonnes of php ones. i'm looking for JS first then if I need to I'll convert it or use a php one.
 
something shown there
i cant find a javascript one for word sorry :-(
and sorry i am still waking up [ fell asleep reading my question sheet for tomorrow ]
 
user1385191
@Esailija that exists in older Opera builds as well
 
user1385191
6:15 PM
and it actually is a function
 
you mean you don't do var nodes = el.childNodes ?
 
15 arguments in that function.....
 
@rlemon activex
 
:(
double :(
 
6:16 PM
@rlemon haha, makes me think of creating a keyboardevent
 
@FlorianMargaine btw >_> i am surprised about that script which tells about the future
 
why do you even care? it's facebook tests <<
 
it somehow analyses all what you have been pasting on fb and matches it with job templates maybe beause a dj friend of me got musician a dancer got Choreographer I got Net Admin and a classmate got engineer
I dont are about most i care about those which give intresting results lol
 
howdy folks
 
6:18 PM
howyd
 
g'day
 
Could somebody give me a small hand with this? codeincomplete.com/posts/2011/8/19/javascript_state_machine_v2/…
I would like to know, specifically, where are the states defined?
It looks like they are derived from events, but I cannot really see it
 
FlorianMargaine lol
wow you are so fast ;-)
 
hah
Florian, you must be a math guy :)
"Is it a or b?" "yes"
 
6:22 PM
or the one who presses ctrl + shift + i fastest and then reads the fastest
 
hi everyone, ignore my nickname, my english is not very good and i thought it ment exactly the opossite :P
 
lol
 
look at the variables on the right
especially in this
the states are in there
you can see current = "red" etc
 
so, the event sends the state, and "this" becomes the state, right?
 
the StateMachine object is then called in there codeincomplete.com/posts/2011/8/19/javascript_state_machine_v2/…
the event is custom
no, this is the object StateMachine, a singleton that remains, so it keeps the states and everything
gotta go, cya
 
6:27 PM
so, where it says statemachine create?
 
0
Q: displaying multi-section html documents - best practices

ecpepperI work at a research organization and we publish a lot of large-ish documents, usually organized in sections. What I want to know is how best to present these multi-section documents on our website. Presently, what I do is load the entire document as a single page, with each section as its own d...

 
@FlorianMargaine lol, I know how http works :P I was asking about how node.js' http module worked :P
 
jsbin.com/asahe5/51 can anyone show me how to do url search retrival mentioned in this link
 
@FlorianMargaine wow
-1
A: JavaScript set boolean by separate conditions?

DancrumbBased on some assumptions about how B should behave if A has not been true: function FlipFlop(){ this.latch = false; this.value = false; } FlipFlop.prototype = { constructor: FlipFlop, setA: function( val ) { this.latch ||= !!val; this.value = this.latch; ...

 
i need to pass textfield value to php file in this line of code but i dont know how to do.. iam new to javascript please help me.. (source: "test.php")
 
6:38 PM
some new mystery operator ||=?
var roketOperator =||:::::::::==-> "Blast off!";
 
i want when i click an image to open in a new window and when i click inside this window to close the window
 
<form id="form1" name="form1" method="post" action="#">

<input type="text" name="Tag" id="Tag" />

</form>
.
.
.
$('#Tag').jSuggest({
uniqID: 'id',
source: "test.php", TOGETHER WITH THIS URL I WANT TO PASS VALUE FROM TEXTBOX NAMED "TAG" TO A VARIABLE IN TEST.PHP NAMED "REQ"
// preFill: pref.items,
selectedItemProp: "name",
seekVal: "name",
queryLimit: 10,
newItem: function (item){ var newItemData = {value: item, name: item}; return newItemData;},
selectionLimit: 2,
formatList: function(data, elem){elem.html(data.name); return elem;},
 
imageElement.onclick = function() { var win = window.open(...); win.onclick = function() { win.close() };
 
@rlemon thanks, i will try!
 
hey rlemon please help me
 
6:41 PM
hey @user1370390 no
i've walked into that wall before
 
please go through my post just above
please help me
 
SIGH coworker asks for help
asks if autocomplete is "built in" to jquery
says she gets undefined
 
Help Vampires are on the loose!
 
says she doesnt know much about ajax..
I was like arg.. its in jquery UI.. but dont include that crap
 
@user1370390 post it on the main site, format your code, have questions and not just CODE... then you might get somewhere
if you need quick time fix, onebox the post in here to get a little more coverage on it.
 
6:43 PM
i have posted but no one replayed
 
how long ago?
0
Q: how can i pass values from javascript to php realtime

user1370390i have a text field named "tag" iam using it as a search box. when i type each alphabet in this textbox i need to pass that value to a variable named "$req" in a php file called test.php.The value must be passed from javascript as follows.. <form id="form1" name="form1" method="post" action="...

> asked 18 minutes ago
 
just now
 
I don't even have a response for this...
 
ya this one
 
people have jobs / lives / other crap going on ...
 
6:44 PM
hmmmm
 
I have questions that are months old with no answer.
 
hmmmmm
i have to complete my mini project before this 10
 
so my advice, be patient, someone will answer you - and if you DO want to get in on the chat for some live discussion on your question posting WALLS of code (unformatted) will ensure you're ignored.
 
oh iam sorry for that
 
posting a link to the question with possibly a message saying "hey guys I have this issue and a deadline"
then at least you're not looking like "FIX IT FIX IT FIX IT!!!"
 
6:46 PM
kk
:-)
 
however the question is < 20 minutes old... you're being a little over eager if you ask me.
give it a few
 
ok brother.
do you know javascript pretty well??/ rlemon
rlemon
 
well, thats what I tell myself.. keeps me from crying at night.
 
haha
 
Christ i am sick as hell
i will run to a doct. cya
[ i just realized i have a high fever :-/ ]
 
6:50 PM
rlemon can you say how we pass values to php from javascript
getwellsoon abhishek
 
damn @Abhishek maybe you should get more sleep
your still in India right?
 
yeah
rlemon
 
@user1370390 XMLHttpRequest
@Loktar he drank the water :s
my travel guide recommended against this.
 
ya but i need a code like this .. /////source: "test.php?variablename=something" something like this
rlemon
together with calling that url i need to pass a variable data also..
this was my actual problem
 
XMLHttpRequest
did you even look at it
 
7:02 PM
 
hehe
 
what is the best way to ensure a visitors browser refreshes the browser-cache of my site when i push new CSS/HTML/JS
sometimes we push TONS of css/js modifications to a site.. and then we get emails "Our sites broken!!" and all they need to do is clear their cache.. how can we temporarily force the browsers to reload cache when we specify?
 
Serverside configuration or different filename (or query string) for each new version
 
and just define a new version each time?
interesting, i think the library im using in CodeIgniter does this for me.
 
Mostly people do style.css?1, style.css?2, etc.
 
7:06 PM
or 1.2
etc
 
var xhr = new XMLHttpRequest();
xhr.open("POST", url, false);
xhr.onreadystatechange = function() {
    if( xhr.readyState === 4 && xhr.status === 200 ) {
          // do something with the response
    }
}
xhr.send("foo=bar&RT=FD");
 
so the browser will still cache it, until it changes to ... ?1.2
 
Anyone wanna LUL at an epic Bank Institution fail?!
Wanna manage group RSP's with RBC?
^ this is where the bank sent us....
 
"Microsoft Internet Explorer 5.0 or later is recommended to use this site.
"
 
ARE YOU EFFING WITH ME?!
 
7:07 PM
0
Q: Modules in JavaScript as an advantage

flsgI'm relatively new to JavaScript and I possess OOP knowledge from other programming languages. I've been looking at the concept of modules for JavaScript, like this: var basketModule = (function() { var private= 10; return { //public } }()); What I fail to understand is ho...

lol
 
changed my user agent to IE 9 and it says I have no JS or Cookies enabled.
 
i click "continue" and it just refreshes"
lol
 
change my user agent to IE6 and it works.
Seriously, you have to be on IE5 -> 8
they sniff your user agent to ensure it
 
lol
thats retarded
i offer a notice to visitors "ehy youre on IE6.. click here to upgrade"
 
on main.aspx and if you are not they send you back to that page.
 
7:08 PM
and if they dont, i inject the chrome frame
 
thankyou rlemon.
 
like... this is my bank.... I all of a sudden do not feel so secure keeping my money there
 
hahahhaah
i thought about that the other day as well with midfirst.com
we were talking about that in the php chat
how linkedin and eharmony got hacked, and linkedin didnt even use a salt
makes me quiver at the other various sites i belogn to
 
that is just cool
 
yeah.. last.fm now
 
7:10 PM
Damn it, I'm wondering, why does http.get() works and http.request() doesn't? I mean the callback NEVER gets called, but with http.get() it works 100%
 
17 million passwords leaked
 
nothing new @rlemon, Chase Bank did it first.
 
@Mike i don't care who did it first, it's cool is all i'm saying
@Loktar can you make me a 3D Pipes Windows screen saver effect in CANVAS?
 
ahhh memories
 
heh idk man
probably
 
7:13 PM
if you can do it in 1k i'll def expect that to win js1k
i mean, it's frikkin 3D PIPES
i keep my XP VM runnin just so I can see it
 
haha
 
i kid you not
 
surprisingly it seems to be done in true 3d
I thought it just used perspective 2d trickery
 
<script type="text/javascript">
function goImg(myImage,myWidth,myHeight,origLeft,origTop) {
win = window.open(myImage,'image','height=' +
myHeight + ',width=' + myWidth);
win.onclick = closeWin('win');

}

function closeWin(myWin) {
win.close(myWin) ;
}
</script>
this window opens and closes automatically
i want it to close only with onclick inside the window
 
> win.onclick = closeWin('win');
this executes closeWin and returns the value 'undefined'
 
7:17 PM
should i return false?
 
aww you missed out @rlemon
in chrome you used to be able to type about:internets
and it was the 3d pipes screensaver
 
function goImg(myImage, myWidth, myHeight, origLeft, origTop) {
    var win = window.open(myImage, 'image', 'height=' + myHeight + ',width=' + myWidth); // if you do not specify var then you are polluting the scope
    win.onclick = closeMe;

}

function closeMe() {
    this.close();
}​
@Loktar lol awww
I wanted it for an easter egg on my (soon to be born) blog site
 
You could port the opensource version of that screensaver
 
yeah I was looking at that
 
7:20 PM
Konami Code === PIPES!
 
would have to use webgl
well wouldnt have to
but would make more sense
 
Is there anybody who would help me to find out why does my http.request does NOT work, and when I simply replace it by http.get, it work? My options are well done:

{ host: 'localhost', port: 3000, path: '/', method: 'GET' }
 
@JavascriptGeek no you should use the function name for a named function instead of executing the function itself if you want to assign it a scope like in my above example
 
@rlemon thank you, will try
 
7:24 PM
function foo() {
     // 'this' now references the element the click was invoked on.
    return "Foo!"; // this does nothing... the return is not stored or cared about.
}
element.onclick = foo; // sets it so that when you click the element the function is run within the scope of the element itself.
element.onclick = foo(); // just runs the function on page load and sets element.onclick = "Foo!";
 
I have a web page that needs to upload a jpeg file to the server where a PHP script will process it. The jpeg file is not something that user browses to so there it is not part of a form with an <input> tag. I want to do this behind the scenes so I don't want a plugin that puts up a progress bar or any kind of UI. What is the best approach for something like this?
 
basically foo is the function code... foo === function() { return "Foo!"; }; whereas foo() === "Foo!";
ahhhhh memories Google circa 1998
LOL in '98 this was Googles server hardware
> These are both 300 MHz Dual Pentium II Servers with 512MB of RAM. There are 9.9G drives between the two machines. The main search used to run on them. These were donated by Intel.
 
document.f.q.focus(); The only useful piece of Javascript at that time
 
Googles first servers.... hehehe
 
If thought it was a lego one
 
7:40 PM
@rlemon ; is optional. == is silly and you should use === everywhere
@TomShreds a pragmatic solution is to use mikeal/request
 
I === all the things!
 
@Raynos nice thx
 
@Raynos no you should use ; when you want to end a statement... not doing so is silly. == is a valid operator and has been with the language since the beginning. suck it up.
don't make me add moustaches to you again!
this time i'll make you with a beard!
 
@rlemon I wont waste my time argueing this with you
 
nahh Semicolon devil horns are much better.
it's not an argument - you are wrong. (not for the semi colons for thinking there is something wrong with ==)
 
7:49 PM
CSS room is vacant, anyone want to tackle a css positioning question?
i have 2 columns, width 30% and 70%.
 
if you are to expect people to accept you relying on ASI for your semi colon insertion; you kinda have to accept that people will use == (all arguments for or against ASI apply for == vs ===)
period.
 
floated left. when i add padding, the right column pops below the left rather than remaining side by side.
 
because margin adds outside the width.
 
but it's padding, not margin
it should be around the content, not container. or did i get that wrong?
 
7:54 PM
so it expands out from the content, rather than collapse in from the margin. ok, i did misunderstand how that worked. thanks
 
@rlemon OMFG
> dat meme
@Raynos anything to suggest for calculating execution speed? or I can simply calculate it myself? I mean a package or something
 
that fixed it, thankee kindly, good sir. :D @rlemon.
 
np
ohh Drupal... Y U NO DO EXACTLY WHAT I NEED OUT OF BOX
 
@TomShreds depends. If you want to benchmark your web server use apache benchmark
if you want to time your code naively use Date.now() and comparisons
 
Perfect thanks
 
8:01 PM
Alternative tools are time node file.js
or an actual library like benchmarkjs
Of course if you want to profile your code that's a different matter
the profile is a pain in the ass to use as it requires integration with something that can read profile data. Like chrome or gdb
@rlemon == either means "your being annoying and using == because it's equivelant to ===" or "your an idiot and don't understand the difference" or "your being clever and your using == to allow multiple types of data"
@rlemon the problem with == is simple. It makes me stop reading your code and think "did he mean ==, did he mean ===, is he being lazy. is he being stupid. is he being clever"
When I read === I see he is using ===, no questions asked.
 
@Raynos assuming the user does not know the operator functions is just arrogant IMO - if the operator is used incorrectly and it is obvious then ok but if it is being used as intended then it's fine.
and I don't read your code for similar reasons.
 
@rlemon wrong. A lot of users won't know the difference between == and ===
 
I read your code and I all of a sudden have to learn the ASI rules - eff that
and even more users wont know the ASI rules.
 
For example x == null "Is he lazy or does he really mean == null || == undefined"
@rlemon you won't have to learn the ASI rules. My code with or without semi colons is semantically equivelant
 
basically all i'm saying is you are being silly for relying on something like ASI then complaining that people are using == properlly.
 
8:05 PM
@rlemon running my unit tests tells you that my lack of ; does not break my code
 
and if you don't know the language operators or you assume everyone is using them wrong then idk to discuss this anymore
because that is a stupid rational.
 
Meh.
=== is simply more readable then ==
there is no two ways around it
 
in your opinion.
 
whether ; is more readable then not ; is another matter
 
not having ; is not readable at all in my opinion... as well as many other developers.. but you will argue that tooth and nail.
 
8:07 PM
How is it not readable
 
how is == not readable.
 
\n or ;\n it's the same thing
they are semantically equivelant
 
and == and === are TWO DIFFERENT THINGS
 
where as == and === work completely differently
 
if you confuse them, then that is not my fault.
 
8:08 PM
== and === is a valid complaint about the semantics of the program
@rlemon the problem is I don't trust javascript developers to understand the semantics of ==
 
+= looks kinda like == should I avoid using it as well?
 
No
 
and I don't trust code written without ; to function as it is intended.
 
My problem with == is that I expect the developer probably wanted the semantics of === but was an idiot
 
can i trust you know all of the ASI rules? well i kinda have to make that assumption don't I? but it is impossible for you to assume I know how to use ==
 
8:08 PM
I know the ASI rules
do you know the == rules
the ASI rules are trivial
 
so are the == rules
 
The == rules are bloody complex.
 
do you know the || rules
 
or the O'Doyle rules?!
 
list my exactly what 1 == "1" does without looking at the spec
anyway this is pointless
 
8:10 PM
it was pointless when you complained about it the first time... that was my entire argument.
== vs === is the same argument as ; vs no ; or camel case vs underscore.
 
I also object on other matters
No
 
ffs it's all personal opinion.
 
== and === clearly have wildly different semantics in almost all cases
; and no ; have the same semantics in almost all cases
 
FFS Y U NO EFFING LISTEN
I know they are different... and choosing to alienate == and not use it is your choice.
 
also underscore naming convetrions are wrong
 
8:12 PM
me learning how to use it and imploring it's power is mine.
 
there is no valid use to ==. /end
 
... disagree?
 
there is no valid reason for me to keep talking to you.
 
There are plenty of times when I need to know if something is falsy
 
use an if
if (!x) {
 // i am falsey
}
@rlemon list me a valid use for == that I cannot refactor to be more maintainable
 
user457812
8:14 PM
x is the falsy one, it must begones
 
@Raynos x == null to check if argument x was provided, allowing null to be used to skip it (rather than making the user type in undefined or void 0, which are nasty).
That's the only time I'd use it. (I don't really want to get involved in this discusion but I was draw in by the flags and wanted to make comment because I think that use is justifiable. Cheers.)
 
@JeremyBanks x === undefined works fine
I find x == null to be a bad pattern. An API should not allow the value to be both null and undefined to mean the same thing. This is a sign that the writer of the code doesn't understand the difference between those values
 
I guess I can understand (x === null || x === undefined), but if you do understand those values, then why not use them as such?
 
Passing undefined as an argument feels very ugly. null is nicer (and JSONable), but letting the argument be omitted (hence undefined) often makes sense.
I don't have a stronger argument than that.
 
But at that point, I'd assume you just don't want to deal with falsy values in general, so Raynos' point is again valid.
 
8:25 PM
@RyanKinal because I would never write an API that accepts a value that can be either null or undefined and it means the same. Or at least, if I ever do it would be incredibly rare and I would want to use both === checks to make a loud statement that this was intentional in the design of this API.
 
I wouldn't conclude the same. I feel like undefined should only be used when you're actually checking if a variable hasn't actually hasn't been defined. null should be used when you're explicit specifying an absence of a distinct value. If you want to allow an argument to be omitted, it may fall into both categories.
 
@Raynos You would never write an API where (for instance) getBy.Id(undefined) and getBy.Id(null) would both throw an error (or return false, or some other indicator of failure)?
 
I can't imagine an API where it would fall into both categorizes
 
here I am again I have this code. I want a new window to open when i cclick to an image here is my image <a href="images/oldhavana1.jpg" target="_blank" onclick="goImg('images/oldhavana1.jpg,500,500,500,500'); return false;"></a>
and here is my code
<script type="text/javascript">
function goImg(myImage,myWidth,myHeight,origLeft,origTop) {

var win = window.open(myImage,'image','height=' + myHeight + ',width=' + myWidth);

win.onclick = closeMe;

}

function closeMe() {
this.close();
}​
</script>
it just opens the image in a new tab and does nothing
 
@RyanKinal I would use if (typeof id !== "string") return null
 
8:29 PM
have tried to make lots of changes
 
@Raynos Good point. I suppose checking for the areas where it will work, rather than the areas where it won't is a good thing.
 
@rlemon apologies for argueing like a dick :D I went over the top.
 
@JavascriptGeek You're passing one big string to the first argument, rather than several values to several arguments.
 
:4033597should i use quotes then?
 
@JavascriptGeek goImg('images/oldhavana1.jpg', 500, 500, 500, 500);
Note the position of the quotes
Also, pro tip: "JavascriptGeek" might not be the best name in the world.
 
8:35 PM
Hello everyone!
 
Hello
 
@RyanKinal yes i thought it meant exactly the opposite my english is not very good .Tried this, still doesn t work
 
@RyanKinal LOL I was thinking that..
but didnt want to say it
 
:-)
 
8:43 PM
@DieVarDump Good to know indeed
@JavascriptGeek Are you getting errors? Is there any feedback we can see?
 
Oh wow its about time
 
@RyanKinal goImg is not defined: line 1 (firefox error console) it s not on line 1, it s on line 32
 
Hey all
How do you like me now?
0
A: d3 javascript alternate colors on click

NealMake yourself a toggle function and pass it into the click: http://jsfiddle.net/maniator/Bvmgm/6/ var toggleColor = (function(){ var currentColor = "white"; return function(){ currentColor = currentColor == "white" ? "magenta" : "white"; d3.select(this).style("fill", cur...

^_^
 
@JavascriptGeek I don't know, dude. Looks like there's a problem with your function declaration. Make sure it's there. Make sure it's being executed. Make sure there are no errors.
 
show error in doctype html
that s a clue, i will search it and come back to tell you, thanks for the help btw
 

« first day (600 days earlier)      last day (4351 days later) »