JQuery :: Encode/decode Of JSON - Server-side And Client-side?

May 26, 2009

I am building a client-side and server-side solution and want to use JSON through Ajax in both directions. I have ASP or JavaScript server-side, though Microsoft's support of server side JavaScript seems nil, so I am reluctantly conceeding to use ASP. I'd appreciate suggestions on available solutions to encode/decode JSON on the server-side (ASP or JavaScript). I don't plan to load jQuery server-side so that rules out plug-ins. I'd also like to know what is the latest client-side encode/decode for JSON. Is it built in jQuery or a plug-in? In both server and client, decoding JSON securely is key, so using eval () to decode is out.

View 1 Replies


ADVERTISEMENT

Jquery :: JSON Submit - Decode Empty Array At Server Side

Feb 22, 2011

I am doing a password reset form using Jquery and PHP. If I try to submit an email id it should sent and email and report back the response text as success so that the user knows email has been sent. But I am stuck with JSON submit as I have an empty array to decode at the serverside. I am using minified version of json2.js from the official json.org website

Here is the code.
Code JavaScript:
var formdata = $("#log-box").serializeArray();
formdata = JSON.stringify(formdata);
var notifymsg;
alert(formdata);
$.ajax({
type: "POST",
url: "forgot-pass.php",
contentType: 'application/json',
data: formdata,
success: function(responsedata){
var some = responsedata.split("&");
$.each(some, function(index,value){
//alert("index="+index+"value="+value);
});
},
error: function(o, s, e){
alert("Form not posted
"+e);
}});
formdata alerted gives:
[{"name":"email","value":"ravi.k@gmail.com"},{"name":"acctype","value":"loginaccount"}]

PHP forgot-pass.php
Code PHP:
print_r($_POST);
Gives
Array(
)

View 3 Replies View Related

Passing Values From Client Side To Server Side Python Script

Jun 1, 2009

I am developing a web form using python cgi which has two list boxes. On selecting a value from the listbox1, the list box 2 should get auto populated with appropriate values (which are taken from the DB). I have written a javascript function to get the selected value from the list box1. But I am struck with passing the values from the javascript to the python function written in server side in which I have written the DB related stuffs.

View 1 Replies View Related

Sending Values From Server Side To Client Side Javascript

Jul 20, 2005

I have a Hyperlink within a String like below:

sSql = "SELECT DISTINCT " + "'Action' = '<center><a
href='+char(34)+'ChangeRequest.aspx?ID='+cast(Chan geRequest.ChangeRequest_ID
as nvarchar) +CHAR(34)+'>Open</a></center>',"

I want to invoke a Client side javascript function and pass the value
of the ID. How can I accomplish this such when a user clicks "Open" he
goes to a new window with the same ID.

I tried this but it does not work:
On Server side:
sSql = "SELECT DISTINCT " + "'Action' = '<center><a href= 'javascript:
NewWindow('+cast(ChangeRequest.ChangeRequest_ID as nvarchar)+
CHAR(34)+)'>Open</a></center>',"

On Client side:
function NewWindow(myID)
{
window.open("ChangeRequest.aspx?ID="+myID,"WindowName","width=500,height=600");
}
</script>

View 1 Replies View Related

Pass Parameter From Server Side Php To Client Side Script?

Aug 22, 2011

On the server side I have a php generated session parameter.
I need to pass it to javascript on the client side page.

I saw on the web the following solution code...

I tried it but it did not work.

View 1 Replies View Related

Adjusting Code To Use Either Server-side Or Client-side Validation--NOT BOTH?

Sep 11, 2009

I have the following PHP code, which uses server-side validation, which works fine. It the user leaves the text field empty it stores an error in a session array which is outputted on the page where the $_GET['id'] variable came from. I also implemented a snippet of javascript code that just checks to see if the cell is empty and throws up alert box. The problem is that both the javascript code and php error validation are both running when I click submit. The PHP code should be a backup to the javascript code in case the user has javascript turned off. The client-side validation should be the default. Not sure if this change should be made in my PHP Code or Javascript Code.

PHP CODE:
session_start();
require_once("../Modules/Connection_Functions.php");[code].....

View 1 Replies View Related

Client Side Script With Server Side Controls

Jul 20, 2005

I have a web form that has a checkbox on it and a textbox associated
with it. I want the textbox to be displayed when the checkbox is checked
and I want this to happen on the client-side instead of posting back to
the server. The checkbox is a server control (asp:checkbox...). I can
write some codebehind that will display an alert message upon checking
the box that looks something like this...

Page_Load...

Dim s As String
Dim scriptString As New System.Text.StringBuilder

chkExpDate.Attributes.Add("onclick", "alertmsg()")
scriptString.Append("<script language=JavaScript> function alertmsg()
{")
scriptString.Append("alert('hi'); }<")
scriptstring.Append("/" + "script>"
s = scriptstring.ToString()

Page.RegisterStartupScript("startup", s)

End Sub

I used this as a test to make sure the server control was running the
script. But, when I change the script to assess the value of the server
control checkbox such as checked = true, I get errors and if I just try
to display the asp:textbox, it doesn't work either.

View 1 Replies View Related

Server Side Or Client Side Validate?

May 14, 2007

I had a import function which allow for user import data from excel file. The number of row was dynamic, mean that user may import hundred or data or may thousand of line.

should i perform client side or server side validate?

the problem i faced was if the import thousand of line, i need display out thousand of text (multiple by 6, cause 1 got 6 fields)

the take a lot of time to loading and cause browser "hang" (response slow)

any solution for me?

View 13 Replies View Related

Converting Client Side CMS To Server Side?

Jun 16, 2010

I have the following client-side Content Management System VBscript which works great, now I'm looking at getting it to work server side so that I can update using online login rather than offline and having to upload files. To be honest, I have no idea where to begin with this,

Here's the full VB script:

[Code]...

View 1 Replies View Related

JQuery :: Show Server Side Process On The Client Using Ajax?

Feb 22, 2010

My login to the site is being processed using ajax, which does a redirect to the members page upon succesfull loggin in.The login feature however can in fact take a while because we need to initialise quite some data when a user logs in (his details, but also his privileges are loaded, his personal menu based on these privileges are being loaded, we are loading shopping cart info, we are initialising personalisation settings, and a whole lot more.It sounds like a big thing, but it isn't, and once logged in, the application is going great. the only thing is that the login proceure can take 3 - 4 seconds, and I would like to be able to show the client the progress of the serverside script:

"Searching your account..."
"Validating your privileges"
"Initialising your personal menu"
blablabla...

To do this, I might just call an ajax call that starts the login procedure, and then issue another ajax call every 1 second or so to update the status based on some session variables I set in the login procedure and that I can serve to the client when th next ajax calls come in, but I would love for this to work a little nicer as in just needing to initialise ONE ajax call which can send back statusupdates from the server...

View 1 Replies View Related

Request Server Information Client Side

Jul 23, 2005

The only way i can think of doing such a thing is having an active
server page that returns an image, that is generated on the fly. As
long as there is no caching on the client this in theory will allow
the client to perform an action on the server and display an image
generated on the fly as a result of this action without actually
reloading the page, simply by requesting an image.

View 3 Replies View Related

Difference Between Client And Server Side Script?

Nov 16, 2011

what is the difference between client side JavaScript and server side JavaScript? Client side JavaScript is directly embedded in the HTML code...what about serve side scripting?

View 1 Replies View Related

Post Data To Server From Javascript On Client Side

Jul 23, 2005

I have a few values and variables that I want to post to a server
(without using a SUBMIT button). Is there a way to post data from
within javascript - do sockets or connections have to be open for this
to work?

View 5 Replies View Related

Calling Server-side Function From Client Javascript

Nov 29, 2005

I am developing an ASP.NET (C#) application and need some help. I wish
to call a server-side function (in the code-behind "file.aspx.cs") upon
a user clicking on the "X" to close the browser window. Is there a way
to postback and call a server-side function when this happens? I am
aware of the browser's native "onunload" event, but am not certain that
what I'm looking for is actually possible.

View 2 Replies View Related

HTML Forms And Client-side Validation W/ Server Data?

Oct 28, 2010

I know that Javascript is client side, but I'd like to know the best way to populate HTML drop downs in real time based on information typed in the other HTML form fields with information found on the server as opposed to the client.For instance if a user wants to select certain files located in a directory on the server, as they type in the pathname supposedly containing the files the drop downs continually refresh themselves with the server files listed in that directory (if it exists, and apache has permissions to see what's inside) as if it was showing client files instead.

What would be nice is if my browser could continually query the server for some of its private information and not have to refresh itself to obtain it, whether that means the server-side would have to continually refresh itself makes no difference to me as long as the client-side doesn't have to. But I guess this is not possible because no matter what you would have to at least refresh the client-side page once?Submitting the form to a CGI or PHP script would not work because I need this functionality to help populate the form BEFORE I send it.I would like to not have to press a button to update the form every time I change the pathname and need to update the drop downs since this would be annoying.

View 2 Replies View Related

JQuery :: Client-Side Filesystem Access Using JS?

Jun 3, 2011

I'm adding feature to my site which allows the user to browse there filesystem inside of a div rather than an input file element in html. Is this possible in jQuery or JavaScript or do I need to develop a desktop app which allows filesystem access and connect it to the web app using PHP?

View 2 Replies View Related

JQuery :: Using Client Side XSLT Transformation?

Sep 3, 2011

When using client side XSLT transformation, Jquery functions like animate and fadeTo will fail and cause an overflow of errors. In Firefox the error reads "k[l] is undefined". The same happens in Chrome. I could give you an example, but you can simply use your imagination, as this isn't a problem with only a specific case of XSLT transformation. I am using v1.6.2 and consider this to be a serious bug.

View 5 Replies View Related

JQuery :: (client Side) Programmatically Set Rating?

Jun 14, 2009

I can't seem to figure out how to set the star rating value at clientrun time

View 1 Replies View Related

JQuery :: Set Combobox Selected Index From Client Side?

Nov 28, 2011

Can you please tell me how to set combobox selected index value from client side??

[Code]...

View 1 Replies View Related

Js Xml At Client Side

Jul 31, 2006

In my html page i've to show a grid with some data retrieved from an xml file ... i need to this beacuse i've to use online, on a webserver and offline
with all files on a usb key, cd, etc ...

which is the best way to accomplish this?

I suppose a solution it could be via javascript:

-locally open the xml file that contains the data e then render then grid. Now i wornder about the best way to do this ... i've read about xsl transofrmation and so on ... if it's possible i'h to achieve this with a cross-browser solution!

View 1 Replies View Related

Add Js Client Side

Jul 20, 2005

Is it possible to add a js function to a loaded web page on the client side?
E.g. IE is viewing google, can I add a javascript function to that instance
of IE viewing google? I am trying to hook browser events such as button
clicks and get information such as edit field text.

View 4 Replies View Related

AJAX :: Getting Server Date/time With No Server Side Script

Apr 19, 2010

I'd been looking for some way to get server date/time without using any server side script (such as ASP, PHP, etc).

I found this and it worked just excellent for me! I just want to share it because it wasn't easy to find.

I created a js document with code:

Code:

Now, I can use this js within a html like this:

HTML Code:

You may change your machine date/time and check both dates.

View 1 Replies View Related

JQuery :: Can Listeners Work For Html Added Client Side

Sep 15, 2010

I have taken over from a developer who has used javascript to add additional text input boxes to a form so there is no limit to the number of input boxes there can be. I have got a jquery autocomplete function that works fine if the input box is added by the server but the listener doesnt fire when the text box is added client side. As with all things this is part of a much bigger project and I only want to change the smallest possible part (add autocomplete to this text input box) MY QUESTION: is it even possible fo ra jquery listener to fire when the input box has been written client side after the page has loaded? Is there a way to "refresh" a listenerto find the new tag that have been added?

View 2 Replies View Related

JQuery :: Datatables - Server Side Processing PHP

Jan 21, 2010

I try this sample [URL], where data is procesed on server. I prepare tables in DB and data. and nothing isn't displayed in datable? Then I create same server_prcosing php and I checked syntax from php it was OK same as json, but jquery.datable did not process any data on screen.
source:

style type="text/css" title="currentStyle">
@import "css/demo_page.css";
@import "css/demo_table_jui.css";
@import "css/smoothness/jquery-ui-1.7.2.custom.css";
</style>
<script src="lib/jquery.dataTables.js" type="text/javascript" language="javascript"></script>
$().ready(function() {...

$("#example").dataTable({
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "SearchForms/server_processing.php"
});
});

View 5 Replies View Related

JQuery :: Add A Server Side Method To The Validator?

May 13, 2011

i'm trying to add a server side method to the jquery validator. my code is:

$.validator.addMethod("existing
",function (value){
$.ajax({url:"ajax.php",data: value,type:"POST"
,async: false, dataType: "text" }).responseText ==

[Code].....

View 2 Replies View Related

Scale With Client-side Javascript

Jul 23, 2005

Provided an interface to a search engine in which the onchange event in
a select list element generates between 7 and 13 additional elements
depending on the option chosen.

Here's what the customer *now* wants to do:
Generate between 200 and 350 elements. Furthermore, the logic is going
to be more complex.

I would be happy to make that happen, however here's my concern: I'm
already doing this from the server side, using CGI. I wonder what is
going to happen when we put that degree of "work" on the client browser.
I would welcome comments, caveats, or pointers to documentation and
discussions on this subject.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved