Everything posted by jpeters8889
-
Highlight table TD / Column
If the input element is a direct child of the wrapping div, then there's no need for any javascript or complex css rules, you can just target it using the :has() modifier Just quickly did this in a couple of minutes as an example (May need to copy the link into a new tab) https://codepen.io/jpeters8889/pen/yyLLOwW
-
Survey results: AI use in Web Design
Personally I think AI is a massive fad, I have absolutely no interest in using it at all, I much prefer hand writing all my code and see no need for it in any other use case.
-
Best way to send hundreds of variables from page to page without taxing the server in PHP (or JavaScript)?
You said you're using PHP and MySQL, could you not have a table to store these customisations /settings/variables in as JSON, perhaps with an UUID as the PK, a text or json column type for the settings, and a created_at and updated_at timestamps. That way you can just keep the UUID in the users session, and then in PHP you can get the settings out of the table, run them through json_decode() and you've got all your settings to use server side and pass to the view layer for the customer. You could then have a task running on the server regularly to delete settings that are older than X hours to keep the table size low and also avoid storing data any longer than you need to.
-
Managing Websites
You very rarely get people, and even more so professional companies and agencies who use FTP these days, or editors that save directly to the server. Instead you'd use version control software, like Git, then you'd pull down the source code to your machine from a resource like github/gitlab etc, do your changes, and then push to back to github, then all your changes are in version control, with history, diffs, and you can even revert if something goes wrong. Then on the push, a CICD integration would take over and deploy the website to our the server. Of course there's steps missed out there, such as automated testing, build steps, deployment to a staging server, QA. I honestly don't know how I'd cope these days without all of the above if I had to go back to the dark days of uploading everything manually!
-
Split Domain host and Web host
I've never had hosting and domains on the same provider, I've used 123reg for domains for about 15 years now, but I'd never imagine using them for hosting. For the past 6, 7, years or so I've been using digital ocean droplets, so I can configure and set them up myself, and before that it was different UK based VPS providers, again so I had as much control as possible. When I was younger and first got into web dev (Been doing this since I was 12 in 2001) I just used a random shared host that you could find anywhere, can't remember about domains though. but from about 2013 on wards I started using VPS, and then later Digital Ocean as I mentioned above.
-
Resources required for Classifieds startup
As someone who is a lead developer at one of the largest and one of the most popular independent Dealer Management Software providers in the UK, I can only echo what was said above, APIs will be key, over the past few years I've been working here I've worked with some very good APIs with excellent docs, and some very bad ones, unfortunately a lot of advertising companies we feed to, and even some dealerships who want feeds of their still prefer to have a CSV sent to their server via FTP in a standard DMS format, and some dealers prefer to feed us in the same format, CSV... fortunately a lot are moving to JSON APIs now though which makes the integrations easier.
-
Number plate search in website
I work for a company that provides software to car dealerships, so we do a lot of vehicle lookups, and we've got a couple of different providers we can use depending on the product, the main provider we use though is AutoTrader, but it isn't free, we're charged for every lookup, which is then part of the fee the dealers pay us every month for our services.
-
Photoshop
Photoshop is nowhere near as expensive as it used to be, years ago and when I was younger I couldn't afford the massive price for Photoshop and pirated it, I think I pirated every version from Photoshop 6 back in the early 2000s up until probably around 2015 when I switched to Ubuntu for a few years and Adobe don't make products for Linux. During that time though I found https://www.photopea.com/ which is basically Photoshop but built in the browser, very powerful, and can open and save PSD files. These days I'm on Mac and pay I think £10 a month for Photoshop and Lightroom, which is barely anything, but mainly for photography purposes rather than web design like when I was younger, but if it was still £500 or whatever it was, I'd struggle.
-
How do I add the checkbox results to my PHP Contact Form please?
Depending on what version of PHP you're using and how strict the errors are set at, it could be failing because in the 'off' state, $_POST['sub'] doesn't exist, so PHP is trying to find a value with the key of 'sub' in the $_POST superglobal, but it can't, and in that case the script is failing. One thing you could do to see this is right after the opening PHP tag, temporailly add var_dump($_POST); die; That will dump the entire output of the $_POST superglobal on the page, so you can see exactly whats going on, in the sub 'on' state, then it will be there, in the 'off' state, it wont. There's a few ways you can fix this using the Null Coalescing Operator, https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.coalesce, instead of $sub = $_POST["sub"]; - do $sub = $_POST["sub"] ?? 'off'; - that will default it to 'off' if its not set. Finally, if during local development you're getting 500 errors and you don't know why, then error reporting is turned off in your php.ini file, to get PHP to display errors temporarily, add this snippet to a file, but don't forget to remote it when you're done, you never want to display errors in production! ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
-
Axios query
When you do the console.log you're adding the JSON object to the string of Axios Response, so the JSON object is being converted to a string, hence the object Object. If you do it as two seperate lines, like console.log('Axios Response'); console.log(response.data); Then it will be outputted as the actual object. With it being an HTTP Request though, rather than outputting it into the console, what I'd do is open the Network tab of the browser development tools, and select the XHR tab, and then the request will appear in there and you can inspect the full response body there without having to log it.
-
Whats the best way to check large css file for parts breaking up the css?
I think most CSS is actually written as Sass/Scss/Less etc these days and then compiled down to CSS through an automatic build tool like webpack, so if there's any errors then it won't compile down and they would be an error in the console. For viewing the website as responsive, you can just use the F12 dev tools built into most modern browsers, it will let you display the website at a particular size, and let you inspect the style rules applied at that size, toggle them, edit them in the browser to experiment with what they look like etc. I can't imagine doing any form or web dev or designing without writing something like Scss, having a build process and error checking, and using browser dev tools to tweak and inspect a page
-
Do people here work from home now?
I've been working fully from home since last Wednesday, I work for a company with ~100 employees, around 25 of them are developers, plus 15 working on the web front end, but the rest vary from customer care, to marketing, sales, data analytics etc, most people have laptops, and a few in the tech team take them home every night for any emergency out of hours work, myself included, but the vast majority in the business don't do any work outside of the office. On Tuesday last week the entire company planned on how we're going to work from home, with some just taking laptops home, some taking desktops, monitors, phones, even office chairs home, and then through Wednesday, Thursday and Friday everyone began the transition to working from home. For me, I've just set up on the kitchen table because unfortunately I don't have any desk space at home, usually I'm just sat with laptop on my knees, but for my actual paid work I'm sat up on the table with my laptop and laptop stand, a 15.6" USB portable monitor, plus my mouse and keyboard, so to give me some sense of being at a desk, then when the work days over I pack it up and later on when I'm doing personal work I'm back on the sofa, this way I don't procrastinate too much or get too distracted during working hours. With regards to communication, in our mini team (5 of us) we have a 30 minute daily standup video chat on Microsoft Teams every morning, just to keep the interaction up and seeing each others faces, and then this gets reported onto Slack for the full development team to see by the team lead, and we have a 2 hour sprint planning meeting every Monday morning, the first one of which we did remote was yesterday. In the office we're always available on slack for text communication, and that hasn't changed. On the other hand my partner is a Slimming World consultant, and last Tuesday in between her two groups it was announced that all groups are postponed due to the pandemic, which left her a little stuck, however since then a lot of work has gone into place and starting yesterday they've moved onto 'virtual' groups over Zoom, again to keep the groups going and the social interaction for any members who might live alone and don't get much interaction.
-
highlighted areas on british isles map
I use this https://www.fla-shop.com/products/html5/europe/uk-ie-counties/ on one of my websites, its split into all the counties in the UK and is very customisable. If I remember correctly they offer other maps too. We use it on a listing page where each county in the UK has various entries, and each county has a landing page, hovering on the county displays a tooltip with a quick overview. We only display the map on larger screens too, the page its on has a layout switcher for the map and a list of counties with the same overview, on screens under 750px wide we show the list by default, and on larger screens where the map is more usable and the user can hover over the counties we show the map by default, but the user can switch between the two views easily.
-
Where should one put the JavaScript: in the <head> or <body>?
I've always put any JavaScript right before the closing </body> tag, I'm not 100% sure on the reasoning but I think its because if you JS alters any of the HTML or the DOM, then if its in the head then the JS is downloaded and potentially executed before the HTML has actually rendered, and then the JS will have no effect. Saying that though there has been situations where I've had to put a JS file in the <head> but its rare.
-
How much free time do you have as a web designer/developer?
I work 8:30 - 4:30 on days I get the train to work, and 8-4 on days I drive, so with travel time I've out of the house from about 7:30 - 5, when I get home from work I have my dinner (Which is usually ready) then get a shower, then from about 6pm, maybe a little before I'm working on personal development projects usually for 2, 2 and a half hours, then I go upstairs to bed with my partner and we'll watch a film or a couple of episodes of a tv show, then after that for me its either read, play on the xbox, play on my phone, watch youtube, or some combination for an hour or so, then in bed at 11ish, and do it all again the next day when my alarm goes of at 7pm! I have a subscription to Laracasts through work, so when there's a new video posted on there I watch that, usually at night in bed on my phone. Weekends it varies, I could go out for the day, or just a few hours, or I could spend the vast majority working on personal projects like I did this past weekend.
-
I just can't do it
I'm the lead developer of a public facing JSON API at the company I work for, this API is currently having new endpoints and functionality added for an App we are developing for our customers, one of the new features is for our customers to upload videos to the app, these then goes through to our API, and we then send the videos to YouTube, and finally, we send an email or text to our customers customer informing them they've been sent a video, which is hosted on a page on the the customers website. When I saw the brief, and even now when I'm writing the technical requirements for the endpoints, the format, body etc, I'm sat here thinking how the hell am I going to do this? I've got absolutley zero experience with processing videos though uploads, especially from a mobile device, chunking the video, loss of signal, very long (time wise) requests, but rather than saying to my manager I can't do this, I'm researching, creating proof of concepts, experimenting, until I'm comfortable I can do it, and I can do it right.
-
Website Speed Suggestions!
Its not Wordpress, but on custom build I'm working on, for getting assets I've got all my 'critical' / 'above the fold' CSS in the head of my site, and then all the other CSS in an external file, all minified and tidied up with webpack obviously. For Javascript I've got a vendor.js that contains any code used by external modules (NPM) which is heavily cached, then a core.js file which contains custom built side wide code used extensively, which also includes a custom built router and library loader written in Typescript which loads a page specific js file only when needed, it does result in having a fair few compiled Javascript files, but then the contact page for example doesn't have a load of code it doesn't need from a checkout page for example. I've also got FontAwesome loaded in by NPM but using a custom icon set so it only pulls in the dozen or so icons I actually use rather than the entire library, and then on the client side it converts them all to SVGs when loaded in the browser. From an image point of view, my larger 'header' images, such as a blog header image, I've got them using a 'resizable' class, which then I've got a bit of Typescript that hooks onto them and loads the correctly sized image for the viewport using a predefined set of image widths, starting at the smallest size first, then on my image server the image will be resized and cached at run time by a PHP script, so there's only one large 'master' image on the server, but the PHP script will serve and cache the image returned at 300px width for example for mobile screens to save loading a 1200px image. All of my assets are also stored on a CDN server on the network which again is heavily cached during deployment unless a files hash has changed at which point the cache for that single file is busted. The site is still a WIP but is nearing completion and I have noticed a speed increase from the current version using more 'traditional' CSS/JS/Image management on both local development and on the external development server.
-
[Easy] AddEventListener - How do I use "This"?
An elements ID attribute should be unique per page, you should never have more than one element on the page with the same ID. You could use the class name and add event listeners on that, for example (just written quickly, not tested) document.querySelectorAll('.readMessage_trigger').forEach((trigger) => { trigger.addEventListener('click', () => { $.ajax({ url: "ajax/updateReadMessage.php", type: "post", dataType: "json", data: { msgID: trigger.value() }, success:function(result){ console.log(result.abc); } }); }); }); Which gets all of the elements with a class of readMessage_trigger, then for each one assigns that element to the 'trigger' variable, then adds the click event listener.
-
Is it possible to override IDs in a database?
There was a question similar to this on the r/php board on Reddit other day https://www.reddit.com/r/PHP/comments/b1i7rn/hey_guys_im_creating_blog_with_phpsql_database_my/ You might not be using PHP, but it is still relevent and it will answer your question in a far better way then I coul
-
Apps for both IOS or Android, or neither?
You can use things like Phone Gap, Apache Cordova, Ionic and React Native to make apps using HTML/CSS/JavaScript that work fine both on Android and iOS and can use native functionality like the camera, phone etc. All of the above with the exception of React Native get compiled down into a Webview app, which is basically an app with a browser window which loads the HTML/CSS/Javascript as a website. Reactive Native gets compiled down to Android and iOS apps written in their own native code.
-
og tags and twitter card meta
You can 'debug' both of them on the respective sites, I find that when I post a new article or update the image I need to force both to scrape again a couple of times to get the latest information. Have a look at https://developers.facebook.com/tools/debug/ (Just put the url in the input box and press debug, on the next page you may need to press scrape again once of twice)and for twitter https://cards-dev.twitter.com/validator
-
Create ordered list that uses roman numerals (i, ii, iii, iv etc), not 1, 2, 3, 4 ..etc
Change your <ol> to <ol style="list-style-type:lower-roman;"> or create a class in the CSS for your <ol> and place the css there. <ol class="roman-ol"> Then in your CSS ol.roman-ol { list-style-type:lower-roman; }
-
What kind of mobile phone do you use?
I've got a windows 10 acer laptop at home, and at work all but three of the 12 people on the development team use windows 10 (The rest use Mac) but in the design team most if not all of them use Mac's. I've got a Samsung S6, but when my contract is up later this year I'm considering moving to Google Pixel 2, but I need to research it and compare properly closer too! Personally, I'm not a fan of Apple products, I've used iPhones, iPads and Mac's for testing things, and I've not liked them at all, from the UI to to the feel to the functionality, I didn't like anything about them!
-
Can anyone here give me examples of work they did to land their first job in web development?
Thanks I'm not based in Manchester, but a bit down the road in Cheshire and currently working in Stoke on Trent, which is a little easier to get to than Manchester. I've always done both front end and back end, while I was self employed I was doing everything by myself, from meetings, concepts, and the actual build, maintenance, and creating and looking after a server for all the projects, but thats another story! I think deep down I've always preferred back end, and my role here is classed as a PHP Developer, but since learning Javascript I've been really enjoying that too, even if the stuff I have been doing is limited to DOM manipulation and AJAX requests (Though I did write a web view app via Cordova using HTML5 and Javascript last year) The company I work for have got a business subscription on Udemy and I've been doing their courses in my spare time, I've nearly finished one on ES6 and I've got a React and Redux one lined up afterwards as React is something I'd like to learn, I took a free course on it on Code Academy a few months ago.
-
Can anyone here give me examples of work they did to land their first job in web development?
I've been into web design since I was 13 (I'm 29 later this year) and completely self taught, I went from just messing about with HTML and CSS as a teenager to learning PHP and MySQL in my late teens and in the past few years teaching myself Javascript, and OOP PHP, but until just a couple of months ago, I didn't actually have a job in the field I love. After I left college in 2009 I got a job in marketing, but got made redundant just under a year later and struggled to get another job, I was wanting to turn my hobby of web design into a career, after a couple of years of suffering depression, applying for jobs and never hearing back, boredom after leaving college, I eventually lost touch with web design and when I finally came back into it a couple of years later in 2013 I was miles behind, I didn't know a thing about responsiveness, mobile first, the methods I'd always used were out of date, software no longer seen as industry standard, so I spent a few months learning to get back in the game, taught myself responsiveness and mobile first even if it seemed backwards to start with, I started looking for work around my local area, but due to lack of experience and not being able to drive most of the jobs were a good hour to an hour and a half away on public transport, and despite getting a few interviews, I never got a job. In the end, after encouragement from my family and partner I decided to go self employed, and I learned loads even if in the end it didn't pay off, over the course of 2 and half years I had about 10 customers, sure on pay day it was more money then I'd ever seen before, but in between that I was living on tax credits from the government, fortunately I still lived at home at this point or with my future in-laws. Fast forward to this past November, me and my fiancee were talking about how we want to get our own place, but one of us would need a full time job, and logically it made sense for me to look for work, as from both of our self employment ventures, I was more likely to get into work, and my business learnt less than hers. After spending a week or so putting a brand new up to date CV together, and making a portfolio website showcasing my work I started applying for jobs, in the first week I applied for a dozen around where I'm living now plus a couple further afield, and heard back from one, a market leading company based in Manchester, its actually one I didn't expect to hear from, but I had a telephone interview, followed by a Skype interview, then a face to face interview was arranged for the week before Christmas, unfortunately due to an accident on the M6 I never got there, but fortunately they rearranged it for the first week of 2018. I went to the interview, and it went well, but a week later I got an email saying I was unsuccessful, and after talking to them over the phone it was lack of experience that let me down. Later that day I applied for half a dozen more jobs, and that afternoon I got a telephone from one of the recruitment agencies I applied for just over an hour before asking for more information, and he arranged an interview with the company the following week. I went to the interview, and I should add I applied for a front end role, and it went really well, and they were very impressed with the work I'd done through self employment, after getting home I contacted the recruitment agency about my thoughts on the interview and how well it seemed to go, and he said the feedback he'd recieved and been the same, they were very impressed, and they'd asked if I'd be open to a PHP developer role rather than front end, it'd be for more money, I said I only applied for front end as I wasn't sure my PHP would be up to spec, but I'd be open for it. I had an interview with the PHP team leader the week after (now about 10 days after I first applied for the job), which went really well, and by the time I'd got back home I'd been offered the job, this was a Thursday, and I would be starting the coming Monday. I've now been here just under 2 months, earning more money than I've ever seen before, I've learnt so much (More OOP, Gulp, Automatic deployment to name a few which I've put into practice on the website I made for my fiancee's business) and wouldn't change a thing for the world. Bit of a long post, but I hope it helps, even for someone who has always loved web design I originally found getting my foot in the hard till I went self employed and started doing work commercially and learning more, rather than random short lived projects for myself. The job I applied for in Manchester might have been more money than I'm getting now, but honestly I feel better here, its a lot closer to home than Manchester, its only a 20 minute train ride (Its right near the station) rather than an hour or more on the M6 in rush hour traffic, and I've already started saving for when me and my fiancee can get our own place, I loved self employment, but I loved being employed, doing something I love every day, even more.