« first day (1485 days earlier)      last day (3470 days later) » 

12:01 AM
hmm it could but not sure how
php is better and easier actually
javascript isnt safe I think for that task
 
Sim
for first time MS came handy lol
<div id="textDiv"></div>
<script type="text/javascript">
var div = document.getElementById("textDiv");
div.textContent = "my text";
var text = div.textContent;
</script>
 
ya but thats only for 1 site
you would still need to use php include
reaaaally easy
 
Sim
never used php yet since it requires u to setup a server
 
no no
hang on
you just need the include snippet Thats all
no server. Just change your html document to php.
 
Sim
got it
 
12:15 AM
just do it now with a "test" document if you want. Then create another document which ONLY contains the div in my jsfiddle. Nothing else. Rename that to "Timer".
 
Sim
do you have to know how to 100% in javascript
 
then include timer.php or modal.php or whatever you want to call it to your test.php. Anywhere where you want it to be with <?php include("modal.php"); ?>
 
Sim
width":550,"height":250, this is the way it shows im trying to fir the page
fit*
 
Sim check out my message. I included the snippet and I explained how to do it
so next time you update the modal text in modal.php and upload it on your server it updates the text on all your pages
 
Sim
i dont php setup im running through html5
php is next im getting there just waiting for some time when i could setup
a server
 
12:28 AM
damn
 
Sim
you have been really helpful :)
god bless take care :)
 
1:02 AM
no problem!
 
Why is github.com/tejas-manohar/clap not working? Specifically github.com/tejas-manohar/clap/blob/master/app/scripts/…;. line 7 undefined is not a function
 
1:26 AM
@tejas-manohar Is pauseVideo a thing? Because I can't find any evidence of it existing.
 
ok finally done optimizing my jquery code jsfiddle.net/wt6mkkng/32
what do you guys think is it cleaner than my old one? thats the old jsfiddle.net/wt6mkkng/8
 
1:56 AM
any ideas for optimizing my code? This is what I have now jsfiddle.net/wt6mkkng/45
 
Sim
@Demorus hey i'm back got stuck on something
 
oh
 
Sim
sorry
 
whats your problem?
 
Sim
just one thing i have a script code which display the content on modal can i give the script an id to display in div?
example of code
<script type="text/javascript">
( function() {
if (window.EXAMPLE === undefined) { window.EXAMPLE = { 'units' : [] }; };
var unit = {"calltype":"async[2]""width":300,"height":400,"sid""};
var placement_id = window.EXAMPLE.units.length;
window.EXAMPLE .units.push(unit);
document.write('<div id="EXAMPLE-' + placement_id + '"></div>');
}());
</script>
<script type="text/javascript" src="link" ></script>
 
2:06 AM
ya
id=example
id=modal
 
Sim
got it thanks again
 
 
12 hours later…
1:59 PM
hi
 
2:38 PM
hello all
can anyone plz help me --> stackoverflow.com/questions/26828899/…
 
 
1 hour later…
3:41 PM
posted on November 10, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Whee!

 
4:00 PM
Hey guys, if i have a text field <input type="text" id="some_id" value="1" %> and the value changes dynamically based on, let's say, the value of a ui slider. How do i detect the change event on the text field?
 
!!tell Tommy mdn change event
sigh
 
4:19 PM
If you read what i wrote, it'd be obvious i know what a change event is.
 
Hola guys, any idea why this fiddle not working in firefox?
jsfiddle.net/cnY8N/181

I am trying to achieve a fading effect on a body background. Any better idea for doing it. The current fiddle works in chrome.
 
5:17 PM
at least give us a clickable link...
 
5:51 PM
could anyone help me with my question? stackoverflow.com/questions/26830828/…
I tried 3 methods so far and all failed
2
 
6:07 PM
Cool story
 
6:17 PM
hello, anyone can help me with part of code
where here is mistake, that didn't work in chrome - here is the screenshot again goo.gl/UqWqSq
 
sure
I will try to help
Sarhov
add "color"
.contains("color") because you are missing the ""
 
Chat is dead -- Nietzsche
 
If you dont have quotation marks then it wont read the color. Result: error
 
6:36 PM
@copy btw, the original statement nowadays should read as "Church is morally dead"
 
holy jesus
 
Less morally dead than in the middle ages
Or WWII
 
no, Nietzsche was referring to his church in his own time
just the wording has not .. emm ... preserved with the time
 
Oh, good to know
 
it's kinda the same as with Milton's "Paradise Lost" - while we nowadays see the main character as anti-hero , in he was meant to be antagonist
 
 
1 hour later…
7:50 PM
hello Guys. Is anyone online? I have a problem I want to solve
 
 
2 hours later…
9:39 PM
@macroscripts Still got that problem?
 
-2
Q: JavaScript Remove duplicates from text/array

macroscriptsI want to remove lines in text based on duplicate keywords. The text goes something like this. text1,abc,text2 text3,cde,text4 text5,abc,text6 text7,gfh,text8 text9,cde,text10 I want to make it into. text1,abc,text2 text3,cde,text4 text7,gfh,text8 The idea is to take the text, split it base...

 
Sim
hey guys can anyone help with a script?
 
Yep, happy to give you some notes about character development and story.
 
Sim
will do let me make a fiddle thanks
 
woosh
@macroscripts Why "put it through 2 loops"?
Your description is a bit unclear and you didn't show what you already tried, hence the downvotes. Either way, you should loop through the lines of text, each time save the string you're matching duplicates for in an array, and every time check whether or not the line you're processing has a string already present in that array
 
9:43 PM
@macroscripts you haven't specified on what criteria a line would be considered a duplicate - I had to guess. Also, you haven't shown what you've done so far and why the answer a previous poster linked wasn't adequat
 
so something like (speudocode here)

var duplicates = [];
var lines = /* your lines */
var strippedLines = [];

for(i = 0; i < lines.length; i++) {
    var line = line[i];
    var string = /* your regex or whatever here to grab the string you're looking for */

    if(!duplicates.indexOf(string) {
        strippedLines.push(line);
        duplicates.push(string);
    }
}
it ends up with your lines stripped of duplicates stored in strippedLines
 
Sim
so here is what im trying to do is i want to separate one page into two when a user goes to the page i want the top content to appear first for like 1 minute after 1 minute the second bottom content will appear using div here is link for fiddle jsfiddle.net/gn3t5b0o
 
What have you tried so far?
 
Sim
jsfiddle.net/gn3t5b0o/1 i just update with javascript jsfiddle.net/gn3t5b0o/1 using set time out
 
@TomW I did specify. I gave examples of text. The crieteria is to remove the lines containing duplicate keyword
 
Sim
9:56 PM
*setTimeout
 
it's an excel file with duplicate columns.
but in different lines
 
@Sim add jquery
you haven't included it in the fiddle
fix the timer selector
 
Sim
im new to javaascript that all i could come up with the code
 
@phenomnomnominal %
 
10:11 PM
So, I came back to see the chat and noticed someone unstarred my "be back in a week" message. Who did it?
 
@BenjaminGruenbaum Here
Unnecessary drama
 
@Meredith I just fixed his bugs, didn't rewrite.
 
10:40 PM
var foo = function() gets hoisted like function foo(), right?
 
only the var foo part does
 
not the actual function definition
 
Ok that's what I thought but I saw something comparing them
And they implied that the definition was hoisted
 
10:45 PM
the var foo part does get hoisted
 
Yeah
 
but not = ...
 
Is there any reason to use function foo()?
 
because it gets hoisted?
because it looks better?
 
10:50 PM
I'd say it's a "code as if everyone else was an idiot because they are" style of guide
named function expression - err... I've never used these
 
Yeah I haven't either
Tbh I didn't know it was even legal
 
what's that last thing they suggest? May I call it a reverse hungarian notation?
reverse types hungarian, to be exact?
 
Tbh it actually seems pretty useful
I had an issue the other day where I needed to make a function non-anonymous
Naming it like that would've been a pretty easy fix I think
 
function doSth satisfies that very well
I've even done
(function doSth(){
  ...
  doSth(child);
  ...
})(root)
 
The issue was that I wanted to call removeEventListener
And I used an anonymous function in addEventListener
So I just pulled it out and named it
 
10:56 PM
you don't need a named function, you just need a way to reference it
 
Yep
But I'm not that clever
 
also, I prefer checking conditions from within event listeners over adding / removing them repeatedly
 
It was on a mousemove event
I'd rather just remove the listener than have it called a million times and not do anything
 
good point
 

« first day (1485 days earlier)      last day (3470 days later) »