How to create an event listener across varied devices?

Posted on 2011-05-08
Last Modified: 2013-11-11
I'm trying to submit a simple jQuery Mobile contact form on my iPhone then on my iPad be able to be notified in real time that the form has been submitted and show the new submission in a list.  So the iPhone is using the 'user' interface and the iPad is using the 'admin' interface of the same app.

I can have the iPad refresh the page every 30 seconds and then see the updated list that way but wanted it to be a real-time thing.  I just need a pointer in the right direction as can't get my head around how to do it.

I figure it must require an event listener or maybe a database trigger or something?  Not a noob to jQuery so learning as I go.  Any help greatly appreciated!! Thanks in advance :)
Question by:Zenturi0n
    LVL 38

    Accepted Solution

    You can do a "persistent connection" but it's not usually recommended.
    I'd suggest a JavaScript (Ajax) every one second that checks and does an innerhtml insert if it finds something. That way you are not refreshin the page, just doing a tiny query.

    Author Comment

    Thanks aarontomosky, appreciate it!  Got me on the right track.

    For anyone interested I also found this helpful:

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now