refer to the http://dojotoolkit.org/documentation/tutorials/1.9/hello_dojo/demo/slideInGreeting.php
it is totally working fine.
The I copy the html and try to run it on my local apache.
it also working!
But when I try to load the same dojo.js on my web server, it won't work...!!?
(load the dojo.js on my localhost web server, instead of ajax.googleapis.com)
Here is my file structure, html and errors.
Oh, Finally I got it myself.
The dojo.js is only the base, if I use other module of dojo I have to add it on my need.
So I need to download all the dojo modules from:
http://dojotoolkit.org/download/
download the zip file --> Release:tar.gz (7.9MB)zip (12MB)
unzip it , then I can find all the files, include fx.js.
Finally , it working on my server now!
Related
Hi im using Angular 7 and Spring framework, and i need to run a external JS function in TS file.
I tested on a single Angular application and it works well, when i compile the Angular code and put the result on spring resources and generate war file the script is not recognized, the console in browser shows "function undefined".
I modified Angular.json file setting the path of the script in "scripts" section, even if i set in index.html < script src="path/to/script2run.js"> it doesn´t works.
How can i load in spring application my JS file?
Can you help me please?
Regards
Where do you keep your JS file?
If it's working when you run with ng serve it should work when it's compiled as well.
So I think issue in the path. Try to see if this file is coming together with your intex.html.
You can do in Chrome browser:
right click -> inspect -> Network and refresh the page and you will see all files coming from server side to browser. If your JS file is not there than it's path issue make sure your js file is exist from where you are trying to get it.
I have XAMPP and a separate cloud server. Inside XAMPP's htdocs there is a folder with a repository that I use to both develop, and push to the cloud server.
When using the same folder structure as the server ie. a script / js folder holding all the js files in the root of the folder (public_html/scripts) the server works fine.
The problem comes in development, where trying to access the scripts using src = "script/scriptname.js" gives me the error saying "Failed to load 404". Now I know it's just trying to search in localhost/scripts or htdocs/scripts rather than htdocs/projectname/scripts. I don't really want to have to move the script folder in and out all the time, as that's really tedious.
Is there any way to use a script folder without having to move it around in Xampp?
I am going to be working on an angular project without internet access, so my links to the cdn will not function. I would like to save the angularjs library to a folder inside of my project. Here is what I have tried:
I went to the cdn link, copied all of the text, pasted it into a file, and saved that file as angular.min.js . I then commented out the script tag for the cdn in my index.html file, and put in a new script tag specifying the path to the new saved file. When I open my project, I get the error "Uncaught ReferenceError: angular is not defined."
Here are the relevant pieces of my project's file/folder structure:
project
|_core
| |_public
| |_app
| |_index.html
|_libraries
|_angular.min.js
And here is my script tag:
<script src="./../../../libraries/angular.min.js"></script>
And here is the link to the cdn from which I copied the text:
https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js
Are you using a local webserver of any kind? Angular and many scripts need to be loaded from http and not file://. For this, you could use python's SimpleHTTPServer: python -m SimpleHTTPServer 8080 -- will open an http server on http://localhost:8080, open the url in your browser and you should be good to go. Also note that the order in which you load the scripts in your HTML is important, and Angular needs to be loaded before all modules of code that use it.
<script src="../../../libraries/angular.min.js"></script>
How about this ?
Have you just tried this?
<script src="/libraries/angular.min.js"></script>
Maybe your server start website (localhost:80) from the root of your project
You can use Grunt task to minify and concatenate all files. You can read the docs of GruntJS. Very useful.
http://gruntjs.com/sample-gruntfile
see the concatenate section.
if you do that manually you have check the sequence of lib files. Angularjs lib need to be on top.
There are chances of errors.
yes just to include a file you don't need Grunt
check in chrome inspect developer tool in network tab if your file angular.min.js loaded properly. If not you can change the path and try but if it is loading and still you are getting same error so please create jsfiddle or plunker of your file so that we can look it in detail.
I am using Phonegap Build to build for IOS/Android. Just a test app at the moment but I am confused. I compress my app folder:
myApp/
config.xml
/www
index.html
index.js
myApp.zip <- I create the zip file at this level (only main files shown here)
My problem is, I have completely changed the index.html and index.js file, re-zipped the files, uploaded them to PhoneGap Build, but it insists on showing the original index.html file and executed the original index.js file. Locally, using the PhoneGap app on my iPhone I can see the changes when browsing on my ip address at :3000 but PhoneGap refuses to see that I've made a change. VERY frustrating. Anyone have any ideas how I can force PhoneGap Build to wake up and smell the coffee? I have completely deleted the app via the web interface and re-built and it STILL shows the old version. Any help appreciated,
thanks in advance,
Wittner
Ok I think this might be the answer. It's been a while since I worked with PhoneGap and I used a boilerplate code and structure for my tests. I moved the config.xml inside the www directory and compressed the files from inside it. Uploading this now works.
Maybe it's a stupid question but i am a newbie using node js, and I think that it can be used just with js files, I dont know, I installed node js on my windows and i started the web server but i dont know how to run the files, I have always worked with apache, I saw there is a folder called scrips in the node js installation folder
but i dont know how to run the files, I have always worked with apache.
In NodeJS, it's either you write the web server (it's like writing Apache itself), or use a framework that does it for you (it's like adding in something like Apache). Suggesting you check out Express. It's something almost close to CodeIgniter (writing points of entry).
Can i run a php file or a html file in a node js web server?
NodeJS is for JS. Your server files are all in JS. As for HTML, checkout Express (mentioned above), or if you just want to serve plain HTML (or static files), you may want to check out Connect Static