21
votes
8answers
62k views
using jquery $.ajax to call a PHP function
This may be a simple answer, but I'm using jquery's $.ajax to call a PHP script. What i want to do is basically put that PHP script inside a function and call the PHP function from javascript.
...
2
votes
4answers
223 views
Events triggered by dynamically generated element are not captured by event handler
I have a <div> with id="modal" generated dynamically with the jQuery load() method:
$('#modal').load('handlers/word.edit.php');
word.edit.php contains a few input element, which are loaded ...
1
vote
5answers
1k views
Creating jQuery AJAX requests to a PHP function
So far when creating AJAX requests I have been posting to a separate PHP file. Is it possible to create a jQuery AJAX request that calls a PHP function rather than posts to a separate page?
If you ...
27
votes
13answers
13k views
close a connection early
I'm attempting to do an AJAX call (via JQuery) that will initiate a fairly long process. I'd like the script to simply send a response indicating that the process has started, but JQuery won't return ...
42
votes
7answers
13k views
Multiple javascript/css files: best practices?
I have about 7 Javascript files now (thanks to various jQuery plugins) and 4-5 CSS files. I'm curious as to what's the best practice for dealing with these including where in the document they should ...
11
votes
6answers
17k views
How to access PHP variables in JavaScript or jQuery rather than <?php echo $variable ?>
How do I access PHP variables in JavaScript or jQuery? Do I have to write
<?php echo $variable1 ?>
<?php echo $variable2 ?>
<?php echo $variable3 ?>
...
<?php echo $variablen ...
7
votes
2answers
2k views
Long Polling/HTTP Streaming General Questions
I'm trying to make a theoretical web chat application with php and jquery, I've read about long polling and http streaming, and I managed to apply most principles introduced in the articles. However, ...
18
votes
10answers
16k views
Sessions and uploadify
I'm using uploadify, and i can't set sessions in my php files, my script looks like this:
$("#uploadify").uploadify({
'uploader' : '/extra/flash/uploadify.swf',
'script' ...
4
votes
8answers
10k views
generating a screenshot of a website using jquery
I would like to generate a screenshot thumbnail of any given url using strictly javascript. If this can't be done can anyone point me in the right direction to do this with my own api?
edit I just ...
19
votes
5answers
22k views
Passing JavaScript Array To PHP Through JQuery $.ajax
I want to manipulate a javascript array in PHP. Is it possible to do something like this?
$.ajax({
type: "POST",
url: "tourFinderFunctions.php",
data: ...
14
votes
3answers
13k views
Simple jQuery, PHP and JSONP example?
I am facing the same-origin policy problem, and by researching the subject, I found that the best way for my particular project would be to use JSONP to do cross-origin requests.
I've been reading ...
1
vote
2answers
569 views
How can I pass variables from JavaScript to PHP?
I am using jQuery to calculate prices. Here is a small snippet of my JavaScript:
// Prices: radio
var curLam = "gloss";
$("input[name=lamination]").click(function(){
var gloss = 5;
var matt = 6;
...
0
votes
0answers
560 views
Get xpath location of element in iframe(iframe from my domain)
I have a two codes and I try to connect this two codes in some way. Also in code is function for get xpath location but how to use this on iframe. $(#iframeID).... and function to write result of ...
20
votes
10answers
27k views
Gmail like file upload with jQuery
I would like to upload files just like google mail does. I would want to use jQuery and PHP to do it is there anyway of getting the progressbar etc.?
Here I added a video of how google does it. ...
14
votes
1answer
23k views
Ajax File Download using Jquery, PHP
I want to use the ajax functionality to download whereby the user will click the download link which will (using ajax and $_GET) access a PHP file which will process the sent $_GET variables and ...