Is there an alternative for webbrowser control in wp7? - windows-phone-7

I implemented a browser using webbrowser control (WP7). I want to add some features but this control has a lot of limitations. For example it is not possible to modify cookie, access postdata from request, etc. I need a lot of workarounds to implement features different from simple navigation. I notice that some people use httpwebrequest... is it possible to display the response without using webbrowser? Is there a more flexible alternative to this control?

Well, it depends on what you actually want to do. Do you need to present something to the user? Do you want to access the underlying data while he is browsing?
HttpRequest/HttpResponse are used whenever you want to initiate a request from your code i.e. without a user actually navigating to something. This is for machine-machine communication, not for user-machine interaction.
When you give us an example of what you want to build, we can give more detailed answer.

Related

Javascript user request layer

I am currently writing a compatibility layer between browsers and for this I need to ask the user to confirm an action. Currently the only standard way in JavaScript to do this is window.confirm which is synchronous and I do not want to block the whole site. So I would be searching for a library which can display a asynchronous browser-like request (e.g. the ones they use for Geolocation).
EDIT: And similar to the native one I do not need/want the user interaction to be modal. Just displaying and reacting on user input that is all.
I remember having seen such sites, but cannot remember where.
Can someone point me in the right direction?
As a bonus it would be great if it would work an look like the native ones in IE, FF and Opera.
the jQueryUI library has a dialog plugin that can be made modal. Since it is JS, it does not block the rest of the page execution.

Email address locked in field like box?

So I dont know what it is called but I am looking for a way to box in the user entered email addresses like they do in hotmail, where any valid email is boxed into that rectangle locked email once it is validated in real time? Also in hotmail they allow you to remove it by clicking the X and edit it by clicking the edit icon. I want to add more features also appart from edit and delete, so I guess I use AJAX for this? I dont know the term for this so not sure how to search for sample code and design patters for this. Any idea on what this is called or sample links with different design patterns?
You mean a facebook-like autocompletion? It uses AJAX (Javascript libraries: Prototype / Scriptacoulous).
Maybe this library is not perfectly suited to your use case, but you definitely need Javascript to do it as soon as the user enters it, but not necessarily AJAX - via javascript you can create input-hidden fields that will get submitted with the rest of the form.

specific limitations of AJAX?

I'm still pretty new to AJAX and javascript, but I'm getting there slowly.
I have a web-based application that relies heavily on mySQL and there are individual user accounts that are accessed and the UI is populated with user specific data.
I'm working on getting rid of a tabbed navigation bar that currently loads new pages because all that changes from page to page is information within one box.
The thing is that box needs to reload info from the database, etc.
I have had great help from users here showing that I need to call the database within the php page that ajax is calling.
OK-so pardon the lengthy intro-what I'm wondering is are there any specific limitations to what ajax can call that I need to know about? IE: someone mentioned that it's best not to call script files and that I should remove scripts from the php page that is being called and keep those in the 'parent' page. Any other things like this I need to keep in mind?
To clarify: I'm not looking to discuss the merits/drawbacks of the technology. I'm wondering about specific coding implementation that I need to be aware of (for example-I didn't until yesterday realize that if even if I had established a mySQL connection on the page, that I would need to re establish that connection in my called page as well...makes perfect sense now).
XMLHttpRequest which powers ajax has a number of limitations. I recommend brushing up on the same origin policy. This is a pivotal rule because it limits where AJAX calls can be made.
First, you can't have Javascript embedded in the HTTP response to an AJAX call. That's a security issue.
No mention of the dynamics of the database, but if the data to be displayed in tabs doesn't have to be real-time, why not cache it server-side?
I find that like any other protocol, Ajax works best in tightly controlled conditions. It wouldn't make much sense for updating nearly the whole page, unless you find that the user experience is improved with an on-page 'loader'. Without going into workarounds, disadvantages will include losing the browser back button / history, issues such as the one your friend mentioned, and also embedded resources and other rich content can suffer as well, and just having an extra layer of complexity to deal with in your app. Don't treat it as magic sauce for your app - make sure every use delivers specific results that benefit your client / audience.
IMHO, it's best to put your client side javascript in a separate page and then import it - neater container. one thing I've faced before is how to call xml back which contains code to run such as more javascript - it's worth checking if this is likely earlier on and avoiding, than having to look at evals.
Mildly interesting.

GWT, with multiple clients

I am designing a web application using GWT currently, which is also the first time i am using GWT. I just have a general question about how (or can) GWT handles communications between multilpe clients.
My application needs user to login and has personalized pages for different users, GWT is well able to do all of these. The only problem is user needs to know what other users are doing, a simple example is like Google Talk, when one user is "typing", the other side will be noticed. So i am just wondering if GWT can do this?
As i said this is my first time using GWT, so, if GWT is well able to provide the these user interacting functions, i will go with GWT, otherwise i can make changes when it is not too late.
Thanks!!!
Looking at the example you gave, if user A starts typing, there's no problem sending the "started typing" event to the server. The server would than have to look up who user A is talking with (say, user B), and get the information to B's browser. This is, of course, the trickier part, but there is more than one way to perform the task, as described for instance here.
In summary, if you're OK with passing the requests through the server, I don't see a problem with using GWT as the underlying technology.
What you need is server push/ajax push/comet/many other names. I've summarized the options you have for GWT in a different answer.
For a quick start, check out NGiNX_HTTP_Push_Module - IMHO it's the easiest one to customize to your needs and they provide a nice chat example that should get you started. However, if you also use jQuery or Mootools in your application (for example, for UI effects), you might want to also consider Ajax Push Engine/APE-Project (but remember that jQuery/Mootools might require some tweaking to work with GWT). Those two are my favorites :)

How is AJAX implemented, and how does it help web dev?

From http://en.wikipedia.org/wiki/AJAX, I get a fairly good grasp of what AJAX is. However, it looks like in order to learn it, I'd have to delve into multiple technologies at the same time to get any benefit out of it. So two questions:
What are resources that can help me understand/use AJAX?
What sort of website would benefit from AJAX?
If you aren't interested in the nitty gritty, you could use a higher-level library like JQuery or Prototype to create the underlying Javascript for you. The main benefit is a vastly more responsive user interface for web-based applications.
There are many libraries out there that can help you get benefit out of AJAX without learning about implementing callbacks, etc.
Are you using .NET? Look at http://ajax.asp.net. If you're not, then take a look at tools like qcodo for PHP, and learn about prototype.js, jquery, etc.
As far as websites that would benefit: Every web application ever. :) Anything you interact with by exchanging information, not just by clicking a link and reading an article.
Every website can benefit from AJAX, but in my opinion the biggest benefit to AJAX comes in data entry sections - forms basically. I have done entire sites where the front end - the part the user sees had almost no AJAX functionality in it. All the AJAX stuff was in the administration control panel for assisting in (correct!) data entry.
There is nothing worse than submitting a form and getting back an error, using AJAX you can pretty much prevent this for everything but file uploads.
I find it easiest to just stay away from all the frameworks and other helpers and just do basic Javascript. This not only lets you understand what's going on under the covers, it also lets you do it in the simplest way possible. There's really not much to it. User the JS XML DOM objects to create an xml document client side. Sent it to the server with XMLHTTPRequest, and then process the result, again using the JS XML DOM objects. Start with something simple. Just try sending one piece of information to the server, and getting a small piece of information back.
The Mozilla documentation is good. Sites that benefit from it the most are ones that behave almost like a desktop application and need high interactivity. You can usually improve usability on almost any site by using it, however.
Ajax should be thought of as a means to alter some content on a page without reloading the entire page.
So when do you need to do this? Really only when you have some user interactions or form information that you want to keep intact while you change some content on the page.

Resources