Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 21 2018 17:11
    @MadLittleMods banned @OmarAlmaqtri
  • Jun 05 2018 23:13
    @MadLittleMods banned @LWSS
  • May 25 2018 16:50
    @MadLittleMods banned @TheRedstoneTaco
Abhi
@abhigk
I am mapping array of objects. and also displaying obj.quantity on browser
I am also passing obj in addQuantity(obj) and subQuantity(obj)
However increment and decrement of quantity is not reflected on browser that obj.quantity
React question
dimtabu
@taburetkin
react answer: you make some mistakes
syedsimanta03
@syedsimanta03


                    <!--Gallery Item-->
                    <div class="gallery-item mix branding vue col-md-4 col-sm-6 col-xs-12">
                        <div class="inner-box">
                            <figure class="image-box">
                            <img src="images/gallery/25b.jpg" alt="css">
                                <!--Overlay Box-->
                                <div class="overlay-box">
                                    <div class="overlay-inner">
                                        <div class="content">
                                            <a href="#
                                            " target="_blank" rel="noopener noreferrer" class="link"><span class="icon flaticon-link"></span></a>
                                            <a href="images/gallery/25b.jpg" data-fancybox="images" data-caption="branding"  class="link"><span class="icon flaticon-magnifying-glass"></span></a>
                                        </div>

                                    </div>
                                </div>
                            </figure>
                        </div>
                    </div>
How can I generate same code block above 5times but with different images number like this one has 25b.jpg. So I am unable to generate this same block dynamically 26b.jpg, 27b.jpg ... and so on. I tried with js
Stephen James
@sjames1958gm
If your version of js supports template strings then replace the fixed values with
${value} then loop over the various values
Shekhar Ramola
@shekharramola
Hi, can someone please give me a piece of advice. I need to built a very heavy, complicated web application with multiple web pages(almost 60 pages).I already have a theme with me. I want to use a framework like angular which could make life a bit easier but that website need very good SEO. using angular universal, it might be possible but it is gonna use jquery and a lot of query selector which will not work in angular universal. so if I go with the plain javascript approach, how am I gonna handle routing and all.
dimtabu
@taburetkin
take a look at backbone.marionette
Abdul Basit
@Abdul___Says_twitter
Hi, is there any way to hide my application's assets in DOM ? let say i have some images on canvas but i dont want to show those images in browser's image section.
nicsachin
@nicsachin
<img src="image.jpg" style="display: none"/> i think this will help
Alecell
@Alecell
Hey guys, any ideal how I improve the readability of this object?
        var routes = {
            get main() { return Route('', {
                customer: Route('/customer/:id', {
                    get cart() { return Route('/cart')() },
                }),
                edit_realty: Route('/realty/:id', {
                    config: Route('/config/:setting', {
                        get look() { return Route('/look')() }
                    })
                })
            })()}
        }
Im building an route manager to my team but this config obj is unredable and I dont know how to improve this
this is the route function:
        function Route(path, children) {
            return function(param) {
                url += path.replace(/:id|:setting/g, param);
                return children;
            };
        }
Shekhar Ramola
@shekharramola
can I return common jquery http response to some other function
I want to write common post method
will pass the url and json data
Stephen James
@sjames1958gm
Since http is a asynchronous you could wrap it in a promise and then use async/await and pass the response back in the promise resolve. The browser fetch function might be an alternative.
Shekhar Ramola
@shekharramola
browser fetch..yes but it do not work in IE?
Stephen James
@sjames1958gm
Possibly not
dimtabu
@taburetkin

@shekharramola

var xhr = $.ajax({...});
mySuperFunction(xhr);

function mySuperFunction(xhr) {
  xhr.then(() => .... );
}

what wrong with this approach?

Shekhar Ramola
@shekharramola
@taburetkin , this is cool but I try to follow DRY(Do not repeat) wherever possible.
dimtabu
@taburetkin
Its not clear what do you want to achieve
Shekhar Ramola
@shekharramola
am I doing anything wrong?
 addDynamicHTML('particularId', data.data[i].title);
function addDynamicHTML(selectedElementId, template) {
  console.log(selectedElementId);
  console.log(template);
  if (document) {
    console.log(document.getElementById(selectedElementId));
    document.getElementById(
      JSON.stringify(selectedElementId)
    ).innerHTML = template;
  }
}
 console.log(document.getElementById(selectedElementId));
above statement will say, it is null though it shouldn't be. just a plain synchronous function
dimtabu
@taburetkin
you can work with dom by js only after dominteractive event
and for some browsers after dom loaded event
Shekhar Ramola
@shekharramola
I am creating dom element dynamically.
like this
    var tdDeliveryTerms = createElement('td');
    addClass(tdDeliveryTerms, 'tableTitle');
    addClass(tdDeliveryTerms, 'fontSize12');
    var particaularDiv = divCreator();
    addClass(particaularDiv, 'fontMedium');
    addClass(particaularDiv, 'title');
    particaularDiv.setAttribute('id', 'particularId');
    console.log(particaularDiv);
    addDynamicHTML('particularId', data.data[i].title);
dimtabu
@taburetkin
document in all browsers is not falsy. so your if is useless
if your DOM not ready, you get null, so you have to wait for document completely loaded for working with dom.
Shekhar Ramola
@shekharramola
couldn't attach an event listener due to performance issue so I tried another way. seems like working.
function addDynamicHTML(selectedElement, template) {
  console.log(selectedElement);
  console.log(template);
  var text = document.createTextNode(template);
  selectedElement.appendChild(text);
}
dinesh
@1532j0004kg

@1532j0004kg
getJson inside for loop issues
I found some articles but still the answer is not getting correctly because the value is keep on changing ...

for example: sometimes 0 1 and sometimes 1 0

Can anyone tell how to solve!
lilalienx
@lilalienx
Hello community new to the room frontend dev html, css, bootstrap, javascript nerd any one doing a live coding in JS i am down to watch and get into projects.
jasper917
@jasper917
Hello community new to the room frontend dev html, css, bootstrap, javascript nerd any one doing a live coding in JS i am down to watch and get into projects.
dinesh
@1532j0004kg
All are I hope @jasper917
syedsimanta03
@syedsimanta03
OS related question what u prefer for web and app dev- apple Mac os or Linux?
EuphoricPenguin
@EuphoricPenguin
@syedsimanta03 Since I mostly dabble in NodeJS, all platforms are equally suited. Linux is a good option for server-side, and Windows has worked fine for me as my dev platform.
syedsimanta03
@syedsimanta03
windows keep crashing all the time when working on android dev
@EuphoricPenguin should I install linux on external HDD or on a virtual box?
EuphoricPenguin
@EuphoricPenguin
@syedsimanta03 You could always dual boot on your existing HDD if you have enough space.
EuphoricPenguin
@EuphoricPenguin
If not, an external HDD for vo
*boooting is ok.
VMs can be convenient, but it depends on what you want to do. If you need to flash stuff to boards/other hardware level stuff, the software can complicate things a great deal.
syedsimanta03
@syedsimanta03
@EuphoricPenguin I will then install linux on my HDD. So basically the HDD will be devided into 2 partitions. 300gb for linux development. 700gb for my necessary files
dimtabu
@taburetkin
Does anyone knows how to avoid this behavior?
https://s.codepen.io/dimatabu/debug/YzKpZGV/bZMQWELzJQYA - try it with chrome, its a codepen in debug mode
in codepen frame there is no such issue: https://codepen.io/dimatabu/pen/YzKpZGV
ns26
@ns26

Hey guys, looking for a JS medior/senior to give me some pointers on a script. The script is in a private/local (non-store) Chrome extension that highlights certain iframes with CSS in try/catches (to bypass some basic security issue). Usecase is an online CRM system called Exact.

Link to the main script here: https://pastebin.com/e3w8rXqX

What I'm trying to add is: if value 123 is found while highlighting ID list A then also highlight ID list B but only with a border-property. In the scenario where there is the same ID in list A & B it needs to properly apply both highlight functions.

I've tried all day yesterday to make it happen in numerous of ways but without any luck. I'm just a student that picked up a slightly overambitious internship project :p I can do basic debugging but I'm definitely a junior..

Mahi
@arbitrarymahi
HI
How do I wait till my XHR returns the response? Currently I get reuest.status = 0 and the code execution moves on but I want to wait until response is recieved.