Unable to download Javascript from remote installation (Codeigniter) - javascript

I installed my CI application on a remote server (an OpenShift install). I have Javascript files included in the view headers. When I try to access the application, all the Javascript files are stuck in "GET" (looking at firebug Net console) and spin endlessly. Am I missing some specification? Here is an example of what I have in the view header file within the head tags
<script src="<?php echo base_url('js/jquery-1.8.2.js');?>"type="text/javascript" charset="utf-8"></script>
Thanks!
Mmiz

Turned out that the base_url in applications/config needed to specify https instead of http: which is what I had. This might be an OpenShift deployment thing but it did solve my problem!

Related

How do i connect my app.js file to my index.html to make dynamic

i was not able to load my app.js module to my index.html file to make my webpage dynamic. tried several approach my code does not have any error. i checked my browser which indicate a message as "acsees to script from origin has been blocked by CORS policy:" it also inicate failed to load resources (app.js) NET: :ERR_FAILED. really need help tags are JavasciptECMA node.js HTML5 Css3

How to load local JavaScript libraries in Github Pages?

I recently deployed my website to GitHub Pages - https://max-stevenson.github.io/my-year-in-books/
I have a two local JavaScript libraries (jQuery and swiped-events) downloaded and within the following directory: src/public/js/lib.
In my index.html file at the root directory, I am linking to the two libraries like so:
<script type="text/javascript" src="/src/public/js/lib/jquery-3.4.1.min.js"></script>
<script src="/src/public/js/lib/swiped-events.js"></script>
But when I access the page on GitHub Pages I get the following errors:
GET https://max-stevenson.github.io/src/public/js/lib/jquery-3.4.1.min.js net::ERR_ABORTED 404 (Not Found)
GET https://max-stevenson.github.io/src/public/js/lib/swiped-events.js net::ERR_ABORTED 404 (Not Found)
When I run a local instance on my machine via a node express server and visit the site at localhost:3000, everything works great.
Can anyone please advise me where I'm going wrong and how to correctly reference my scripts so that they are loaded in GitHub Pages?
Try:
<script type="text/javascript" src="/my-year-in-books/scr/js/lib/jquery-3.4.1.min.js"></script
Or:
<script type="text/javascript" src="./scr/public/js/lib/jquery-3.4.1.min.js"></script

Javascript webpage doesn't work on localhost, but OK as file:///

but... file:///home/me/public_html/path/index.html everything works fine...
I'm trying to get a javascript page to run locally. (Using Ubuntu 14.04 and Apache)
When I open the file file:///home/me/public_html/path/to/index.html directory from file manager the webpage javascript runs fine all OK. (by double clicking the index.html file)
When I open it in chrome/firefox using localhost/~me/path/to/index.html only the html is rendered - the javascript doesn't run.
What have I missed or have failed to account for?
The js source files look like this:
<script src="libraries/jquery-1.9.0.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="libraries/prettify/prettify.js"></script>
<script src="libraries/tinycolor.js"></script>
[Solved] it was the subdirectory permissions... they were drwx------and should have been drwxr-xr-x - localhost works now.
Install FireBug in Firefox and view the Console tab. If you found any Network Error, then there is a problem for your Apache to perform requests.
When I faced the same problem, it was the issue of my WAMP stack not able to perform requests due to installation of Bitnami Stacks which were interfering with the Apache of WAMP.

NGINX+Bolt CMS - static content calls returning 404 errors

I decided to try out Bolt CMS on my web server, which has happily run several Wordpress sites for a few months now through PHP-FPM.
The site's front end works apparently fine, but the administration section of the site has problems. Every call to static content -- JS, CSS and image files -- results in a 404 (not found) error. What's more, when I look at the NGINX error logs I see that the server tries to access the files from this location:
/usr/share/nginx/
I don't use that directory anywhere in my nginx or bolt configurations! I've done "grep -R '/usr/share' ." in my nginx and bolt configuration directories, with no results returned.
Has anyone had this problem before? where is the /usr/share/nginx/ reference coming from?
Under distributions like RHEL/CentOS (probably others), /usr/share/nginx/ is the location of the default Nginx files. You can grep -R /etc/nginx and that will point you to where.
The usual problem that I encounter (create for my own misery) is that I will create the Nginx virtual host file as something like /etc/nginx/conf.d/example.com instead of /etc/nginx/conf.d/example.com.conf (note the .conf)

IDEA Failed to load resource

I want to debug my html + javascript site in IDEA and Chrome browser.
When I press 'debug' in console i got:
Failed to load resource file:///C:/js/angular.min.js
As I undestand, I need to set root path of my web site in properties. But where this option?
Such urls (site root-relative, the ones starting with slash) can't be properly resolved when opening file locally (using file:// protocol) - the browser will search for these files in your system root (C:/). You need using remote javascript debug configuration (access your html using the web server url rather than local path) to make this work. See http://wiki.jetbrains.net/intellij/Debugging_JavaScript_with_IntelliJ_IDEA#Remote_debugging for more information on remote javascript debugging in Idea
Note that Idea 12 supports so-called built-in webserver (http://confluence.jetbrains.com/display/WI/built-in+web+server), so you can test your code without installing a web server.
Instead of accessing from local file system try to access your html + javascript application from a web server by putting those appication files in web server.
Install XAMPP or WAMP in your system and copy your application into the htdocs folder to run that application locally.Also edit the files using IDEA from there.So,you can parallely edit using IEDA and run using XAMPP.
http://www.apachefriends.org/f/viewtopic.php?t=14173.

Categories

Resources