« first day (1348 days earlier)      last day (3616 days later) » 

1:00 PM
can anyone tell me in jsfiddle ondomready means
 
It means the javascript won't fire until the html is loaded
 
@Neil Sounds logical, tbh, same situation now obviously :P
 
@NickDugger how code is warped in ondomready like in onload code is warped in $(document).ready(function() {}); and how is it in ondomready.
 
wut
 
1:04 PM
First of all, I highly doubt you need to even use document.onload or the jquery equivalent. Just load your JS at the end of your HTML
 
sorry i mean wrapped
@NickDugger I was trying to use this example jsfiddle.net/CpNUX/7 but nothing is shown.
 
@SirBT Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Why does my AJAX code display the eBill.php for less than a milliscond before disapearing?
 
!!tell sirbt format
 
@sirbt Format your code - hit Ctrl+K before sending and see the faq
 
1:09 PM
OK
$(document).ready(function(){
$("#Search").on('click', function() {
	var orders =	$('#orders').val();
	alert('You ordered: ' + orders);
	    $("#div1").load('eBill.php').fadeIn('slow');
      });

});
 
try hiding your element before you load into it
 
@RyanKinal Thanks :D
 
Sorry, but how do I hide my element before loading into it?
 
.hide(), .css({display:"none"})...
 
1:13 PM
0
Q: EJS - Render HTML From Data

Nick DuggerI'm using Sails.js (Node), which ships with EJS. My issue is that I am (as part of the json data) sending a chuck of HTML, however, when it gets rendered onto the page, using <%= foo.bar %>, it writes out the HTML tags, instead of rendering them. So, I get this (example): Hello, here's some <b>...

 
@mikedidthis No problem :-)
 
I really need to organize my javascript..
 
@JanDvorak Sorry I dont seem to understand how to do this, do you mind including it in the code I posted?
 
@SirBT check the documentation. G2G, sorry.
 
@SirBT If I understand correctly, he means you have to use either of the functions mentioned above on $('#div1') and then run the .load and the rest, but I'm not sure, nor do I know exactly what you are trying to achieve, which does not help things :P
 
1:19 PM
@NickDugger a) it is in the docs. b) it is already a question on SO c) use <%- data %>
 
Yeah, I commented that I found another post about it. Where in the docs is it? I only found really shitty google code pages.
 
so, dupe.
 
Aye, apparantly
I'll remove it
 
@Magikaas Sorry let me simplify my code & explain. When I click my button in an HTML file, and internal file called eBill.php should load within the div1 element
 
1:21 PM
Complies with the Express view system
Static caching of intermediate JavaScript
Unbuffered code for conditionals etc <% code %>
Escapes html by default with <%= code %>
Unescaped buffering with <%- code %>
Supports tag customization
Filter support for designer-friendly templates
Includes
Client-side support
Newline slurping with <% code -%> or <% -%> or <%= code -%> or <%- code -%>
 
$(document).ready(function(){
$("#button").on('click', function() {
	    $("#div1").load('eBill.php').fadeIn('slow');
      });
});
 
Ah, danke. @rlemon
 
right there in "Features"
 
@SirBT And this XHR to host/eBill.php returns html that you then want to insert into a div?
 
This is what their "Documentation" link on their website leads to: code.google.com/p/embeddedjavascript/w/list -- which is less than helpful
 
1:23 PM
@Mag No it fails to load the
 
@SirBT Or is eBill.php actually a javascript or straight php file?
 
@Magikaas No it fails to load the eBill.php file into the element
 
@SirBT Because if you are running this in javascript, that means you are most likely running locally? So then you can't load a php file locally
 
@Magikaas eBill is a php file
 
@SirBT Is the javascript run locally or serverside? And is the eBill.php file located in the client or on the server?
@SirBT Because if you are running javascript locally, you can not load the php file and have it run the php code inside, in the client
@SirBT Unless if you do an ajax request to the server's eBill.php file and insert the output of that request into the div
 
1:25 PM
@dystroy Sweet
 
@Magikaas eBill.php is locally on my local server
 
@SirBT So it's not local on the client, but on the server, think about a production environment
 
@Magikaas both files are all local on my server
 
@SirBT So you can not run eBill.php in javascript in the browser, unless if you do an ajax request
@SirBT They are only local now, but they will be remote if a visitor gets onto your website
 
Good day
 
1:26 PM
@SirBT That user will not have your eBill.php file on their computer, so you can only run the eBill.php file on the server and then serve the output to the user
@Eugene Moarnin :3
 
@Eugene Psh. We'll see about that.
:-P
 
@Magikaas I get it... So how do I make an Ajax request then. I thought that was what I was doing?
 
Guys, should required directive/controller in angularjs be direct parent of dependant directive?
 
@SirBT Ah I see... I just looked up load and it is an ajax request, do you see the ajax request in your browser's network tab and the output it generates?
 
only for a fraction of a second at times.
@Magikaas only for a fraction of a second at times.
I cant even seem to load a simple text file.. must be something wrong in the code or something
 
1:31 PM
@SirBT Hit the "preserve log" checkbox
 
@SirBT What do you mean only a fraction of a second at times? Do you constantly clear your network tab? It should show the request for the current session until you refresh the page, or check the box mentioned above ^
 
@RyanKinal yeeeeeaaaa. welllll
 
;-)
 
@SirBT Maybe if you add the host to the url in .load, so something like .load(window.location.href + "/" + filename) or window.location.protocol + "//" + window.location.host if you know it's in the root
 
1:33 PM
@SecondRikudo One of the best checkboxes in dev tools history.
 
@RyanKinal inorite
 
@Magikaas just hit the Preservce log check, what do I do next?
 
Another possible competitor: ::hover
 
anyone?
 
@SirBT You click that button you were talking about and check your network tab
 
1:34 PM
@RyanKinal I prefer the old way though. The record button was the "preserve log" checkbox
 
@SirBT To see if the ajax request is fired and what it returns
 
made more sense imho
 
@FlorianMargaine Yeah, I could see that too
@Eugene Are you talking about inheritance of directives/controllers?
 
@Magikaas yes Idid mean only "a fraction of a second at times".
 
@RyanKinal yes.
 
1:36 PM
Hmm. I'm no help there.
 
@SirBT But what do you mean by only a fraction of a second at times? I'm not asking for the response time, but what it returns if you click it and go to "Response"
 
@Magikaas I usually hit the refresh button after updating the code...
 
But I doubt something should inherit from something it depends on.
I mean, unless it actually is a "is a" relationship
(confusing sentences ftw)
 
@SirBT That doesn't mean you can't check the response, especially now that you checked "Preserve log"
@SirBT So I'll ask again, what does it say in the ajax request?
 
@RyanKinal I was talking about required property of directive. I have plnkr code, but I can't seem to make it work the way I intended to.
 
1:38 PM
Hi Guys
 
@udaysagar hi
 
@Eugene Oh. Then I'm of even less use.
 
@Magikaas ok what I mean by: " a fraction of a second at times" is that It will load the requested page (being eBill) but then it disapears. It all happens so fast that I dont get to see it sometimes, but sometimes I do... it displays for a very short time before it disapears
 
@RyanKinal )
 
I have a regex
here it is
        var regex = /^(\d{2})\/(\d{1,2})\/(\d{4}) (\d{2})\:(\d{2})\:(\d{2})$/;
 
1:40 PM
!!s/ve/s/
 
@RyanKinal I has a regex (source)
 
fix'd
 
!!s/s/z/
 
@JanDvorak @RyanKinal I haz a regex (source) (source)
 
Curses!
 
1:41 PM
when I do regex.test('05/4/2014 06:09:34');
it works fine
 
Guys, my code works, can you fix it?
 
but it throws me error when I give
 
@NickDugger let him speak
 
@udaysagar damn you for not using ISO 8601
 
regex.test('05/14/2014 06:09:34');
 
1:43 PM
An error, or does it just... not match?
 
@udaysagar it should match just fine
 
It is breaking from the code and control just comes out of the loop
 
<aside>The folks in the music.SE chatroom are not the most talkative bunch</aside>
 
@Magikaas would it be the information in the Status column that you would be interested in? Because if it is then it shows: 304 Not modified
 
they're listening to music... shhh...
 
1:44 PM
@udaysagar what does it throw?
any chance you're overwriting regex?
 
@canon Well they should share!
 
@JanDvorak regex.test() resulting in false
 
booyah!
 
@udaysagar that's not an error.
 
aha
 
1:46 PM
@Magikaas just refreshed the page and run the code now I am getting 200 ok
 
but if a regex doesn't match, it returns null. You can't dereference null.
 
but @JanDvorak I want the regex to match both
 
It should
 
1 digit and 2 digit numbers
did you get me?
 
@rlemon pff.. 480 GB? That's so last month
 
1:47 PM
but why it isn't matching?
 
!!> /^(\d{2})\/(\d{1,2})\/(\d{4}) (\d{2})\:(\d{2})\:(\d{2})$/.test('05/14/2014 06:09:34')
 
!!> var regex = /^(\d{2})\/(\d{1,2})\/(\d{4}) (\d{2})\:(\d{2})\:(\d{2})$/; regex.test('05/14/2014 06:09:34');
 
it is
 
for 2 digit number
 
@rlemon true
@JanDvorak true
 
1:47 PM
@JanDvorak :P
@RyanKinal haha do you actually use this?
 
hmm, i donno, something has gone wrong with my code
i have the same regex
and code breaks at the same step
 
do youu happen to have a different string to match?
 
well the regular expression works on your sample
 
I am doing
        if(!regex.test(v)) return false;
 
return regex.test(v)
is the same thing
 
1:49 PM
I hope else return true doesn't follow
 
@rlemon no
 
@rlemon not quite
 
@rlemon I haven't yet, but I've considered it
 
@JanDvorak I'm presuming it is followed.
 
@rlemon don't
 
1:50 PM
@JanDvorak but I am.
 
I'm presuming it is dr Livingstone
 
not Dr Strangelove?
 
I should watch that movie...
 
@SirBT Sorry, I'm back. And if you check the DOM in your browser's dev tools (if you have any) what does it say?
 
@Magikaas I am trying to paste an image of Preserve log
 
1:52 PM
@SirBT If you press the button, you should get a new entry into the network tab, or does the button press also refresh the page?
 
@Magikaas how do I do this?
 
@SirBT Try imgur
 
@Magikaas imgur?
 
@SirBT imgur.com
@SirBT Otherwise, just tell me if a new entry appears in the network tab if you click the button that is supposed to load eBill.php
 
@Magikaas file:///home/vincent/Pictures/overstackImage.png
 
1:55 PM
oh my god
Ehm
 
nice image
 
That does not work, it's on your local machine -_-
@SirBT use imgur to upload it and then give the link to th uploaded image, I can't access your computer from here
At least not at this moment
Nor will I ever, most likely
 
@Magikaas Okay it just seems like my AJAX code is wrong or not working for some reason
 
Does DOM manipulation actually work in a non-active tab?
 
@SirBT Okay, so you are not seeing a new entry in the network tab? Then that would mean either the javascript is not run
 
1:57 PM
@Oleg yes
 
I'm trying to remove nodes when user switches between tabs to keep the memory low.
 
@Oleg the DOM is still 'active', meaning it is still updated if it's not active, but I don't know if you can manipulate DOM between tabs
 
The dev tools show that the nodes are removed, but the memory doesn't go down :(
 
@Magikaas opps sorry I thought I had pasted the url to the imgur. sorry i.imgur.com/W8RSQbx.png
 
do you mean the browser tabs?
 
1:58 PM
Yes, browser tabs.
 
@SirBT So the eBill.php is not loaded, have you tried putting a breakpoint on the code that is supposed to run if you click the button, to find out if it's even run when you click?
 

« first day (1348 days earlier)      last day (3616 days later) »