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 2 years ago.
Improve this question
Cant seem to connect the ajax url to a php file. I've been fiddling around for ages.
File path of JavaScript: h******ze.com/public_html/wp-content/themes/buddyboss-theme-child/assets/js
needs to be be linked to file path PHP:
h******ze.com/public_html/wp-content/plugins/buddyboss-platform/bp-templates/bp-nouveau/buddypress/activity/user-duration.php
setInterval(function(){
$.ajax({
url: '/public_html/wp-content/plugins/buddyboss-platform/bp-templates/bp-nouveau/buddypress/activity/user-duration.php',
success: function(data) {
$('.result').html(data);
}
});
}, 3000);
Assuming the website is visible at h???????ze.com and not h??????ze.com/public_html your URL should be /wp-content/plugins/buddyboss-platform/bp-templates/bp-nouveau/buddypress/activity/user-duration.php
public_html is the root of your website and will contain index.php so you need to point it there. The browser has no access to anything before this in the URL you are using.
Related
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 want to update a division of my webpage updated frequently. But the contents of the division is to be loaded from another file on the server which is unable to be accessed from the file. I have made the access for the first time through PHP on the server. When I'm updating the information, the javascript is on client-side and I'm unable to access it.Also, the meta tag refreshes the entire webpage. I just want to update the division
What are the ways to solve this problem?
You could do this with jQuery and AJAX
like this:
$.get('/route/to/file', { args }, function(data) {
$('#some-container').html(data);
});
If you need it to be fully realtime, you could also use Socket.io:
var ws = io( ... );
ws.on('some.realtime.event', function(data) {
$('#some-container').html(data);
});
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
I need to create a custom search box that leads to an outside url and I'm trying to figure out the best way to do this in Joomla 3.0
For example: We need to create a text field with character input and have a button that when clicked takes the data in the text field and inserts it into the "variable" part of this URL and then takes you to this URL:
https://forexample.com/storefront/search.do;jsessionid=CD66CBFCC5658D6C9327AA269764EBB2?searchType=keyword&keyword="variable"&emailAddress=
You could use jQuery:
$("button").click(function() {
var variable = $("#textbox").val();
window.location.replace("yoururl&" + variable);
})
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
i got this simple points system, where when a user clicks on the image it adds 20 points to the database through a mysql query. It works, however, I'm trying to make it so that when a user clicks on the image that it not only adds points to a users database but also goes to a website. I added correctly but then it links but doesn't add points. Any help would be appreciated.
Use Ajax for inserting points in your database and after response(in your success method) send it to your desired URL.
$.ajax({
type: "POST",
url: '/test/points.php',
data: formData,
success: function (dataCheck) {
if (dataCheck) {
window.location = 'www.example.com';
}
}
});
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I start a new mobile application using jQuery Mobile.
Basically it will pull Events and Gallery from Facebook.
1.Normal PHP files will be on server and I will just make a Ajax request to them.
Like this:
$.ajax({
type:"POST",
url : "www.example.com/example.php",
data : somedata,
dataType : 'json',
2.If I will make it like this with no Internet connetion it will show error.
There is a way to save(cache) the last call to server?
And if new call is made and ther is no Internet Conenction or Bad Request or any other error and empty response, show the latest good response!
Thank you for any suggestions.
1.It is normal if PHP files will be on server and I will just make a Ajax request to them.?
Sure it is.
2.There is a way to save(cache) the last opretaions?
Of course. You could try the HTML5 application cache, or other server-side (PHP) methods.
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 9 years ago.
Improve this question
I have a jquery function:
$.ajax({
type: "POST",
url: "submit.php",
contentType:'multipart/form-data',
data: $('#regForm').serialize(),
dataType: "json",
its work perfectly but image and files will not be send by this. how can I resolve it?
You cannot upload files directly with Ajax, but you can use an hidden iframe, and send form data using the target="iframe_name" attribute in <form>, see this tutorial: http://www.coursesweb.net/ajax/upload-images