Been tinkering for 3 hours how to get the things going.
For the javascript side
In web.php add the route
For the controller make sure you have added ->setCallback($request->input('callback')) at the end of the json response.
Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts
Monday, 16 July 2018
Wednesday, 22 February 2017
Javascript Example To Call an Ajax
Example code in javascript to call an ajax
function changeDeliveryTime() {
var deliveryMethod = $('#deliveryMethod').val();
var delAddress = $('#delAddress').val();
var schedule = $('#scheduleko').val();
$.ajax({
type : "GET",
url : "/ajaxchangedeliveryschedule.do?deliveryMethod=" + deliveryMethod + "&address=" + delAddress + "&scheduleId=" + schedule,
success : function(response) {
//successfully change the time
//alert('successfully change the time');
},
error : function(e) {
alert('Error changing time schedule: ' + e);
}
});
}
Setting and Getting Session Storage Sample Code
Alternative to hidden input type,
var isWeekly = sessionStorage.getItem("weeklyOrder");
sessionStorage.setItem("weeklyOrder", true);
Tuesday, 21 June 2016
Geocoding JSon Parse
Some good point in parsing
http://stackoverflow.com/questions/9058300/how-to-parse-json-reponse-received-from-geocoding-api-v3-in-android-applicatio
http://stackoverflow.com/questions/9058300/how-to-parse-json-reponse-received-from-geocoding-api-v3-in-android-applicatio
Saturday, 28 May 2016
How To Use Syntax Highlighter
Put this code before the </header> tag
Wrap your code in this tags
change the html tag to these values
actionscript3 bash, shell
c-sharp,
csharp
cpp,
c
css
delphi,
pas,
pascal diff,
patch
groovy
js, jscript,
javascript
java
jfx,
javafx
perl, pl
php
plain,
text
ps,
powershell
py,
python rails, ror, ruby
scala
sql
vb,
vbnet
xml,
xhtml,
xslt,
html,
xhtml
Wrap your code in this tags
change the html tag to these values
actionscript3 bash, shell
c-sharp,
csharp
cpp,
c
css
delphi,
pas,
pascal diff,
patch
groovy
js, jscript,
javascript
java
jfx,
javafx
perl, pl
php
plain,
text
ps,
powershell
py,
python rails, ror, ruby
scala
sql
vb,
vbnet
xml,
xhtml,
xslt,
html,
xhtml