« first day (1687 days earlier)      last day (3255 days later) » 

7:00 PM
@AwalGarg so that you can use the same code in IE, and it will run against the real jQuery
 
@JanDvorak How will jquery fix the async attribute in IE? Also, IE mobile version?
 
won't :-(
but I don't care about IE performance
 
you should, but only IE > 11 ... oh wait :P EDGE !
 
@JanDvorak You can't really reach a "perfect architecture" which suits both old browsers and new cool stuff.
 
@AwalGarg dont waste your time in that either
 
7:03 PM
I don't want to suit IE. I want IE to fail less.
 
write cool shit, if it can be polyfilled - polyfill
@JanDvorak Edge not IE
IE Accepted its failure with launch of Edge
 
guys can someone tell me what the correct way of writing this line to get to the data target would be when i have a hierarchy like this ...
<body class="metro">
<div class="submenu-who">
<header class='masthead'>
<div class='brand-container'>
<a class='slide' href='#' data-url='who-are-musability-music-therapy.html' data-target='overview'>
 
how's Edge doing on standards support?
 
and this line
var url = $("body .slide").attr('data-url') + ' #' + $(this).attr('data-target');
 
@JanDvorak wait for 2 more years when http2 conquers large share of the market, but still not majority of it.
 
7:05 PM
Edge is not doing too great after his fall off stage 2 weeks ago
 
how exactly does a browser know when to use HTTP 2?
 
@JanDvorak upgrade headers
 
= first load is always HTTP 1?
 
@havingagoatit didn't get it
 
@ZahidSaeed i currently have "body .slide" but i don't think that is pointing to the correct place
 
7:06 PM
You mean when someone clicks ".slide" class then ?
 
@JanDvorak It is not a "load" it is a request sent. Header magic occurs, then connection protocol is decided and load occurs.
 
the a tag has a class of slide and the data-target , i want that line of my script to point at that
@ZahidSaeed yes
it is meant to go to the data-target
 
@AwalGarg so, the server flat out rejects to serve an HTTP1 request and tells the browser to retry?
 
@ZahidSaeed previously it was like this before i had to add a time event and replace/add classes
 
7:07 PM
You can simply type the id of the target element in the "href" attribute
 
looking it up
 
@ZahidSaeed $(document).ready(function(){
$("body").on("click",".slide",function(e){
e.preventDefault();
var url = $(this).attr('data-url') + ' #' + $(this).attr('data-target');
$('.tile-area-main').load(url);
});
});
 
like this:
<a href="#div1">Click me and I will take you to the div with the ID of "div1"</a>
 
@havingagoatit how about you use indentation already?
 
@JanDvorak request sent to server, server checks request to see if http2 is possible, if it is possible, everything becomes http2, else http1
 
7:09 PM
No
That's wrong
It wont work
 
it does
 
thanks
 
But what about the method that I told you ?
It's much easier
First create an element and give it an ID
 
it does make more sense what you suggest
 
7:10 PM
Then ?
 
if the element was "divexample"
 
with the ID of "divexample" !
 
> although the first action
after changing the protocol MUST be a response to the initial HTTP
request containing the Upgrade header field.
nice
 
trouble is it is being used over multiple html pages so as it isn't inside the same page it can't be an anchor
@ZahidSaeed this is why i have gone with data-target
 
why are you using data-url ?
 
7:14 PM
it is a seperate content page to minimize file size and make the site more efficient
 
How about this ?
var url = location.href + '#' + $(this).data("target");
 
hmm
trying
can i copy and paste , i don't want to make syntax errors
 
I think you are using the .load method ?
Am I right ?
 
yes
didn't work , loaded the entire html page into it
 
Then this code won't work
 
7:18 PM
agreed
this does work but doesn't seem to recognise the data-target bit it just defaults the same target loaded ..
 
Try removing the blank space with # in your code
 
var url = $("body .slide").attr('data-url') + ' #' + $(".slide").attr('data-target');
ok
if i don't use a space it loads the whole page into it
 
What you want is when the data is loaded into your page, you want to scroll to that specific loaded area ?
 
@havingagoatit You might want to consider looking into using AngularJS, it makes things like you're trying to accomplish much easier.
 
@JeffreyA.Gochin 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.
 
7:21 PM
i am so close though
there has to be some way of just loading the data-target
 
Without reloading the page ?
 
So data-target is the Url you want to load into a div tag?
 
You are making me confused
or the data-target is the target div in the other page that you want to load into the current html page ?
 
And you are using jQuery
 
the data-target is just a ref to a div within a page
yup
@ZahidSaeed correct
 
7:23 PM
It's easy then !
 
and so you want to use a hashbang to goto it?
 
Always on the same page, you are never trying to load another?
 
just to recap this allows a click on any a tag with class slide but just cycles the same div , like it can't find the other divs
$(document).ready(function(){
  $("body").on("click", ".slide", function(e){
    e.preventDefault();
    $(".animated").removeClass('bounceInUp').addClass('bounceOutUp');
    setTimeout(function(){
        var url = $(".slide").attr('data-url') + '#' + $(".slide").attr('data-target');
        $('.tile-area-main').load(url);
        $(".animated").removeClass('bounceOutUp').addClass('bounceInUp');
    }, 2000);
  });
});
html
<div>
      <a class='slide' href='#' data-url='who-are.html' data-target='overview'>
        <span class='element'>Mission and Values</span>
      </a>
      </div>
      <div>
       <a class='slide' href='#' data-url='who-are.html' data-target='music'>
          <span class='element'>Music</span>
         </a>
      </div>
      <div>

<div class="tile-area-main">

<div id ="overview" class="animated bounceInUp"></div>

<div id ="mission" class="animated bounceInUp"></div>

</div>
 
$("#content").load($(this).data("url"), $(this).data("target"));
This should work!
But remember.You must place # sign with each data-target element in html
 
7:25 PM
So you are trying to emulate parallax or a carousel?
 
that would mean that i have to duplicate the statement for all buttons
 
For example
<a class='slide' href='#' data-url='who-are.html' data-target='#music'>
@havingagoatit did it worked ?
 
no
oh hang on
#
 
Do you have a plunr your can share?
 
I told you
 
7:29 PM
you did , it still didn't work
 
And make sure a div of the same id is present in the other file which you are about to load
Once done send me complete code
of html and js
 
yup
@ZahidSaeed how do we make our conversation private ?
 
Ahh. I'm also new here
You have teamviewer ?
 
@ZahidSaeed i can send you a zip
 
ok then
Bring it on
I'll try my best :)
 
7:32 PM
cool ok , where to buddy
i appreciate your time
 
zahid2saeed@hotmail.com
just send the necessary files
HTML file, js file and the file that you want to load
 
@havingagoatit Once you send it then inform me
 
sent
@ZahidSaeed i sent you the css js and the two html files , the code for the menu is at the bottom of menu-buttons.js
@ZahidSaeed just the two pages
 
Let me see
 
7:35 PM
ok
 
Got it
 
great
 
Wait while I debug
 
@ZahidSaeed the only main active menu item is "who are musability" on the main menu , click that and it will bring up the submenu and it is this that i am looking at
 
0
Q: Why does SOP permit cross-origin form submissions?

Awal GargSame origin policy does not prevent origin foo.bar from creating a form with action attribute set to another origin baz.duh and even allows to pragmatically submit this form without the user knowing through non trusted events originating via JavaScript just by loading the page. To solve this issu...

 
7:44 PM
@havingagoatit the code that you sent here was from who-are-musability-music-therapy.html file ?
 
@ZahidSaeed yes
 
@AwalGarg XHR doesn't forbid that either
It just prevents you from accessing the response
 
@ZahidSaeed so from the index file the submenu is called from the other file and then the content is also in that file as well ,
 
@copy wha...
you mean the request will reach the server? @copy
 
And the reason is that the web works like that
Sure
 
7:46 PM
no...
wait, no.
@copy you are kidding me. I don't see any requests being sent to cross origin.
 
See yourself
 
I can't figure out your code
You created these files so you know them better than me
I can tell you step by step
 
crl
How can I generate all possible arrays containing numbers from 1 to 9, only once
 
Just tell me this, you want to load content from the index.html file ?
 
7:50 PM
@ZahidSaeed so index.html loads the main menu on the left and space for content in a class called tile-area-main
 
 
@copy wait I misread you
 
@crl that would be their permutations I believe
 
or do you want to load the other file in the index.html file ?
 
@ZahidSaeed in the other html file is a submenu and some content , i want the submenu to load the content by data-target div into the class tile-area-main
 
7:51 PM
@copy yeah, but that's not the answer I mean. That is what the question is asking: "what is the reasoning behind this way of working"?
 
@ZahidSaeed technically everything is being loaded into index.html
 
@AwalGarg Well, the web always worked like that, and it's being used
 
This data comes from index.html ?
 
...
@copy WHY!!
> Why are you wearing a red shirt?
> Because I am wearing it since morning.
^ this is not an answer
 
It's being used
 
7:53 PM
@ZahidSaeed the data is coming from the other html file
 
crl
@JanDvorak yes indeed, all permutations of [1,2,3,4,5,6,7,8,9]
 
But you gave me only 2 files !!!
 
@ZahidSaeed so if you click on who are music therapy from the index file it will load the submenu from other html file and some of the content also from the other html file
only 2 html files
 
but I should probably make the question more clear
 
But you haven't gave any data-url and data-target attributes to that anchor tag !
 
7:55 PM
@crl given a permutation, can you generate the lexicographicaly next one?
 
@ZahidSaeed it is in the SUB-menu that is loaded from the other page , so when you click on that option you get the seconds menu that is the focus
 
crl
@JanDvorak given one, I can switch 2 elements and get another one
 
@copy updated the question to be more clear
 
@AwalGarg (Invisible and automatic) form submission gives you the same power XHR does
 
I hate my boss, how do I deal with it?
 
7:57 PM
@crl in half of the cases switching the last two elements leads to the next permutation, in half the cases it leads to the previous one
 
Get another job
 
Click on one menu then get the submenu
from the other file ?
 
He's a freaking sociopath. One of the most ruthless and greedy people I've seen.
 
@ZahidSaeed yes
 
mhmm, I don't know how to make it more clear :/
 
7:58 PM
An Army guy ...
 
@AwalGarg And yes, CSRF tokens wouldn't be needed any more, but this is actually a useful feature
 
First remove the setTimeout function from the script
 
@ZahidSaeed it should appear on the left also but within the page and will load the first div from the other page into tile-area-main
 
or comment it atleast for now
 
@ZahidSaeed ok
 
7:59 PM
@copy for what?
 
Do something like this:
 
@AwalGarg OpenID
 
First create a div in the index.html file where the submenu will be placed
 
@copy which is now being deprecated in favor of OAuth :)
 
Probably also other things, but that's the first thing that comes to mind
 
8:02 PM
Secondly make sure that there is also a .tile-area-main div in the index.html
 
@ZahidSaeed tile-are-main is there
@ZahidSaeed the container for the submenu is also there
 
@copy you can put those things in a list and post an answer :)
 
ok good
 
@ZahidSaeed :)
 
$(document).ready(function(){
  $("body").on("click", ".slide", function(e){
    e.preventDefault();
    $(".animated").removeClass('bounceInUp').addClass('bounceOutUp');
    $("submenu_div").load($(this).data("url"), $(this).data("target"));
    $("tile-are-main").load($(this).data("url"), $(this).data("target"));
  });
});
 
8:04 PM
@AwalGarg Or I do something useful with my time
 
@copy like making tetris? :P
 
Make sure you place a # sign with data-target attribute in the html
 
@ZahidSaeed that script is in the menu-buttons.js fle
 
It's not useful compared to answering questions on a large platform :P
 
For example:
data-target="#music"
 
8:05 PM
@AwalGarg I'm not making tetris, but yes, that'd be more useful
 
@havingagoatit Yes
 
@ZahidSaeed yes
 
A good question would be why there is not header to disable this "feature" yet
 
@ZahidSaeed <a class='slide' href='#' data-url='who-are-musability-music-therapy.html' data-target='#music'>
          <span class='element'>Music</span>
         </a>
 
But there is a problem with this, if you give 1 data-target then it will always point to the one element in the other file
 
8:06 PM
emulating x86 in the browser isn't useful either :P
 
And you know that there can only be 1 element with a unique id
 
not technically useful, anyways...
 
@AwalGarg Writing code is always more useful than discussing code or reading about code
 
How about doing something like this
<a class='slide' href='#' data-url='who-are-musability-music-therapy.html' nav-target='#mynav' data-target="#music">
 
@ZahidSaeed ah maybe that is it the a tags all have the same class "slide" but don't have a unique id
 
8:07 PM
It doesn't effect
$(this) will handle such thing
 
!!s/code/useful code/g/
 
@AwalGarg @AwalGarg Writing useful code is always more useful than discussing useful code or reading about useful code (source)
 
If you do that then the 2 lines in your code becomes:
$("submenu_div").load($(this).data("url"), $(this).attr("nav-target"));
$("tile-are-main").load($(this).data("url"), $(this).data("target"));
 
@ZahidSaeed yes but to initialise this it works fine but for every different click i want to bring in different divs
 
But you said that you want to load only a specific div when '<a>' is clicked
 
8:11 PM
@ZahidSaeed i am sending you the entire site , this way it will be easier to see straight away
@ZahidSaeed it is only 8mb
 
I'll try
 
@ZahidSaeed i think it will help
 
@ZahidSaeed sent !
 
Let me see...
Nope
Now i get it
 
8:15 PM
@ZahidSaeed ok so click the main menu and "who are musability" it will load the submenu into place and the div "overview" which is great but if you try the submenu items then you see the problem it is stuck on "overview"
 
Wait it's downloading
 
If I click it, nothing happens
 
so click the menu
the click who
 
crl
perms [] = [[]]
perms xs = [ x:ps | x <- xs , ps <- perms ( xs\\[x] ) ]
 
8:26 PM
@havingagoatit it's not working here bro
 
@ZahidSaeed maybe t is the browser as i haven't tested other browser yet i am using firefox latest and it works fine
 
Blue wrapper come over
and then nothing shows up !
 
yup
oh ??
 
Yes. Nothing shows up !
 
What does bodyParser.urlencoded({ extended:true }) do?
 
8:29 PM
@StevensHaen Google it
 
@ZahidSaeed i dont undrstnad i just tried the file i sent you and it works also
 
I opened index.html file
Clicked on the menu
Choose "Who are musability"
Blue wrapper comes over
and we are done :)
Nothing happens next !
I try it on firefox
 
sometimes it doesn't do it on first click but i bet you have tried it a couple of times what browser are you using ?
 
It works on firefox
But not on chrome
 
ah
i will need to look at that soon
but now you can see
 
8:32 PM
Now I get what you really wanna do
 
YES !
so the overview is just coming up again and again , all i want to do is make it for each data-target or div
 
can anyone find a way to XSS this?
http://www.towc.eu/paletteShapePeriod/vote.php
 
Just give me a couple of minutes
 
@ZahidSaeed no problem sir
 
@havingagoatit There is also some problem with your code
 
8:46 PM
@ZahidSaeed oh right please do explain
 
@AwalGarg How do you remove programs / packages in ubuntu?
 
@Catgocat how did you add them?
 
@FlorianMargaine Using the Software Center, but the packages don't have a "remove" option
 
@Catgocat don't you have a "installed packages" tab or something?
 
I do, check the printscreen
 
8:53 PM
And nothing there?
 
Noup..
 
So if I open my wife's computer and go on Ubuntu software center, installed tab, I won't find a way to remove packages?
 
There is a possibility that I'm blind
 
@ZahidSaeed so what do you think bro ?
 
@havingagoatit see the image below
 
8:56 PM
@FlorianMargaine Got it $ sudo apt-get remove
 
@ZahidSaeed yes that was the problem i had as well , it is selecting the entire page
 
It is also happening because you are appending the submenu each and every time
See your code
You are appending the menu each and every time
 
In Ubuntu in one day, I have used the Terminal more than I have ever used command prompt in Windows..
 
@ZahidSaeed no that is just the main menu options they dont get roladed
 

« first day (1687 days earlier)      last day (3255 days later) »