I'm quite new to coding in Visual Code, and been able to use LiveServer flawlessly with html.
But I decided to go with php for a project, so I made a server with XAMPP, downloaded chrome extension for Liveserver, but it doesn't work as it should:
If I add something (like a div) in e.g. index.php, Ctrl+S, the browser reloads, and shows the new div flawlessly.
On the other hand, if I change some styling, which I do through SASS (yes, "watching" is on"), LiveServer detects some change, reloads the page, but uses the same css as before. Checked with browser F12, it is DIFFERENT from the one saved in the original folder...
So basically no matter how I change css, browser doesn't reload the new one.
Can you help me to make it work?
Thank you!
Try to clear browser cache and check if there is some errors in the console (where you watching sass files)
Related
I have an issue migrating a site where the links are all broken. It's a html site but uses php file system. The links in the index.html has \ in front of it. There's a file of php files like: Configuration.php, FileSystem.php, Bootstrap.php, Handler.php. How do I revert to just regular hmtl links.
Thanks!
If all you want to do is convert the dynamic PHP based website to a static HTML is easy.
Open the website in Firefox (Chrome will probably work too, but I did not test).
Go to File->Save Page As... and select a directory on your PC.
Firefox will then download the main file and needed dependencies to the PC eliminating all the PHP since it doesn't even know the server generated the page dynamically using PHP.
You can now deploy the site where ever you like.
Please note that if there are JS files that actively communicate with the server to download content dynamically you'll have to edit them yourself.
I have my site on the localhost by using XAMPP. Every time I edit a file, I change its' extension to .html from .php to be able to edit it properly with WebStorm.
I noticed for some reason if I modify the css/scss while the folder on the server, the updated css will not be loaded. Why is that?
Now I have to edit everything from .php to .html and move folder out of XAMPP every time I have to edit CSS. And even if I then move again the file into the XAMPP folder, some of my css still wont work..?
3 solutions for this.
Use incognito mode in your browser.
When you refresh to see the css use control+f5 so you do
cache-refresh.
Remove cache from the developer console of your browser.
Pick which fits best for your (personally i use the second one)
You can also do a hard reload using Ctr+Shift+R and it will start to work again. thats what works for me or try hard refresh using ctrl+f5, but hard reload works best for me after I use that I can simple refresh and it works.
Often times while working in Netbeans the changes I make in my code are not visible in the actual project. I'm working on a website using HTML/PHP and a lot of times, I make certain changes to my code, save it and then when I open the website in my browser it's like I never made any changes. It's really frustrating. Please help.
PS: I've noticed it mostly happens when I make changes to the CSS file.
First I would think of blaming Netbeans. Or you for not letting Netbeans upload changes to the server on Save.
But if it is mostly CSS (and I suppose Javascript), I would think of caching by your browser.
You can try Ctrl-F5 -in your browser- for forced refresh.
Or set the cache settings on your development server so, that a file is never cached
Developing with Netbeans 6.9.1
Using Firefox/Safari
Using MAMP Server
When developing a PHP application through Netbeans I find that most of my changes will show up in the browser when I Test Run my code. Little things such as links I do or css changes are lost or are not carried over in the browser test even though I can refer back to the line of code and note that what has been displayed is not my code. I am using Firebug so I can definitely know that links or styles are not being carried over into the test run.
How do I fix the problem to make sure I can accurately test my developments?
As mentioned by Thilo, this sounds like a browser caching issue.
I use a Firefox plugin called Web Devoloper, this has an option to simply disable/enable your browsers cache in a drop down menu. It also has many other features that you would find useful too.
I'm trying to build an Adobe Air app which runs from a PHP file.
Currently I have an index.html file which then performs a location.href to move to realfile.php - this gets round the limitation that a root file has to be HTML.
My problem is that the *.php files contain JavaScript which in turn make use of Adobe Air code, specifically printing. I overwrite window.print to the Air version which works fine in HTML.
As soon as the code is copied to the PHP file it doesn't even attempt to call it, yet other JavaScript works fine.
I read around a bit more and now know that Air will only run in a HTML page. Although there is no explanation that I could find that explains why this is...
How I think I can fix this:
My current idea is to add a RewriteRule in my htaccess to make PHP files accessible via a .html file extension. This should trick Air into thinking it's a HTML document, whilst the server is still able to process the PHP that is on the page.
When I get around to it, I'm more than happy to re-write the app to make it fully AJAX driven, which is what everyone else seems to be doing.