How to send variables with GET without reloading page

What I'm trying to accomplish is the following. I have a php page which loads some variables from an mysql db. Then I want to send these variables using GET to another page without opening the page where the variables are being send to. At first I really didn't know how to do this until I came across the following: $( document ).ready(function() {

如何使用GET发送变量而无需重新加载页面

我试图完成的是以下内容。 我有一个从MySQL数据库加载一些变量的PHP页面。 然后,我想使用GET将这些变量发送到另一个页面,而无需打开要发送变量的页面。 起初,我真的不知道该怎么做,直到遇到以下情况: $( document ).ready(function() { $.ajax({ url: 'the_url', type: 'GET', data: {Gender:Male,DateOfBirth:1968-07

PHP AJAX datetime range probleme on SQL Query

I have a big problem and I hope I will find the solution here. After 4 days of useless search I come here to ask for a solution. Here is my problem. I use a SQL Server database and php as server side language with AJAX to send the params to the php server. My web app must display a list of some data if user input some date range. Here my html form code : <form method="post" action=""&

SQL查询中的PHP AJAX日期时间范围问题

我有一个很大的问题,我希望我会在这里找到解决方案。 经过4天的无用搜索,我来到这里寻求解决方案。 这是我的问题。 我使用SQL Server数据库和php作为AJAX的服务器端语言将参数发送到php服务器。 如果用户输入某个日期范围,我的网络应用程序必须显示一些数据的列表。 在这里我的HTML表单代码: <form method="post" action=""> <input type="text" placeholder="Start date : dd/mm/yyyy" id="date1" na

AJAX call not working in jQGrid

I am trying an AJAX call inside the beforeSelectRow event of my grid as : beforeSelectRow: function(rowid, e) { $.ajax({ url: "gridedit.jsp", dataType: "json", async: true, cache: false, type:"GET", data: { before:'row', },

AJAX调用不在jQGrid中工作

我正在尝试一个AJAX调用 beforeSelectRow 我的网格事件如下: beforeSelectRow: function(rowid, e) { $.ajax({ url: "gridedit.jsp", dataType: "json", async: true, cache: false, type:"GET", data: { before:'row', }, success:

JavaScript returns undefined

I have the following JSON that I receive from a URL, we call the URL here www.blabla.com/testjson And it returns: [{"Identifier":1,"Naam":"NOT Given","Adres":"Kopenhagen 9","Postcode":"0000LL","Plaats":"NOT Given","Longitude":"0.00000","Latitude":"0.00000"}, {"Identifier":2,"Naam":"NOT Given","Adres":"NOT Given 1","Postcode":"0000LL","Plaats":"Rotterdam","Longitude":"0.00000","Latitude":"0

JavaScript返回undefined

我有我从URL中收到的以下JSON,我们在这里称为URL www.blabla.com/testjson 它会返回: [{"Identifier":1,"Naam":"NOT Given","Adres":"Kopenhagen 9","Postcode":"0000LL","Plaats":"NOT Given","Longitude":"0.00000","Latitude":"0.00000"}, {"Identifier":2,"Naam":"NOT Given","Adres":"NOT Given 1","Postcode":"0000LL","Plaats":"Rotterdam","Longitude":"0.00000","Latitude":"0.00000"}, {"Identifier":3,"N

How to access an object's contents in javascript?

When I do $.each(result, function(i, n){ alert("key: " + i + ", Value: " + n ); }); then for each iteration I see key: 276, Value: {"owners":["he"],"users":["he","m"],"end":"07/06-2011","groups":[],"type":"in"} How do I access the values of owners , users , end , groups , and type for each iteration? In Perl would I have done foreach my $key (keys %result) { print $result{$key}{owners};

如何在javascript中访问对象的内容?

当我做 $.each(result, function(i, n){ alert("key: " + i + ", Value: " + n ); }); 然后我看到每个迭代 key: 276, Value: {"owners":["he"],"users":["he","m"],"end":"07/06-2011","groups":[],"type":"in"} 我如何访问每次迭代的owners , users , end , groups和type值? 在Perl中,我会完成 foreach my $key (keys %result) { print $result{$key}{owners}; print $result{$key}{users}; ... } 更新

ajax is sent but callback function is ignored

So here is my function function ajax(addr,loading, loadTo, json){ addr = addr.replace(' ', ''); if (loading){ $("#"+loading).fadeIn(); } if (json){ $.getJSON(addr, function(data){ alert('whoooo working'); // <--- it never goes here if (loading){ $("#

ajax被发送,但回调函数被忽略

所以这是我的功能 function ajax(addr,loading, loadTo, json){ addr = addr.replace(' ', ''); if (loading){ $("#"+loading).fadeIn(); } if (json){ $.getJSON(addr, function(data){ alert('whoooo working'); // <--- it never goes here if (loading){ $("#"+load

jQuery JSON Parsing Error

I have a web page that returns this JSON when called: [{"id":"53","desc":"Roberts"}] I am using this jQuery to call it by AJAX: $.ajax ({ url: rootPath + "data/topology/stations", dataType: 'json', data: { areaID: $("#lbxArea").val () }, success: function (data) { // Use data for actions }, error: function (jqXHR, textStatus, errorThrown) { alert (textSt

jQuery JSON解析错误

我有一个网页在调用时返回这个JSON: [{"id":"53","desc":"Roberts"}] 我正在使用这个jQuery来通过AJAX调用它: $.ajax ({ url: rootPath + "data/topology/stations", dataType: 'json', data: { areaID: $("#lbxArea").val () }, success: function (data) { // Use data for actions }, error: function (jqXHR, textStatus, errorThrown) { alert (textStatus); alert (e

Access Java / Servlet / JSP / JSTL / EL variables in JavaScript

I have a form in JSP. I have to populate it based on the request object (from the servlet). How do I use Java Script for accessing request object attributes or if you can suggest me any other better way to populate form dynamically? You need to realize that Java/JSP is merely a HTML/CSS/JS code producer. So all you need to do is to just let JSP print the Java variable as if it is a JavaScrip

在JavaScript中访问Java / Servlet / JSP / JSTL / EL变量

我在JSP中有一个表单。 我必须根据请求对象(来自servlet)填充它。 如何使用Java脚本访问请求对象属性,或者如果您可以建议我有其他更好的方式来动态填充表单? 你需要认识到Java / JSP只是一个HTML / CSS / JS代码生产者。 因此,您只需让JSP打印Java变量,就好像它是JavaScript变量一样,并且生成的HTML / JS代码输出在语法上是有效的。 假设Java变量在${foo}的EL范围中可用,以下是几个示例如何打印它: <script&g

Call Servlet and invoke Java code from JavaScript along with parameters

I have session key that is a JavaScript variable which I got from a REST API call. I need to call my Java code in a servlet and pass that key as a parameter. What JavaScript function can I use to do that? Several ways: Use window.location to fire a GET request. Caveat is that it"s synchronous (so the client will see the current page being changed). window.location = "http://example.c

调用Servlet并从JavaScript调用Java代码以及参数

我有一个会话密钥,它是从REST API调用中获得的JavaScript变量。 我需要在servlet中调用我的Java代码并将该密钥作为参数传递。 我可以用什么JavaScript函数来做到这一点? 几种方法: 使用window.location来激发GET请求。 警戒是它是同步的(所以客户端会看到当前页面被改变)。 window.location = "http://example.com/servlet?key=" + encodeURIComponent(key); 请注意内置的encodeURIComponent()函数在传递它之前对

Uncaught ReferenceError: $ is not defined?

How come this code throws an Uncaught ReferenceError: $ is not defined when it was OK before? $(document).ready(function() { $('#tabs > ul').tabs({ fx: { opacity: 'toggle' } }); $('#featuredvid > ul').tabs(); }); Results in tabs don't close anymore. jQuery is referenced in the header: <script language="JavaScript" type="text/javascript" src="<?php echo get_option(

Uncaught ReferenceError:$未定义?

这段代码是如何引发的 Uncaught ReferenceError:$未定义 什么时候可以? $(document).ready(function() { $('#tabs > ul').tabs({ fx: { opacity: 'toggle' } }); $('#featuredvid > ul').tabs(); }); 标签中的结果不再关闭。 标题中引用了jQuery: <script language="JavaScript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/js/sprinkle.js"></script> <sc