0

I need some kind of advise, how to use technologies to achieve following functionality:

So, some web-developer place piece of code on his site, like this:

<script src="http://mydomain/Scripts/LoadDialog" type="text/javascript"></script>
<img src="http://mydomain.com/image"
 onclick="window.ShowModalDialog(someArgs, **UserID**);" />

When user pressing on image button, there is server call occurs, and depending on userID server will return content. As a server side technology is planed to use ASP.NET MVC. On front-end side will be JavaScript and jQuery.

Please let me know please if you know how it can be achieved or where I can start from.

Alexandr
  • 1,452
  • 2
  • 20
  • 42
  • possible duplicate of [Show modal JS dialog on any site using button](http://stackoverflow.com/questions/8704370/show-modal-js-dialog-on-any-site-using-button) – Álvaro González Jan 02 '12 at 19:06
  • I recently wrote something specific to this. Its on GitHub at https://github.com/akshayrawat/js_iframe_modal – Akshay Rawat May 31 '12 at 11:00

2 Answers2

1

I'm re-posting my answer just to help others facing similar problems, since your previous thread is closed as duplicate of this one, and since a while back I also struggled to find the best sources for developing third-party widgets.

As said, most of what you need is described in:

http://alexmarandon.com/articles/web_widget_jquery/

Blog entry is especially useful for the ones opting for jQuery as JavaScript library of their choice, as it shows how to escape conflicts in case a different jQuery version is already present.

Main challenges you will face on your task are getting around browsers same origin policy, and there you are stuck with either IFRAME or JSON-P. You should opt for JSON-P, and a good and concise tutorial about you can read at:

http://java.sun.com/developer/technicalArticles/J2EE/mashup_2/

Don't worry that it is a centered somewhat around JAVA, everything will be crystal clear for you. To answer your question, yes, I have some experience in developing third-party widgets, so feel free to ask me whenever you encounter some problems, all best

Master Slave
  • 27,771
  • 4
  • 57
  • 55
-1

Pass the userID in the POST or GET parameters. The server will respond according to the parameter. Use AJAX for the request. onSuccess callback of AJAX request should show a alert(data);

nurnachman
  • 4,468
  • 2
  • 37
  • 40