Do you include multiple js files or some minified/concatenated build? You could look into the developer tools to see how many jQuery's got included, in Chrome all included files are listed under the resources tab.
You can't control the lightbox script? If it's the one which includes a jQuery not compatible with the other scripts this will be a tough one.
Do you include multiple js files or some minified/concatenated build? You could look into the developer tools to see how many jQuery's got included, in Chrome all included files are listed under the resources tab.
You can't control the lightbox script? If it's the one which includes a jQuery not compatible with the other scripts this will be a tough one.
There is the slick.min.js, but I can't see anything there that would conflict with plain Jquery. Especially since slick is dependent on jQuery. Maybe?
And sadly, no. A vast majority of my problems are due to the fact that I have to build widgets and pages inside of a CMS that includes a ton of global plugins. I can't style lists, for instance, without every css declaration being tagged !important.
The .lightbox is just the old school lightbox script that has been integrated throughout the site. I had to go in and pull the initiation script with Firebug to use it separate from the Wordpress-esque management system.
I would understand why if none of the elements fired. I can't understand why 2 others, dependent on jQuery would, but not a third. It has to be the slick.min.js, right?
Don't sell yourself short, but don't be too picky with the jobs: it's kinda important to get some experience, even if you were totally great developer from the start. Also don't stop learning new things.
I had to ditch all jquery implementation. There is a jQuery 1.4 that is globally applied throughout the site. I don't know how to 'kill' that on one page, but it's something I'll definitely have to learn going forward.
Thankfully, angularUI works just fine. Was able to use that with a severely cut down bootstrap css base to make it work.
Nobody here understands, but y'all must know the feeling of solving something that took days to fix. It's a great feeling.
I had to do some Javascript test to find out how much a list gets nested.
My answer was
Code:
function aFunction(){
return 1 + $("ul, ol").find("ul, ol").length;
}
The + 1 is for the initial ul/ol tag it finds.
Turns out it was wrong though despite being correct for the test cases they provided. Only after submitting it did I find out it was wrong (or not the best it could be). I probably needed to do a math.max to find out the max nested elements.
I had to do some Javascript test to find out how much a list gets nested.
My answer was
Code:
function aFunction(){
return 1 + $("ul, ol").find("ul, ol").length;
}
The + 1 is for the initial ul/ol tag it finds.
Turns out it was wrong though despite being correct for the test cases they provided. Only after submitting it did I find out it was wrong (or not the best it could be). I probably needed to do a math.max to find out the max nested elements.
So you want to know how deep the lists on a page go at a max? You have to iterate over every list in some way, of course.
I don't know how you approach the search for a job. Sometimes companies are in need of juniors, and if there is some sort of mentor you can bug with every question you have, and who reviews your code, problems like the one above will be easy to solve after some time.
I for example started my career after getting my diploma (in a pretty much completely different profession) with a traineeship, tried to learn as much as possible from my colleges and coded in my spare time.
So you want to know how deep the lists on a page go at a max? You have to iterate over every list in some way, of course.
I don't know how you approach the search for a job. Sometimes companies are in need of juniors, and if there is some sort of mentor you can bug with every question you have, and who reviews your code, problems like the one above will be easy to solve after some time.
I for example started my career after getting my diploma (in a pretty much completely different profession) with a traineeship, tried to learn as much as possible from my colleges and coded in my spare time.
Just how many lists are nested in a ol/ul. So my thinking was to get any element with a ul/ol tag then inside it find another ul/ol tag to show they're nested. Then count it.
Has anyone messed around much with the angular 2 beta?
Is it any good?
We are thinking about new technologies for a future project and Angular 2 came up as a possibility. Is there any word on when the full release will be?
I had to do some Javascript test to find out how much a list gets nested.
My answer was
Code:
function aFunction(){
return 1 + $("ul, ol").find("ul, ol").length;
}
The + 1 is for the initial ul/ol tag it finds.
Turns out it was wrong though despite being correct for the test cases they provided. Only after submitting it did I find out it was wrong (or not the best it could be). I probably needed to do a math.max to find out the max nested elements.
Well, I know what I did wrong in that question. I should iterate through the child elements of the list and hold the value it finds. Then move to the next child element, count how many are nested in there then compare the two numbers.
I don't know why the test cases for the exercise didn't take account for that but it's probably something like "you should test all possible cases" type thing.
Just how many lists are nested in a ol/ul. So my thinking was to get any element with a ul/ol tag then inside it find another ul/ol tag to show they're nested. Then count it.
And I guess my Javascript or logic is bad. Any tips to improve? I've only been using Javascript mostly for front-end UI elements on websites and not really any exercises like that.
And I guess my Javascript or logic is bad. Any tips to improve? I've only been using Javascript mostly for front-end UI elements on websites and not really any exercises like that.
Easy first step is to stop relying on jquery. Most of the time you don't need it, and other times it's useful to know what it's doing because you might be abusing it. You'll probably learn a lot about how certain things work.
I have minimal experience with jQuery so I wrote a solution to see what it was like:
Code:
function maxDepth(entry) {
// Get every sublist
var subs = entry.children('ul, ol');
// If there are no sublists, return 0
if (subs.length === 0) {
return 0;
}
else {
// Get the maxDepth of every sublist and put them into an array
var depths = [];
subs.each(function() {
depths.push(maxDepth($(this)));
});
// Get the maximum of the depths
var max = Math.max.apply(null, depths);
// Return
return max + 1;
}
}
console.log(maxDepth($('.entry')));
EDIT: Looking at that codepen, it's evident I have no idea how flexible jQuery is.
This question would be great for Stack Overflow, but I like you better.
What would be the best approach to adapt my current WordPress site to a full-on JS frontend via its REST APIs?
I gave a bit of a thought about it, and these are the possibilities that came to my mind:
- Leave everything as it is (WP on the root folder) and create a JS theme, but then maybe my routing would somehow conflict with the .htaccess or something.
- Move WP out of the way, change its theme to a simple redirect page to the actual frontend to prevent people trying to read the site on the wrong URL, and create the JS frontend in the root folder.
Both ways seem viable to me, but like, I would lose some plugins capabilities (YOAST SEO in the first place, I guess I'll have to hardcode its meta tags and whatnot getting the data from the posts' custom fields, hoping they won't change the fields names).
Also I guess I'd have to create a route system to mimic the current permalink structure to avoid losing 7 years of Google crawlings.
and also I'd have to write a way to keep users authenticated on both sides of the app, and the commenting system, and, and, oh god...
This question would be great for Stack Overflow, but I like you better.
What would be the best approach to adapt my current WordPress site to a full-on JS frontend via its REST APIs?
I gave a bit of a thought about it, and these are the possibilities that came to my mind:
- Leave everything as it is (WP on the root folder) and create a JS theme, but then maybe my routing would somehow conflict with the .htaccess or something.
- Move WP out of the way, change its theme to a simple redirect page to the actual frontend to prevent people trying to read the site on the wrong URL, and create the JS frontend in the root folder.
Both ways seem viable to me, but like, I would lose some plugins capabilities (YOAST SEO in the first place, I guess I'll have to hardcode its meta tags and whatnot getting the data from the posts' custom fields, hoping they won't change the fields names).
Also I guess I'd have to create a route system to mimic the current permalink structure to avoid losing 7 years of Google crawlings.
and also I'd have to write a way to keep users authenticated on both sides of the app, and the commenting system, and, and, oh god...
Most WP blogs would function better when served as a static HTML. You need to run PHP, MySQL and Wordpress just to show your bio and contact info? Remove all this overhead and make your page load 20x faster and with no security risk
This question would be great for Stack Overflow, but I like you better.
What would be the best approach to adapt my current WordPress site to a full-on JS frontend via its REST APIs?
I gave a bit of a thought about it, and these are the possibilities that came to my mind:
- Leave everything as it is (WP on the root folder) and create a JS theme, but then maybe my routing would somehow conflict with the .htaccess or something.
- Move WP out of the way, change its theme to a simple redirect page to the actual frontend to prevent people trying to read the site on the wrong URL, and create the JS frontend in the root folder.
Both ways seem viable to me, but like, I would lose some plugins capabilities (YOAST SEO in the first place, I guess I'll have to hardcode its meta tags and whatnot getting the data from the posts' custom fields, hoping they won't change the fields names).
Also I guess I'd have to create a route system to mimic the current permalink structure to avoid losing 7 years of Google crawlings.
and also I'd have to write a way to keep users authenticated on both sides of the app, and the commenting system, and, and, oh god...
Looks to me more like some sort of mobile/desktop switch than a permanent redirect?
Using the various widths you can get out of JS as a switch is rather shaky.
I've seen solutions via the request header on the server-side, but i think those are not a 100% working solution, too. I think the Surface tablets are a b*tch in this regard.
But for a basic redirect, say from an old page that doesn't exist anymore to a new one, runningjoke has the right solution. Due to working with Joomla, i place those in the .htaccess file of the CMS. Even has a predefined block for those.
Several. This is similar to how NeoGaf used to do mobile redirection and it's terrible.
1) In order to redirect you need to get make the request, the server serves the page, you get and parse the page, you make a second request, the server serves you a page and you render it. This has extreme latency not to mention it'll actually flash in the middle of it. You always, always, always want to optimize the number of requests made and 2 round trips is unacceptable.
2) This is not responsive. If I had my Chrome window at a small size it will kick off the redirect which is likely not desirable especially since when I drag it out again I'll be on the mobile page. Likewise a mobile device moving from portrait to landscape and vise-versa may not work correctly.
Ideally you should have no redirect at all. You should simply alter the layout with media queries. For other sorts of redirects those should be done on the server itself.
Several. This is similar to how NeoGaf used to do mobile redirection and it's terrible.
1) In order to redirect you need to get make the request, the server serves the page, you get and parse the page, you make a second request, the server serves you a page and you render it. This has extremely latency not to mention it'll actually flash in the middle of it. You always, always, always want to optimize the number of requests made and 2 round trips is unacceptable.
Okay, all good feedback. I hadn't even thought of window resizing. What would be a smarter way of doing a desktop to desktop redirect? Basically, due to the way everything is set up, I have to have two separate pages for the same content. One is bare bones and gets pushed to an app. That version must still exist. While it won't be where anybody can find it, it'll turn up in searches. I'm trying to make something simple that will send somebody on desktop only to another page on the site.
That was the solution that was within my growing, but still limited knowledge of JS. I actually thought that was pretty clever.
Okay, all good feedback. I hadn't even thought of window resizing. What would be a smarter way of doing a desktop to desktop redirect? Basically, due to the way everything is set up, I have to have two separate pages for the same content. One is bare bones and gets pushed to an app. That version must still exist. While it won't be where anybody can find it, it'll turn up in searches. I'm trying to make something simple that will send somebody on desktop only to another page on the site.
That was the solution that was within my growing, but still limited knowledge of JS. I actually thought that was pretty clever.
Why would it be searched? You can disable search engines from caching pages: https://support.google.com/webmasters/answer/93710?hl=en. If it's your own custom search you should work on filtering it there. If this is a problem your next best bet is to have the server check the user agent and only let it pass if it matches the app's user agent since presumably you can control that.
Hey guys I have a question. I'm still in the market for a new laptop and I think I have the funds to acquire one now. So my question is what sort of specs are optimal for web developer who is also going to be using photoshop and illustrator, without doing the most?
This question would be great for Stack Overflow, but I like you better.
What would be the best approach to adapt my current WordPress site to a full-on JS frontend via its REST APIs?
I gave a bit of a thought about it, and these are the possibilities that came to my mind:
- Leave everything as it is (WP on the root folder) and create a JS theme, but then maybe my routing would somehow conflict with the .htaccess or something.
- Move WP out of the way, change its theme to a simple redirect page to the actual frontend to prevent people trying to read the site on the wrong URL, and create the JS frontend in the root folder.
Both ways seem viable to me, but like, I would lose some plugins capabilities (YOAST SEO in the first place, I guess I'll have to hardcode its meta tags and whatnot getting the data from the posts' custom fields, hoping they won't change the fields names).
Also I guess I'd have to create a route system to mimic the current permalink structure to avoid losing 7 years of Google crawlings.
and also I'd have to write a way to keep users authenticated on both sides of the app, and the commenting system, and, and, oh god...
As someone else said, this is a perfect use case of the WordPress REST API. You'll want to get the latest WP Rest API plugin because even though WP 4.4 introduced the WP Rest API to core, it's missing a lot of the latest features that are constantly built into the plugin:
This gives you an API to attach to nearly any part of your wordpress site, and it's awesome. THe blogs section of our corporate website is built on WP, and the Rest API gives us a lot more flexibility to share and pull content from other service-driven areas and web applications that we run.
Hey guys I have a question. I'm still in the market for a new laptop and I think I have the funds to acquire one now. So my question is what sort of specs are optimal for web developer who is also going to be using photoshop and illustrator, without doing the most?
If this is too expensive maybe an Air, never used one for work though.
For Windows: I don't know. Anyway be sure to have enough RAM, a fast SSD and a great Screen. A beefy cpu is preferred, too. It does not have to be the fastest quad core, but I would stay away from slow ultra low voltage cpus.
As someone else said, this is a perfect use case of the WordPress REST API. You'll want to get the latest WP Rest API plugin because even though WP 4.4 introduced the WP Rest API to core, it's missing a lot of the latest features that are constantly built into the plugin:
This gives you an API to attach to nearly any part of your wordpress site, and it's awesome. THe blogs section of our corporate website is built on WP, and the Rest API gives us a lot more flexibility to share and pull content from other service-driven areas and web applications that we run.
Thanks, bookmarked the tutorial for this weekend
And yeah, I'm comfy with Angular, but I mostly need to understand the basic concepts in how to convert the good ol' WP theme workflow into a JS frontend.
What I'm most concerned about, is how to make the plugins that hook onto the theme, work without a theme.
For example, as I was saying, my site relies heavily on Yoast both because I don't have enough SEO skills, nor time to adapt any hardcoded meta tags every time FB or Twitter change their inner workings, and because I actually use its meta_description custom field as the post excerpt in the homepage.
I guess the REST API would allow me to retrieve the custom fields, but then I'd have to hardcode those in the proper meta tags.
In the long run, I guess that could become a problem. And in the short run, I don't really know if the FB scraper waits for the JS to render the variables into those tags.
Also, if I move WP out of the root folder, I guess I'd have to leave the WP URL as it is now, in order to let Yoast (or whatever plugin I'm using) generate the sitemap with the correct paths, AND let Google know that I changed the sitemap location (if it's even possible, as thanks to my office internet, ATM I simply cannot internet, except GAF sometimes, for some reasons ).
All of this is giving me a massive headache, but at the same time, it feels super challenging and fun that I just can't wait to have a bit of free time from work to start coding it!
If this is too expensive maybe an Air, never used one for work though.
For Windows: I don't know. Anyway be sure to have enough RAM, a fast SSD and a great Screen. A beefy cpu is preferred, too. It does not have to be the fastest quad core, but I would stay away from slow ultra low voltage cpus.
I was looking into MacBooks and the MBP are too expensive for me right now but the Airs are doable. However the ones in my price range have an i5 processor at best. Can I work with this or go for an i7?
I was looking into MacBooks and the MBP are too expensive for me right now but the Airs are doable. However the ones in my price range have an i5 processor at best. Can I work with this or go for an i7?
Most WP blogs would function better when served as a static HTML. You need to run PHP, MySQL and Wordpress just to show your bio and contact info? Remove all this overhead and make your page load 20x faster and with no security risk
I saw a refurbished one from apple for 1,099 with the retina display, 2.7 GHZ i5 processor, and 8 gb of ram . I mean it's a little out of my budget but it's doable I just may need to save a little more. Do I absolutely need the retina display tho?
I saw a refurbished one from apple for 1,099 with the retina display, 2.7 GHZ i5 processor, and 8 gb of ram . I mean it's a little out of my budget but it's doable I just may need to save a little more. Do I absolutely need the retina display tho?
The retina displays are nice and you'll never buy something else after using one for a while, but they are not needed of course. What you may need is the better hardware compared to an Air, as they don't put the ultra book like CPUs into the pros.
Be careful though with a retina. The spec you buy is what you will use in this machine forever. Most of the internals can't be upgraded (RAM for example)
The retina displays are nice and you'll never buy something else after using one for a while, but they are not needed of course. What you may need is the better hardware compared to an Air, as they don't put the ultra book like CPUs into the pros.
Be careful though with a retina. The spec you buy is what you will use in this machine forever. Most of the internals can't be upgraded (RAM for example)
So starting to feel a bit more like a programmer. For what feels like the 1st time I managed to figure out JS code on my own. Working on the random quote machine for FreeCodeCamp and I called a quote api and displayed it on the page. Then made an if statement to check if there's an author and if the field is blank then list the author as unknown. Also got my business cards so maybe that will help me in the job search. Granted I'm facing a uphill battle as is since I'm still going for a home run on mainly my soft skills since I don't have the fat portfolio to show off lol. Though I am at the point where I wanna be working on projects and staring at a blank text editor is not nearly as terrifying as it once was.
So starting to feel a bit more like a programmer. For what feels like the 1st time I managed to figure out JS code on my own. Working on the random quote machine for FreeCodeCamp and I called a quote api and displayed it on the page. Then made an if statement to check if there's an author and if the field is blank then list the author as unknown. Also got my business cards so maybe that will help me in the job search. Granted I'm facing a uphill battle as is since I'm still going for a home run on mainly my soft skills since I don't have the fat portfolio to show off lol. Though I am at the point where I wanna be working on projects and staring at a blank text editor is not nearly as terrifying as it once was.
Nope. Too poor to do that and not even sure if it's necessary to go back to the CC I went to or a 4 year. So have been completely self taught and have built up a network on my own.
I mentioned this in the programming thread but I still can't believe I'm even trying to land a dev job already. Have mainly gotten by on my hustle and thought I would only have a shot if I had a massive portfolio of projects. Also fees like a long geting a job is a longshot with no degree. Instead it seems my hilarious lack of projects and experience is good enough lol. Have gotten 5 votes of confidence to start looking. And this is after telling those devs how little I knew and having like no projects done at the time aside from winning prizes from a hackathon. Even other gaffers have said to stop doubting myself and start job hunting. But yeah now I'm just glad I feel like I'm actually making progress and I'm not as stupid as I thought I was.
edit: Also just noticed there's a typo on my business cards . Guess that's what I get for not double double checking. Instead of linkedin.com/myprofile its linkedin/com/myprofile. Guessing they're still usable?. Don't want to reprint .
If you're interested in web dev, create a simple API, write a simple front end to interact with the API, and use a database. Then work on scaling horizontally. Architecting such a system will provide you with valuable knowledge. Create a Wiki, for example. Pick whatever scripting language you want for the back end. You seem comfortable in Javascript, so maybe NodeJS.
In addition to what mooooose said, there are also tons of open APIs out there that you can use to make a project. Twitter, Twitch, Github, Forecast.io, etc. It doesn't have to be anything spectacular, just do something you're interested in.
In addition to what mooooose said, there are also tons of open APIs out there that you can use to make a project. Twitter, Twitch, Github, Forecast.io, etc. It doesn't have to be anything spectacular, just do something you're interested in.
If you're interested in web dev, create a simple API, write a simple front end to interact with the API, and use a database. Then work on scaling horizontally. Architecting such a system will provide you with valuable knowledge. Create a Wiki, for example. Pick whatever scripting language you want for the back end. You seem comfortable in Javascript, so maybe NodeJS.
Thanks for the tips guys. Good news is I've gotten experience with APIs recently. Worked with a friends and learned how to call an API for the 1st time through that. Then now working on a random quote machine and I managed to figure out how to call a quote Ali and display it on the page on my own for the 1st time. Since previously had lots of help getting my 1st Api project off the ground and running.
Speaking of which what you guys think makes a good portfolio? So far I have a couple of small sites I developed that demonstrates basic understanding of HTML CSS and JavaScript and one where I'm using databases and php.
Speaking of which what you guys think makes a good portfolio? So far I have a couple of small sites I developed that demonstrates basic understanding of HTML CSS and JavaScript and one where I'm using databases and php.
If you're a back-end dev, then yeah it's definitely the scale and variety of languages / projects you've worked on.
If you're a front-end dev, the portfolio itself is what seems to matter the most. Something with high production values would compensate for any lack of actual content.
IMO the best is a bit of both, showing you can code good code, and make it look amazingly good when you're able to make all the choices. Having code to show (through github for instance) is always a plus. I tell my (beginner) students that it doesn't matter if they don't have live websites to show as long as they've got code to show nonetheless.