Laravel javascript - javascript

I'm using socket.io for my websockets in laravel. I'm having difficulty in writing API call for my location change method.
Is there a way to write javascript code in controller of Laravel rather than loading a view and then emitting a socket.
Many Thanks in advance

Related

Passing NodeJS data to Javascript

I have a web application with a client that receives data from a server. I have the data in NodeJS, but I want to pass the data to a Javascript file. The Javascript file is included in a HTML file, so I can't make the files communicate with eachother.
I am new to NodeJS, so it can be a stupid question, but anyones help is appreciated
This is for a project where I need have a data stream, and I need to pass it into a web application. I tried to pass the data to different page inside my application and then I tried to get that data on that page inside my web application via Javascript, but I couldn't make that work. I'm not even sure if its possible at this point.
Your node server can't communicate with your front-end without a specific way of communication like websocket, you have many other way to communicate with your front-end as node-server, take a look at server send event for example.
By the way your front-end can call your node server more easely with a get request as said #tomerpacific in comment.
For that you have to open a route with your express app. Routing with express
And for call it on a GET request, for that you can use the XMLHttpRequest, and if you have implemented jQuery on your front, you can use Ajax jQuery.

Spring Boot, Demo project and Ajax call

I new to web development. I have a lot of question to ask.
I using spring boot for server side
How to use HTML & JS in front
How to make a AJAX call to connect JS and spring boot controller
My plan is to create a Single page application
This is an extremely open ended question, and breaks some of the rules of Stackoverflow. Questions should be specific, relating to a problem that your encountering, with any solutions you've tried provided.
That being said, I would recommend going through some tutorials on building a REST API with Spring Boot and doing AJAX in JavaScript.
REST API with Spring
AJAX with JS

Persistent Socket to send data from PHP to Front-end

I currently have a PHP back-end and a jQuery front-end on my web application. The app constantly updates a stream of data on the front-end; right now it does this by continually polling a PHP script from jQuery's $.post() function. This is not efficient and causes delays in the data. I believe a socket (maybe Socket.io?) can solve this problem, but I don't know much about them. How can I setup a socket with PHP and my Javascript front-end? Where can I get more information about this? Where could I find an example?
Thank you,
--

Where to call the API the MVC pattern?

I am developing a mobile app with Javascript on the client side and rails as the api.
I am using Monocle by Tapquo, a MVC javascript framework. I need to call my server to retrieve data in json format.
Should I rewrite the model class method using ajax request instead of the default local storage calls so when I create an object, the call is made in the model? Or should I make the calls inside the controller?
What is the convention?
I'm not sure about Tapquo, but most MVC implementations that are network savvy are really MVC-S, where the S is "service". In other words, you implement a service layer in your app that your controller calls to fetch the model that it wants to work with.

Call SOAP webservice(Made in .NET) through Javascript

I am developing one mobile web application.
In this, i want to call a Web Service and fetch data from their using Java Script only.
I searched a lot and try to implement some code also but it didn't help me out.
One thing is that the Web Service was made in .NET using SOAP.
So, please help me to solve it immediately.
One easy would be to create an ASP.NET Web API Http service wrapper around your current webservice and use jQuery to access it. This will be much simpler than using JS to access a SOAP service.
More on ASP.NET Web API: http://www.asp.net/web-api

Categories