xHTML Connecting HTML5 to backend
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Connecting HTML5 to backend

  1. #1
    Join Date
    May 2012
    Posts
    7

    Connecting HTML5 to backend

    I am new to HTML5.
    I want to create a program in HTML5, but I need also to have a backend which will handle all the logic.

    Can I connect a backend which is written in C# or in Java to HTML5? if so how?

    My program needs also to handle reading and writing to xml files. I guess that the backend will need to handle this task, but can the HTML side handle it as well?

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: Connecting HTML5 to backend

    [ merged threads ]
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: Connecting HTML5 to backend

    Quote Originally Posted by amit98765 View Post
    I want to create a program in HTML5, but I need also to have a backend which will handle all the logic.
    You would have to HTML5 is still limited in many ways since not all features are supported yet. HTML5 itself is a standard in progress...not fully proposed.

    Quote Originally Posted by amit98765 View Post
    Can I connect a backend which is written in C# or in Java to HTML5? if so how?
    You could use PHP, Java, RoR, Python, PERL, ASP classic, ASP.NET (C# or VB.NET), etc. You have plenty of options for the backend. However, what you use will depend on what your web host server runs.

    Quote Originally Posted by amit98765 View Post
    My program needs also to handle reading and writing to xml files. I guess that the backend will need to handle this task, but can the HTML side handle it as well?
    Client-side scripting (JavaScript) cannot read/write to the client disk. This would be a major security hole if that existed. All file operations will need to be handled by the server-side. The only writing you can do is to localStorage for offline database handling.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  4. #4
    Join Date
    May 2012
    Posts
    7

    Re: Connecting HTML5 to backend

    Thanks so much for your response, it helped me a lot. There is some other data I am trying to figure out and I hope you can help me with that too.

    The program that I want to develop needs to know how to “play” archive files, one at a time (meaning one on each session). Each archive file contains media files and an xml configuration file. The xml file will tell the program what the logic is, for example, which media file/s needs to be displayed at any time.

    I understand that the archive files will probably need to be located on the server (probably as an un-compressed folder), but I need my program to be able to run also as an offline program, meaning that the archive files will be able to be located on the user’s/client’s computer and that he will be able to run it without any internet connection.

    From my initial research on html5, I understood that there is a feature of HTML5 called the “offline application cache” that allows users to run web apps even when they are not connected to the Internet. According to my understanding, the user needs to be connected to the internet for the first time so the browser will download and store all the files it needs to display the page.

    My questions:
    1. Is there a way to use HTML5 in order to develop a “real” offline program which does not need to be connected to the browser and download the needed files for the first time?

    2. Is there a way to let the program read archive files that are located on the user’s computer and not on the server?

    3. When using the “offline application cache” feature, does the content (of the archive file in my case) is downloaded to the local storage or to the user’s computer?
    If the content is downloaded to the local storage it may be a problem for me, since the archive files can be a big size (20Mb to 400Mb) and the local storage provides only about 5Mb of space, and in addition I need to have an option for the archive files to be located on the user’s computer/device as a local files as well.

    4. Since each archive file is different from the other, also the files it contains are different. One of the html5 examples I checked out regarding this topic specified that when developing this feature, I need to mention the files names that need to be downloaded. Is there a way to avoid mentioning the file names themselves?

    5. Regarding the read/write to xml file issue – you mentioned that “all the file operations will need to be handled by the server-side”. Since my goal is that my program will be able to run also offline, is there a way to handle the read/write operations on the clients side in this case?

    Maybe to summarize some of my questions - is there a way to create a desktop application using html5? If so, what does it mean for the users, meaning how easy they can download, install and use this application?

    I would appreciate any input regarding this topic.

    Thanks!
    Last edited by amit98765; May 30th, 2012 at 01:44 PM.

  5. #5
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,840

    Re: Connecting HTML5 to backend

    What I'm seeing is that a web app is probably the worst attempt to implement such an app as you are describing.

    Quote Originally Posted by amit98765 View Post
    1. Is there a way to use HTML5 in order to develop a “real” offline program which does not need to be connected to the browser and download the needed files for the first time?
    Not really. HTML (regardless of version) ultimate serves to bring visual content to a browser. It is not meant to bring full programming features of an OS to its users.

    Quote Originally Posted by amit98765 View Post
    2. Is there a way to let the program read archive files that are located on the user’s computer and not on the server?
    No...as already stated in my previous post.

    Quote Originally Posted by amit98765 View Post
    3. When using the “offline application cache” feature, does the content (of the archive file in my case) is downloaded to the local storage or to the user’s computer?
    If the content is downloaded to the local storage it may be a problem for me, since the archive files can be a big size (20Mb to 400Mb) and the local storage provides only about 5Mb of space, and in addition I need to have an option for the archive files to be located on the user’s computer/device as a local files as well.
    Here's just another argument in why a web app is not for your implementation.

    Quote Originally Posted by amit98765 View Post
    4. Since each archive file is different from the other, also the files it contains are different. One of the html5 examples I checked out regarding this topic specified that when developing this feature, I need to mention the files names that need to be downloaded. Is there a way to avoid mentioning the file names themselves?
    No.

    Quote Originally Posted by amit98765 View Post
    5. Regarding the read/write to xml file issue – you mentioned that “all the file operations will need to be handled by the server-side”. Since my goal is that my program will be able to run also offline, is there a way to handle the read/write operations on the clients side in this case?
    Since this would require the same functionality as #2...the answer is also no.

    Quote Originally Posted by amit98765 View Post
    Maybe to summarize some of my questions - is there a way to create a desktop application using html5? If so, what does it mean for the users, meaning how easy they can download, install and use this application?
    Not at all. HTML is simply a web language. It is meant for displaying information for the user. Actual APIs and tie-ins to OS core features need to be through an interpreted language...not a markup language.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  6. #6
    Join Date
    May 2012
    Posts
    7

    Re: Connecting HTML5 to backend

    thanks for taking the time to answer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center