Load files with JSON [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is it possible to load several data files (file1.xml, file2.xml, file3.xml,..) with
jQuery.getJSON
My objective is to load data in an application which is based on JQuery+HTML5.

If your data is in the same domain as the javascript code executing the AJAX request, you can do it by a simple jQuery get request:
$.get("/url-to-source",function(response){
//do what ever you want to do with response
});
If the data resides in a different domain than your javascript code, you should use jsonp, see examples:
http://www.jquery4u.com/json/jsonp-examples/

Related

Can data from a db be displayed on a web page? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have a very simple question: when loading a web page the Page_Load function is called so that the page can be loaded. In this function can I insert some code that allows me to select and view in the browser the data present in an external database?
This answer could be of help.
You could then write a script that fetches data from a database. How you do that is a question in it self but I can recommend checking out w3schools which is good for learning plain Javascript in the beginning.

How should I call my internal API from JavaScript? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have an API in my app, how can I call the API in a JS script when I don't have a URL and I'm still in development?
Do not specify the domain name as part of the API's URL and deploy the JavaScript application to the same domain/port as the PHP API. You may have to do this anyway for security reasons (look up CORS).
So, if you call your API endpoint at /api/endpoint from your application deployed at /app, you will be independent of the domain, no matter if you are working locally
http://localhost:8080/app
http://localhost:8080/api/endpoint
, or in production
https://example.com/app
https://example.com/api/endpoint

javascript get callback from method [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm using the cameratag js library functions and am wondering how I get the callback response from them (for example the publish() function). Similar to how you would get the response from an ajax call. I'm pretty novice at javascript.
that is not javascript or jquery, that response will be sent to your server after you upload a video, you will receive a POST request to a specified URL in YOUR server which will include that JSON inside the request body. What you have to do is to parse the JSON and process it in your server function, for example, save the info in your database

Create Html template document from Javascript and Php variables [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am developping an application. As final result the application generates a Html document consisting of variables from external Javascript and Php files.Which is the safest way to pass these variables?.
Thank you very much.
You can use AJAX to do this, you make the request in JS, and process the information in PHP(server side), and you can return an JSON Object with the variables, or simply, return the HTML code and output it.
Hope it helps :D

Send information to another HTML page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a HTML form and need to send the user input information to another HTML page using Javascript. But I'm don't know how to send this information to appear in the other page.
Can anyone help?
Add all data to URL (send via _GET) and in next page parse url window.location.search. More info about parsing url HERE

Categories

Resources