I need some help. I am working on the web page based on prestashop.
I've done everything on the local server on my machine.
Everything worked correctly. I decided to public the page so I move to the server.
When I open the page with chrome or other browser It looks very bad.
I checked the console and I've got some errors like this:
boston-armatura.pl/:26
GET http://boston-armatura.pl/new/themes/boston/assets/css/mystyle.css
boston-armatura.pl/:28
GET http://boston-armatura.pl/new/themes/boston//assets/css/theme.css
There is quite a long list.
I tried to change privileges.
I am also sure that the path is correct.
what might be the problem?
The server is not allowing you to access those files maybe due to some configuration you might have made on your .htaccess(webconfig) file.
And that's why it is giving a 403 error.
If there are errors, edit your .htaccess file which this:
Options -Indexes
This will deny access to just the directories and no js, css and any other files.
Related
My live server on visual studio keeps opening an old html file when i try to open my current one. Ive tried reinstalling the extension but its the same problem. Can anyone help please
i cannot have two project folders with an html file running through the live server. Only one html file can be streamed at one time other wise when trying to stream the second, it will stream the first (Like the issue i was having)
I was having the same problem but later on I find out that, I renamed my project folder while my server was still loading the same project but with the previous folder name so I changed the link to my new folder folder name and it worked for me.
I have live server will simply not work if there was an error in JavaScript file.
Even if you do an alert in the beginning of JavaScript file (for test purposes) but at the end of the file re-define a variable which was already defined before, this error will render liver server not working.
The html page will not respond as well.
Solution is to go to developer tools (F12), see the errors on console, fix them and save and the live server would be back in action! At least that was the case with me.
I had the same issue, sometimes it was an error on the console, or keep showing an old HTML, tried everything, deleting cookies, reinstalling everything and nothing worked,
Eventually, it worked with a hard refresh, what it really worked was to
Go to ---> vs code settings ----> extensions ---> live server config set as chrome private. So far no more errors!
The liveserver extension serves static pages like html files and it does not load javascript or typescript files. You need to setup a server yourself for example in react you use webpack to configure your local server and your app runs on a localhost:port. In a nutshell, you need to write a script for node to run your js files. And you won't need liveserver after that.
Below is the screenshot of the broken page and the second screenshot is what it's supposed to look like.
The error for the above is below:
GET http://localhost:8888/assets/global/css/components-rounded.min.css 404 (Not Found) jquery.min.js:4
I tried to find this components-rounded.min.ss inside the jquery.min.js, but I did not find any.
So it has error in jquery? But that's the official jQuery, and not something else.
The picture below is what the page is supposed to look at.
Somehow when I uploaded it to my server, it's OK for both Chrome and Firefox. I'm dumbfounded by this. I've tried changing the jQuery, it's still the same.
What can I do to fix this?
EDIT:
Most people ask me to download that components-rounded.min.css
But the file do not exists both in the server or in my local. But somehow it's working when I viewed the page in the server. And that components-rounded css file also does not exists in my server.
Yep, I've cleaned up my browser cache. Twice.
Download that file from your server and place it in the right file locally. Ideally commit it to version control too :)
You need to download the css file components-rounded.min.css and save it locally in your css folder.
Here is my manifest.appcache file.
CACHE MANIFEST
app.js
theme.css
logo.png
How can I force browser renew the app.js file only?
Application cache works slightly different to what you may think.
When a new version of the manifest becomes available, the browser goes through all the files and determines which have changed on the server.
The browser does this by sending the "If-Modified-Since" header with the request.
If the file hasn't been modified, the server will return code 304 (not modified) and the browser will skip the download and move to the next file.
Only files that have been modified get refreshed.
It's also a good idea to include a version or hash in the manifest, so a new manifest is always downloaded and checked.
In example, I use a php script to dynamically generate my appcache.manifest.
The script md5's all the included files to produce a hash/version number that's included in the manifest.
I had a same or similar situation to this.
I needed the browser to refresh the cache of file index.html.
And I could only see it refreshed when in incognito mode, which was not helping me much...
except for understanding why I wasn't seeing my file's update...
Anyway, what helped me was like the following:
Make backup of specific file that needs refreshing
Delete file in project
Run web application (without the file)
Return file to project, and then run application
For me, this worked.
I hope it will help others as well.
I'm using w3schools to try to understand how simple AJAX requests work and I came across this exercise page:
http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_load
I thought it was a simple example of an ajax request, so I copied and pasted the code into a plain ajax.htm file and copied and pasted the txt file it refers to:
http://www.w3schools.com/jquery/demo_test.txt
...and saved it as demo_test.txt file it refers to and saved them both in the same folder. (Keep in mind, I have an Apache server that processes PHP locally with no problem, so I would think a simple request like this would work on my local machine).
However when I click the button locally I get nothing. Then, when I upload the files to a different server (a "web host") suddenly it works.
So, this works on a webhost and it works at w3schools but it doesn't work locally on my machine in my root folder (where php works without a problem).
I would prefer to not have to upload my code before being able to test whether it works and would rather be able to process everything locally, like I do with PHP. Is it possible to do this locally or can I only make these requests remotely from my web host?
Why is my machine not processing this code? Any help would be appreciated. Thanks.
There are a lot of reasons you might not be able to load the file locally, but most will have to do with how you're serving the files. If you're using file:// you're going to run into problems; you said you have an Apache server, but didn't mention whether you were actually serving this site from it.
Have you checked to make sure that the route you're loading via your AJAX call is actually loading properly? E.g. if the ajax file is at your web root (http://local.site/ajax.html) and so is your txt file (http://local.site/demo_test.txt).
In this situation you can also always check your browser's Javascript console to see if you get any errors or if the files are actually loaded correctly. Depending on how you're serving and accessing the various files, you might be getting CORS errors as well.
The simplest solution is to make sure you're running on a local webserver (your Apache) instead of directly viewing files.
I'm developing a Django application that contains a model with a date/time field. On my local copy of the application, the admin page for that particular model shows this for the date/time field:
alt text http://www.cs.wm.edu/~mpd/images/bugs/django-date-local.png
This is as expected. However, when I deploy to my webserver and use the application from there, I get this:
alt text http://www.cs.wm.edu/~mpd/images/bugs/django-date-server.png
The application on the server is exactly the same as my local copy, except that I have debugging disabled on the server (but I don't think that should matter...should it?). Why does the admin app on the server differ from the local admin app?
Update
The issue seems localized to Safari. The "Today" and "Now" buttons appear when the admin site is accessed via Firefox. It looks like Safari can't download some of the JavaScript files necessary to show these widgets (strange that Firefox can, though).
I noticed that Safari is receiving a "304 Not Modified" code for the following files, but I'm not sure what that means, or how to fix it. Obviously, these are the JavaScript files and images that control the date/time widget:
RelatedObjectLookup.js
DateTimeShortcuts.js
icon_calendar.gif
icon_clock.gif
I think you have to look at what is different between your firefox configuration and safary config
Off the top of my head:
One could be configured to use a proxy (messing with the trafic) the other not. Make sure the configuration is the same in both.
Safari could have cached the error clear the cache before testing again.
Try to access the gif files directly from the browser (by inputting the full url of the images) and run wireshark on the wire comparing both GET requests and responses. Something WILL be different that will help you to track the problem.
If you're getting 304 on those files. Flush your browser's cache and try again.
If it doesn't load again anyway, make sure you are getting 200 OK.
It seems like you have admin media missing (hence js and images aren't loading). I generally do following.
in settings.py
ADMIN_MEDIA_PREFIX = '/media/admin/'
Then I symlink path of django.contrib.admin.media within my media dir. Say:
ln -s /var/lib/python-support/python2.5/django/contrib/admin/media/ /var/www/media/admin
Development server serves admin media automatically. But on production servers one generally prefers to server static stuff directly from apache (or whatever server).
Check the media location, permissions and setup on your deployment server.
http://www.djangobook.com/en/1.0/chapter20/
Have you tried checking out firebug's NET tab to see if the admin javascript/css/image files are all loading correctly?
I had that problem once.
Compare all those files from the dev server against the production server.