Backend Server Setup For Sending Message To Client?

Apr 13, 2009

Is it somehow possible to setup a backend server to send a message to a client? Or it is a client always have to establish a connection? What I'm trying to code is a simple chat script that sends a message to the client once a member of the chatroom has logged out. The only way that I can make this work is if the client either sends a message (which is a POST call) or when a time delay occurs (I've set a timer to run every 30s after the last GET or POST call). But both of these are basically CLIENT -> SERVER calls. I don't assume that the other way (SERVER -> CLIENT) is possible? no?

View 2 Replies


ADVERTISEMENT

Possible To Create Message Log In Client-server Web?

Apr 21, 2009

I posted the same post in PHP section but thought might be related to Javascript too. So here goes:

I want to create a decent log at clients side to show alerts from server.

So, server should be able to see a list of connected clients (registered user) on the website, and select a few of them, type something in textbox, clicks send to all of selected clients, and the message is shown in the log at client's website. Also plays a simple sound file when clients receive new message in the log.

View 4 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

JQuery :: Initial Setup - What File To Install On My Server If Don't Have GZIP Available

Jul 3, 2009

Cannot get jQuery to work (unless I access [url])

Is this permissible, or do I have to download jquery.js to my server? If not, I have other questions:

- My hosting service does doesn't have gzip compression enabled --what file do I need to install on my server if I don't have GZIP available?

- How can I extract that file (jquery.js?) from jquery-1.3.2.js.txt? (looked for GZipper, but from what I can see that's Mac s/w and I'm running windows)

View 7 Replies View Related

Sending Message On Load

Jul 20, 2005

I have a need for a page to pop up a user/password dialogue
when it loads and for the user/password that they enter to be sent to
be logged somewhere on the server. The underlying page then loads as
normal. Does anyone have an idea about how I might do this?

View 3 Replies View Related

Sending Jscript Client Side Variable To Asp File

Sep 6, 2005

I have an html page, with jscript inside. some variables, some of them
multidimensional arrays. i need to send this information, which can be
changed by the user, to an asp file. the only way i could think of, is
putting it inside hidden box and sending the form. is there any more
elegant way?

View 6 Replies View Related

Sending Data To Server With Iframe

Apr 5, 2006

Do you know a dynamic way to send 10kb of text or more using an iframe?

I tried to do that with by creating, in javascript, a dynamic iframe,
then create a form into this iframe and put the data in a textarea and
then call a sumbit(). Code:

View 1 Replies View Related

Sending Data To Server Through Json?

Jul 27, 2011

I am trying to send the login info from a form into a IIS server and the asp file on the server will just respond back with the following text "Welcome, &name" on a ajax form on the client side. Currently, i am using a GET response and would like to send using JSON instead.

html file on client side

Quote:

<!-- AJAX component-->
<!DOCTYPE HTML>
<html>
<head>

[Code]....

View 5 Replies View Related

Ajax :: Sending Multiple Requests To Server

Mar 18, 2009

I need to send 15 requests to my server and get results, these results are queries to other sites. I then update my page with the results. I need to know if I am taking the correct approach, as things are working a bit slow, and i.e., seems the be as slow as a snail.

Here is my function for the first request
Code:
function one(){
var xmlHttpa=null;
try{
xmlHttpa=new XMLHttpRequest();
} catch (e){
try {
xmlHttpa=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e){
try {
xmlHttpa=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Your browser does not support AJAX!");
return false;
}}}

xmlHttpa.onreadystatechange=function(){
if(xmlHttpa.readyState==4){
document.getElementById('resulta').innerHTML = xmlHttpa.responseText;
var el = document.getElementById('showMessagea');
el.parentNode.removeChild(el);
applystyle();
}}
xmlHttpa.open("GET","one.php",true);
xmlHttpa.send(null);
}

I then call this function and others from my page, one(); two(); etc. Am I correct in my approach?

View 1 Replies View Related

Server To Client Script

Nov 23, 2006

How can I get a server value into client event?

Or is there another way around my problem?

I have a ASP page that need to get the server IP
(Request.ServerVariables("LOCAL_ADDR")) to open a new asp page

this is some of my HTML that I want to work. Code:

View 2 Replies View Related

Jquery :: Sending Array From Multiple Selection Box To Server

May 25, 2010

I have a selection box that allows me to select muliple items. I'm trying to use the click event handler to send an array of multiple selections back to the server using the $.ajax function and I'm having some issues. Below is my html, javascript code, and PHP server-side code:

HTML CODE:
<label>Select a Color</label><br/>
<select name="ddl" id="multiple" size=9 multiple>
<option value='blue'>Blue</option>
<option value='green'>Green</option>
<option value='red'>Red</option>
<option value='yellow'>Yelllow</option>
<option value='white'>White</option>
<option value='brown'>Brown</option>
<option value='black'>Black</option>
<option value='orange'>Orange</option>
<option value='purple'>Purple</option>
</select>
<input name="btn" id="btn" type="button" value="Submit" /><br/><br/><br/>
<div></div>

JAVASCRIPT CODE:
$(document).ready (
function(){
$('#btn').click(
function(){
$.ajax ({
type: "POST",
url: "phpMultiple.php",
data: {data: $('#multiple :selected').serialize()},
success: callback
});
});
});
function callback(data, status) {
$("div").text(data);
}

PHP SERVER-SIDE CODE:
<?php
$data = ($_POST['data']);
?>

View 2 Replies View Related

Best Way To Send The Client Time To The Server?

Oct 21, 2009

What is the best way to get the client time to the server? Would I user http headers? (I dont know how to do that) or is ajax the best method? I could use ajax to send the unix timestamp to the server everytime a page loads and save the difference between it and the server timestamp as a session variable. sounds sensible?

I dont want to work with timezones but I do want to get the actual time set on the client's computer.

View 1 Replies View Related

Served To The Client Via The Web Server & The Web Browser?

Jul 22, 2011

I understand that JavaScript resides on a server and is served to the client via the web server & the web browser.Is it possible to run JavaScript programs locally without the web server piece?

View 3 Replies View Related

Ajax :: Request Using Prototype Not Sending HTML Form To Server

Mar 20, 2007

I spent the best part of yesterday trying to get my form to be sent to the server however for the life of me I cannot figure out the problem. I haven't used prototype before but here is my code that I think should work perfectly fine,The php script works perfectly, i've entered test data into it and it makes a connection to the third party server using curl and then requests information that I get back i.e. the routing id comes back. But I cannot test the data using the form as the request isn't working for some reason.

View 3 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

Create A Cookie On The Client And Let The Server To Retrieve It?

Jul 8, 2009

id like to know how can i create a cookie on the client side as well as to script my server side coding to retrieve the cookie value.

View 1 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

Compress Text On Server, Decompress On Client Using JavaScript?

Mar 29, 2006

I'm new to JavaScript. I have relatively large amounts of text (~200 kB) that I need to transfer to my web application every now and then. Using RAR, I get a 5:1 compression ratio on these files, for example one of 180 kB is compressed to 34kB.

Is there some standard way to decompress files in JavaScript?

View 1 Replies View Related

JQuery :: Notify/update Client When Change On The Server

Jun 10, 2009

I'm trying to implement a simple chatting website. For now what the code does is checking every 10 seconds if there are new posts stored in the database (newer than the last check, 10 seconds ago). Is there a more efficient way than doing this with a timer??? for example, is there some kind of event listener attached to the server that would notify the client whenever the db is updated?

View 1 Replies View Related

Jquery :: Ajax Returning Values From Server To Client?

May 27, 2011

I'm doing some jquery and ajax work with C# asp.net MVC on the server.

I have this JS function:

function DeleteListing(receiptItemId){
$.ajax({
url: "DeleteListing",
type: "POST",

[Code].....

What I'm wondering is there ways to return values from DeleteListing on the server to the success function?

View 4 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

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

Update A Page On Receiving A Message From The Server

Jun 13, 2006

i am trying to put some code within my js such that, when the server
"sends it a message" it refreshes the page. now i have the refresh part
of things. the place where i am stuck is, how can my server (tomcat, am
using a java web app) send a very small piece of info to the js which
when it receives it, refreshes the page.

View 1 Replies View Related

JQuery :: [form] Stop Success Message Return If Validation Fails On Server Side

Oct 12, 2009

I am making a call to a php file which right at this minute has no validation, all validation is been done by the jquery form plugin. the validation (xss prevention soon to be implemented) in the thanks fails I want to stop the processing of the form i.e. stop the return of success.

[Code]...

View 1 Replies View Related







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