Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7193337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:09:00+00:00 2026-05-28T20:09:00+00:00

I my previous question I asked how to implement the chat feature using client

  • 0

I my previous question I asked how to implement the chat feature using client side technology especially using jquery mobile. I had also put up the question in the jquery mobile forums too but I was disappointed.
Finally I was able to set-up a chat feature on my local machine by referring this blog

I am running jsJac client side chat but now I am implement the same thing using jquery mobile frame work I googled and try to figure out how it can be done, but could not find any examples as such. If any suggestions and ideas on how to do and get the things done, kindly help to achieve this.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:09:00+00:00Added an answer on May 28, 2026 at 8:09 pm

    The people at pub nub have kindly incorporated my code in into the samples on their
    web site if the code below dosen’t work
    goto http://www.pubnub.com/blog/easy-mobile-chat-html5-jquery-mobile

    This html will work straight out of the box in the browser (you don’t need a server – useful for mobile web apps)

    eg. Create a file with the below html on your c: drive c:\temp\chat.html . Then point your chrome browser to
    file:///C:/temp/chat.html. Alternatively upload the html to a host. Then point the iphone or android or PC broswer to the url and let your jaw drop. mobile – to mobile to pc chat! This runs purely in the js client u don’t need your own server

    Note, this is a open demo chat channel, goto pub nub for more details http://www.pubnub.com

    Enjoy

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Pub Nub Chat</title>
            <meta name="viewport" content="width=device-width, initial-scale=1"> 
    
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
    
        <script src=http://cdn.pubnub.com/pubnub-3.1.min.js></script>
    
    
    
        <script>
        chatName = "";
        $(document).ready(function(){
    
                PUBNUB.subscribe({
                channel  : 'chat',
                callback : function(text) { 
                    $("#incomingMessages").append("<div class='message'><span class='username'>" + "></span> " + text + "</div>");
                    $("#incomingMessages").scrollTop($("#incomingMessages")[0].scrollHeight);
    
                }
    
            });
    
    
            $("#chatNameButton").click(function(){
            chatName = $("#chatNameText").val();
            if(chatName.length <= 0)
                chatName = "unknown";
    
            $(location).attr('href',"#chatPage");
            });
    
            $("#chatSendButton").click(function(){
    
            PUBNUB.publish({
                    channel : "chat",
                    message : chatName + " : " + $("#messageText").val()
                })
            $("#messageText").val("");
            });
    
    
        });
    
        </script>
    
        <style>
        .message
        {
            padding: 5px 5px 5px 5px;
        }
        .username
        {
            font-weight: strong;
            color: #0f0;
        }
        .msgContainerDiv
        {
            overflow-y: scroll;
            height: 250px;
        }
        </style>
    </head> 
    
    <body> 
    
    <div id=pubnub pub-key=demo sub-key=demo></div>
    
    
    
        <div data-role="page" id="loginPage" data-role="page" data-theme="a">
            <div data-role="header">
                <h1>Pub Nub Chat</h1>
            </div>
    
            <div data-role="content">
            <div data-role="fieldcontain">
                <label for="chatNameText"><strong>Chat Name:</strong></label>
                <input type="text" name="chatNameText" id="chatNameText" value=""  />
                <button id="chatNameButton">Ok</button>
            </div>
            </div>
    
            <div data-role="footer">
                <h4>Pub Nub Chat</h4>
            </div>
        </div>
    
        <div data-role="page" id="chatPage" data-role="page" data-theme="a">
    
            <div data-role="header">
                <h1>Pub Nub Chat</h1>
            </div>
    
            <div data-role="content">
            <div id="incomingMessages" name="incomingMessages" class="msgContainerDiv" ></div>
            <label for="messageText"><strong>Message:</strong></label>
            <textarea name="messageText" id="messageText"></textarea>
    
            <fieldset class="ui-grid-a">
                <div class="ui-block-a"><a href="#loginPage" id="goBackButton" data-role="button">Go Back</a></div>
                <div class="ui-block-b"><button data-theme="a" id="chatSendButton" name="chatSendButton">Send</input>
            </fieldset>
            </div>
    
            <div data-role="footer">
                <h4>Pub Nub Chat</h4>
            </div>
        </div>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a previous question I asked how to implement a client side bad word
(Related to a previous unanswered question I asked). I want to implement a function
In my previous question posted in how to communicate with mobile devices using bluetooth
based my previous question asked here: Jquery Filter List DIVs via checkboxes i got
In my previous question I asked how to implement fixed number columns in cassandra
In a previous question I asked, the suggested answer was for me to partition
So in a previous question I asked about implementing a generic interface with a
In a previous question I asked about how to group XML elements logically, and
this question is an extension to a previous question i asked (and was answered).
This stems from a previous question I asked - about a write conflict with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.